Class GatedDeltaNet
java.lang.Object
smile.llm.model.qwen.GatedDeltaNet
Qwen3.5 Gated DeltaNet linear-attention mixer (reference / torch path).
-
Constructor Summary
ConstructorsConstructorDescriptionGatedDeltaNet(QwenModelArgs args, int linearLayerId, DeltaNetStatePool statePool) Constructor.GatedDeltaNet(QwenModelArgs args, int linearLayerId, DeltaNetStatePool statePool, TensorShardSpec shard, TensorParallelGroup tpGroup) Tensor-parallel constructor using local head counts fromshard. -
Method Summary
Modifier and TypeMethodDescriptionForward pass.module()Returns the native module handle for weight registration.voidreplaceGemmProjections(LinearOp qkv, LinearOp z, LinearOp out) Replaces GEMM projections typically present as FP8 in Qwen checkpoints (in_proj_qkv,in_proj_z,out_proj), leaving densein_proj_a/in_proj_bfor the residual load path.voidReplaces the five DeltaNet projections with quantized ops (already sharded).
-
Constructor Details
-
GatedDeltaNet
Constructor.- Parameters:
args- model hyperparameters.linearLayerId- ordinal among linear-attention layers.statePool- shared DeltaNet state pool.
-
GatedDeltaNet
public GatedDeltaNet(QwenModelArgs args, int linearLayerId, DeltaNetStatePool statePool, TensorShardSpec shard, TensorParallelGroup tpGroup) Tensor-parallel constructor using local head counts fromshard.- Parameters:
args- model hyperparameters.linearLayerId- ordinal among linear-attention layers.statePool- shared DeltaNet state pool.shard- local head / rank shard description, ornullfor full width.tpGroup- tensor-parallel group, ornullfor single-device.
-
-
Method Details
-
replaceProjections
-
replaceGemmProjections
Replaces GEMM projections typically present as FP8 in Qwen checkpoints (in_proj_qkv,in_proj_z,out_proj), leaving densein_proj_a/in_proj_bfor the residual load path.- Parameters:
qkv- combined QKV projection op.z- z-gate projection op.out- output projection op.
-
module
Returns the native module handle for weight registration.- Returns:
- module handle.
-
forward
-