You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Allocate fused MoE bias parameters in the locality-domain device context #18336
FusedMoEMethodBase.create_weights selects device=torch.device("cuda") when a locality-domain weight context is active. It applies this device to w3_w1_weight and w2_weight, but not to w3_w1_bias and w2_bias.
Required change
Update tensorrt_llm/_torch/modules/fused_moe/quantization.py so both bias torch.empty(...) allocations in FusedMoEMethodBase.create_weights receive device=device.
Rationale
When module.bias is enabled in partition_weight_context(), the current code can allocate weights on CUDA while bias parameters use the ambient device. This can place related parameters on different devices and prevents the biases from using the locality-domain memory pool.
Acceptance criteria
w3_w1_bias and w2_bias use the same device variable as w3_w1_weight and w2_weight.
The behavior is unchanged when module.bias is disabled.
The non-locality-domain path continues to use the existing default allocation behavior.
Already handled on main: in tensorrt_llm/_torch/moe/fused_moe/quantization.py the device chosen for locality-domain weights (torch.device('cuda') when a locality-domain context is active) is passed to both w3_w1_bias and w2_bias allocations as well as the weights, since #18369 merged. Closing.
Activity
farazkh80 commentedon Sep 17, 2026
Already handled on
main: intensorrt_llm/_torch/moe/fused_moe/quantization.pythedevicechosen for locality-domain weights (torch.device('cuda')when a locality-domain context is active) is passed to bothw3_w1_biasandw2_biasallocations as well as the weights, since #18369 merged. Closing.