diff --git a/crates/engine-qwen35-cuda/src/qwen_forward/executor_prefill_chunk/prepare_micro_ffn_rows_fn/gdn_native.rs b/crates/engine-qwen35-cuda/src/qwen_forward/executor_prefill_chunk/prepare_micro_ffn_rows_fn/gdn_native.rs index 94932cf0..741743b8 100644 --- a/crates/engine-qwen35-cuda/src/qwen_forward/executor_prefill_chunk/prepare_micro_ffn_rows_fn/gdn_native.rs +++ b/crates/engine-qwen35-cuda/src/qwen_forward/executor_prefill_chunk/prepare_micro_ffn_rows_fn/gdn_native.rs @@ -2,6 +2,7 @@ #[allow(unused_imports)] use super::*; +use crate::qwen_forward::gdn::PromptLayer; use crate::qwen_forward::gdn::chunk_device::ChunkEdge; use crate::qwen_forward::gdn::chunk_producer::ChunkReady; use crate::qwen_forward::session::chunk::GdnChunkMicro; @@ -47,7 +48,8 @@ fn gdn_window_step<'ctx>( let gemm = workspace.gdn_gemm().map_err(crate::qwen_forward::gdn::driver_error)?; // Keep both real owners and the exclusive shared stream loan // alive until the whole producer's complete finite drain. - GdnStage::step_chunk_batch(binding, env.layer, window, current, cache, owner, &mut resources, &gemm) + let prompt = PromptLayer { binding, layer: env.layer, cache, current }; + GdnStage::step_chunk_batch(prompt, window, owner, &mut resources, &gemm) } /// The attention block of one row of the completed GDN window, with the row's chunk edge. diff --git a/crates/engine-qwen35-cuda/src/qwen_forward/gdn_prefill_batch/impl_gdnstage.rs b/crates/engine-qwen35-cuda/src/qwen_forward/gdn_prefill_batch/impl_gdnstage.rs index 035d2aa3..f10221ac 100644 --- a/crates/engine-qwen35-cuda/src/qwen_forward/gdn_prefill_batch/impl_gdnstage.rs +++ b/crates/engine-qwen35-cuda/src/qwen_forward/gdn_prefill_batch/impl_gdnstage.rs @@ -11,24 +11,21 @@ impl GdnStage { /// The batched Strata-prefill GDN step over one genuine current causal /// micro-window (`prepare_attention_micro_gdn`'s `execute` callback). Rows, /// residual-ready inputs and the cursor come only from `micro`, which is - /// validated against this chunk device; `current` is the actual device + /// validated against this chunk device; `prompt.current` is the actual device /// context the callback lends; `gemm` is the exclusively loaned shared /// workspace adapter, retained through the final drain of this call. /// Returns one `ChunkReady` per row, in order, each carrying its host copy /// of the Out projection and its genuine journal edge. All edges are minted /// only after the whole batch drained finite and the chunk device adopted /// the final state. - #[allow(clippy::too_many_arguments)] // Genuine micro, context, caches and loans. pub(in crate::qwen_forward) fn step_chunk_batch<'ctx>( - binding: &ModelBinding, - layer: LayerId, + prompt: PromptLayer<'_, '_, 'ctx>, micro: &GdnChunkMicro, - current: &Context<'_>, - cache: &DenseWeightCache<'ctx>, owner: &mut GdnChunkDevice<'ctx>, resources: &mut GdnBatchResources<'ctx>, gemm: GemmRef<'_>, ) -> Result> { + let PromptLayer { binding, layer, cache, current } = prompt; #[cfg(all(test, any(target_os = "linux", target_os = "windows"), target_arch = "x86_64"))] let _owner_wall_scope = crate::qwen_forward::owner_wall_profile::Scope::begin(crate::qwen_forward::owner_wall_profile::Stage::Gdn);