modulation ¶
MiniMax H3 RMSNorm and row-indexed modulation fusions.
Functions:¶
fastvideo.models.dits.minimax_h3_fusions.modulation.fused_residual_gate_rmsnorm_modulate ¶
fused_residual_gate_rmsnorm_modulate(residual: Tensor, branch: Tensor, gate: Tensor, weight: Tensor, scale: Tensor, shift: Tensor, index: Tensor, eps: float) -> tuple[Tensor, Tensor]
Fuse residual update, row-indexed gate, RMSNorm, and modulation.
index values must lie in [0, table_rows); see :func:fused_rmsnorm_modulate for why the wrapper does not check them.
Source code in fastvideo/models/dits/minimax_h3_fusions/modulation.py
fastvideo.models.dits.minimax_h3_fusions.modulation.fused_rmsnorm_modulate ¶
fused_rmsnorm_modulate(x: Tensor, weight: Tensor, scale: Tensor, shift: Tensor, index: Tensor, eps: float) -> Tensor
Run RMSNorm and row-indexed modulation in one strict Triton kernel.
index values must lie in [0, table_rows). Unlike eager index_select, the kernel does not raise on out-of-range values (a device-side bounds check would synchronize); callers are safe by construction (timestep_indices * 3 + token_tags, SP pads with 0).