[MoE] Align TRTLLM MXFP4 autotune buckets (#50942)
Signed-off-by: Thien Tran <gau.nernst@yahoo.com.sg> Co-authored-by: OpenAI Codex <noreply@openai.com>
This commit is contained in:
co-authored by
OpenAI Codex
parent
b50fdebce0
commit
9f3169960a
@@ -14,7 +14,10 @@ from vllm.model_executor.layers.fused_moe.config import (
|
|||||||
from vllm.model_executor.layers.fused_moe.topk_weight_and_reduce import (
|
from vllm.model_executor.layers.fused_moe.topk_weight_and_reduce import (
|
||||||
TopKWeightAndReduceNoOP,
|
TopKWeightAndReduceNoOP,
|
||||||
)
|
)
|
||||||
from vllm.model_executor.layers.fused_moe.utils import trtllm_moe_pack_topk_ids_weights
|
from vllm.model_executor.layers.fused_moe.utils import (
|
||||||
|
fi_moe_largest_bucket,
|
||||||
|
trtllm_moe_pack_topk_ids_weights,
|
||||||
|
)
|
||||||
from vllm.model_executor.layers.quantization.utils.flashinfer_utils import (
|
from vllm.model_executor.layers.quantization.utils.flashinfer_utils import (
|
||||||
activation_to_flashinfer_int,
|
activation_to_flashinfer_int,
|
||||||
has_flashinfer_situ_activation,
|
has_flashinfer_situ_activation,
|
||||||
@@ -113,8 +116,6 @@ class TrtLlmMxfp4ExpertsBase:
|
|||||||
)
|
)
|
||||||
self.gemm1_clamp_limit = None
|
self.gemm1_clamp_limit = None
|
||||||
|
|
||||||
self.max_capture_size = moe_config.max_capture_size
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _supports_current_device() -> bool:
|
def _supports_current_device() -> bool:
|
||||||
p = current_platform
|
p = current_platform
|
||||||
@@ -263,7 +264,7 @@ class TrtLlmMxfp4ExpertsMonolithic(
|
|||||||
routing_method_type=self.routing_method_type,
|
routing_method_type=self.routing_method_type,
|
||||||
do_finalize=True,
|
do_finalize=True,
|
||||||
activation_type=self._flashinfer_activation_type(activation),
|
activation_type=self._flashinfer_activation_type(activation),
|
||||||
tune_max_num_tokens=max(self.max_capture_size, 1),
|
tune_max_num_tokens=fi_moe_largest_bucket(self.moe_config),
|
||||||
output=output,
|
output=output,
|
||||||
routing_replay_out=routing_replay_out,
|
routing_replay_out=routing_replay_out,
|
||||||
)
|
)
|
||||||
@@ -382,7 +383,7 @@ class TrtLlmMxfp4ExpertsModular(TrtLlmMxfp4ExpertsBase, mk.FusedMoEExpertsModula
|
|||||||
enable_pdl=True,
|
enable_pdl=True,
|
||||||
activation_type=self._flashinfer_activation_type(activation),
|
activation_type=self._flashinfer_activation_type(activation),
|
||||||
output=output,
|
output=output,
|
||||||
tune_max_num_tokens=max(self.max_capture_size, 1),
|
tune_max_num_tokens=fi_moe_largest_bucket(self.moe_config),
|
||||||
)
|
)
|
||||||
|
|
||||||
def apply(
|
def apply(
|
||||||
|
|||||||
Reference in New Issue
Block a user