Skip to content

Commit 6a18a12

Browse files
yizhuoz004claude
andcommitted
tests: add MoE subgraph tests with require_full_compilation enforcement
Add tests/py/dynamo/hlo/test_moe.py covering all 7 MoE routing and dispatch variants from popular open-source LLMs (Mixtral, Qwen2, Qwen3, Llama4, DeepSeek-V2, DeepSeek-V3/R1, Nemotron-H). 50 parameterized test cases verify TRT numerical correctness against PyTorch reference. Extend DispatchTestCase.run_test() with require_full_compilation=True support: calls TRTInterpreter.validate_conversion() before building the engine and fails immediately if any op lacks a TRT converter. All MoE tests pass this check, confirming zero PyTorch fallback for every routing/dispatch/expert-MLP combination tested. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 2e26bfa commit 6a18a12

3 files changed

Lines changed: 1048 additions & 0 deletions

File tree

tests/py/dynamo/conversion/harness.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,7 @@ def run_test(
422422
immutable_weights=True,
423423
use_explicit_typing=False,
424424
decompose_attention=False,
425+
require_full_compilation=False,
425426
):
426427
# TODO: lan to remove this and set use_dynamo_traccer to True by default
427428
# once all the converter test files are moved to use_dynamo_tracer
@@ -434,6 +435,7 @@ def run_test(
434435
immutable_weights=immutable_weights,
435436
use_explicit_typing=use_explicit_typing,
436437
decompose_attention=decompose_attention,
438+
require_full_compilation=require_full_compilation,
437439
)
438440

439441
mod = self.generate_graph(
@@ -499,6 +501,13 @@ def run_test(
499501
compilation_settings=compilation_settings,
500502
)
501503

504+
if require_full_compilation:
505+
missing = interp.validate_conversion()
506+
self.assertFalse(
507+
missing,
508+
f"require_full_compilation=True but the following ops have no TRT converter: {missing}",
509+
)
510+
502511
super().run_test(
503512
mod,
504513
trt_inputs,

tests/py/dynamo/hlo/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)