Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,12 @@ TaskGraph setupSinglePhi3FFNLayer(Phi3TornadoWeights weights, int layerIndex) {
phi3Config.rmsNormEps(), // epsilon
phi3State.localSize); // local memory size

if (shouldUseFinalNormalization()) {
unifiedLayer.task("attn_rms_finalize",
TransformerComputeKernelsLayered::reductionFinalNormalization,
context, state.temp, config.dim(), config.rmsNormEps());
}

unifiedLayer.task("attn_rms_qkv_projection", Phi3Kernels::fusedRmsNormQKVMatmulDirect,
context, phi3State.wrapX, // input
phi3State.wrapQ, // output Q
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,15 @@ TaskGraph setupSingleQwen2FFNLayer(Qwen2TornadoWeights weights, int layerIndex)
config.rmsNormEps(), // epsilon
qwen2State.localSize); // local memory size

if (shouldUseFinalNormalization()) {
unifiedLayer.task("attn_rms_finalize",
TransformerComputeKernelsLayered::reductionFinalNormalization,
context,
state.temp,
config.dim(),
config.rmsNormEps());
}

// Fused RMS Apply + QKV Projection
unifiedLayer.task("attn_rms_qkv_projection",
Qwen3Kernels::fusedRmsNormQKVMatmul,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,15 @@ TaskGraph setupSingleQwen3FFNLayer(Qwen3TornadoWeights weights, int layerIndex)
qwen3Config.rmsNormEps(), // epsilon
qwen3State.localSize); // local memory size

if (shouldUseFinalNormalization()) {
unifiedLayer.task("attn_rms_finalize",
TransformerComputeKernelsLayered::reductionFinalNormalization,
context,
state.temp,
config.dim(),
config.rmsNormEps());
}

// Fused RMS Apply + QKV Projection
unifiedLayer.task("attn_rms_qkv_projection",
Qwen3Kernels::fusedRmsNormQKVMatmul,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,15 @@ TaskGraph setupSinglePhi3Q8_0FFNLayer(Phi3TornadoWeights weights, int layerIndex
phi3Config.rmsNormEps(), // epsilon
phi3State.localSize); // local memory size

if (shouldUseFinalNormalization()) {
unifiedLayer.task("attn_rms_finalize",
TransformerComputeKernelsLayered::reductionFinalNormalization,
context,
state.temp,
config.dim(),
config.rmsNormEps());
}

// Fused: RMS apply + Q8 QKV matmul + direct Q/K/V split
unifiedLayer.task("attn_rms_qkv_projection_q8",
TransformerComputeKernelsLayered::fusedRmsNormQKVMatmulQ8,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,15 @@ TaskGraph setupSingleQwen3FFNLayer(Qwen3TornadoWeights weights, int layerIndex)
config.rmsNormEps(), // epsilon
qwen3State.localSize); // local memory size

if (shouldUseFinalNormalization()) {
unifiedLayer.task("attn_rms_finalize",
TransformerComputeKernelsLayered::reductionFinalNormalization,
context,
state.temp,
config.dim(),
config.rmsNormEps());
}

// Fused RMS Apply + QKV Projection
unifiedLayer.task("attn_rms_qkv_projection",
Qwen3Kernels::fusedRmsNormQKVMatmulQ8_0,
Expand Down