From 89d724bdbb2f3e50629ec7d3266ae1aa45cba033 Mon Sep 17 00:00:00 2001 From: Chenjie Luo Date: Thu, 16 Apr 2026 06:01:22 +0000 Subject: [PATCH] Fix llm_ptq test bug Signed-off-by: Chenjie Luo --- modelopt/deploy/llm/generate.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modelopt/deploy/llm/generate.py b/modelopt/deploy/llm/generate.py index 0df8e94c449..0f649199ec2 100644 --- a/modelopt/deploy/llm/generate.py +++ b/modelopt/deploy/llm/generate.py @@ -109,12 +109,13 @@ def _find_max_position_embeddings(cfg: dict) -> int | None: if tp < 1: tp = torch.cuda.device_count() - # Check if any key in config contains both "num" and "experts" + # Force ep=1 to avoid TRT-LLM DeepEP kernel failures on unsupported GPUs + # (e.g. Blackwell SM 12.0). Expert parallelism can be enabled explicitly + # by the caller when the environment is known to support it. ep = 1 enable_attention_dp = False for k in config: if "num" in k and "experts" in k: - ep = torch.cuda.device_count() enable_attention_dp = True break