From fcbed7638fd9e5e7b5d0e04b1ca760f1ad69f738 Mon Sep 17 00:00:00 2001 From: Brian Nguyen Date: Wed, 5 Aug 2026 23:42:28 -0700 Subject: [PATCH 1/2] [None][fix] Pass num_fused_shared_experts in FP8 MoE fallback-tactic path PR #15297 added a numFusedSharedExpert argument to FP8BlockScaleMoERunner::getValidConfigs and updated the autotuner get_valid_tactics call site, but not the memoized fallback-tactic path used on autotuner cache misses. Any FP8 block-scale MoE forward that misses the profiling cache fails with: RuntimeError: get_valid_configs() is missing value for argument '_6'. Pass num_fused_shared_experts and include it in the memo key, matching get_valid_tactics. Signed-off-by: Brian Nguyen --- tensorrt_llm/_torch/custom_ops/trtllm_gen_custom_ops.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tensorrt_llm/_torch/custom_ops/trtllm_gen_custom_ops.py b/tensorrt_llm/_torch/custom_ops/trtllm_gen_custom_ops.py index 776e167ab950..42272300c12b 100644 --- a/tensorrt_llm/_torch/custom_ops/trtllm_gen_custom_ops.py +++ b/tensorrt_llm/_torch/custom_ops/trtllm_gen_custom_ops.py @@ -922,8 +922,8 @@ def get_fallback_tactic(self, hidden_size: int, the profiling cache. The result depends only on the key below, so memoize it the same way ``runner_dict`` memoizes the runner. """ - key = (self.top_k, hidden_size, self.intermediate_size, - self.local_num_experts, num_tokens) + key = (self.top_k, self.num_fused_shared_experts, hidden_size, + self.intermediate_size, self.local_num_experts, num_tokens) tactic = FP8BlockScaleMoERunner.fallback_tactic_dict.get(key) if tactic is None: tactic = tuple( From 10c3fd70cde35020003cc88143df707aab0ef969 Mon Sep 17 00:00:00 2001 From: Brian Nguyen Date: Thu, 6 Aug 2026 18:59:21 -0500 Subject: [PATCH 2/2] Address trivial review comments Signed-off-by: Brian Nguyen --- tensorrt_llm/_torch/custom_ops/trtllm_gen_custom_ops.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tensorrt_llm/_torch/custom_ops/trtllm_gen_custom_ops.py b/tensorrt_llm/_torch/custom_ops/trtllm_gen_custom_ops.py index 42272300c12b..d593cc5333ca 100644 --- a/tensorrt_llm/_torch/custom_ops/trtllm_gen_custom_ops.py +++ b/tensorrt_llm/_torch/custom_ops/trtllm_gen_custom_ops.py @@ -903,8 +903,8 @@ def __init__( # that influence tactic validity here. e.g. we are tuning FC1 and FC2 so the routing # type does not matter def unique_id(self): - return (self.top_k, self.intermediate_size, self.local_num_experts, - self.act_type) + return (self.top_k, self.num_fused_shared_experts, + self.intermediate_size, self.local_num_experts, self.act_type) def get_runner(self): instance_key = ()