Unverified Commit c2c4c461 authored by Jhao-Ting Chen's avatar Jhao-Ting Chen Committed by GitHub
Browse files

[FIX] fused moe with lora shared expert dual stream (1.07x otps) (#34933)


Signed-off-by: default avatarJhao-Ting Chen <jhaotingc@nvidia.com>
Co-authored-by: default avatarMichael Goin <mgoin64@gmail.com>
parent f38f8c97
...@@ -133,15 +133,19 @@ class FusedMoEWithLoRA(BaseLayerWithLoRA): ...@@ -133,15 +133,19 @@ class FusedMoEWithLoRA(BaseLayerWithLoRA):
if getattr(self.base_layer.quant_method, "supports_internal_mk", False): if getattr(self.base_layer.quant_method, "supports_internal_mk", False):
# Use the existing modular kernel from the quant method # Use the existing modular kernel from the quant method
m_fused_moe_fn = self.base_layer.quant_method.moe_mk m_fused_moe_fn = self.base_layer.quant_method.moe_mk
# Don't let the kernel own shared experts so the runner can
# overlap them with routed experts via a separate CUDA stream.
m_fused_moe_fn.shared_experts = None
else: else:
# Create a new modular kernel via select_gemm_impl # Create a new modular kernel via select_gemm_impl.
# Don't pass shared_experts to the kernel so the runner can
# overlap them with routed experts via a separate CUDA stream.
prepare_finalize = MoEPrepareAndFinalizeNoEP() prepare_finalize = MoEPrepareAndFinalizeNoEP()
m_fused_moe_fn = FusedMoEModularKernel( m_fused_moe_fn = FusedMoEModularKernel(
prepare_finalize, prepare_finalize,
self.base_layer.quant_method.select_gemm_impl( self.base_layer.quant_method.select_gemm_impl(
prepare_finalize, self.base_layer prepare_finalize, self.base_layer
), ),
self.base_layer.shared_experts,
) )
if quant_config.use_mxfp4_w4a16: if quant_config.use_mxfp4_w4a16:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment