Repository navigation
[https://nvbugs/7028060][fix] Stop shimming FlashInfer's W4A16 tile validator once it takes enforce_search_floor - #22004
Conversation
…alidator once it takes enforce_search_floor FlashInfer 0.7.2 (flashinfer-ai/flashinfer#6292) re-validates the tiles its SM12x W4A16 fused MoE re-pins through force_tile_config with _candidate_tile_fits(..., enforce_search_floor=False). The shim that fused_moe_cute_dsl_b12x.py installs over that validator for FlashInfer 0.6.17 and later looks for the upstream fix as _ultra_wide_fc2_tile_fits, which 0.7.2 does not have, so it stays installed there. Its fixed keyword list then rejects enforce_search_floor and the re-pin fails with "TypeError: ... candidate_tile_fits() got an unexpected keyword argument 'enforce_search_floor'". Leave FlashInfer's validator in place when it takes enforce_search_floor. The shim keeps covering 0.6.17 to 0.7.1, whose validator does not. The existing shim tests now run against a validator that applies the search floor to every tile, as FlashInfer before 0.7.2 does. A new test compiles the W4A16 fused MoE with the ultra-wide FC2 tile forced, after the shim hook, up to the kernel build. Remove the waiver of accuracy/test_llm_api_pytorch.py::TestQwen3_6_35B_A3B::test_nvfp4_w4a16. Signed-off-by: trtllm-agent <296075020+trtllm-agent@users.noreply.github.com>
|
No actionable comments were generated in the recent review. WalkthroughThe FlashInfer tile-validation shim now checks the validator signature before installation. Tests cover pre-fix and updated validator behavior, including compilation with an ultra-wide FC2 tile. The waiver for the corresponding integration test was removed. ChangesFlashInfer Tile Validator Compatibility
Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Possibly related PRs
Merge Risk:
|
sunnyqgg
left a comment
There was a problem hiding this comment.
Checked against the FlashInfer 0.7.2 and 0.7.3 wheels: both validators take enforce_search_floor and the force_tile_config re-pin passes enforce_search_floor=False, so standing the shim aside lets FlashInfer accept the ultra-wide FC2 tile itself, and the new kernel-build test fails on the parent with the reported TypeError. The CPU stages that collect unittest/_torch/moe do run these shim tests with FlashInfer 0.7.2. Counts: 0 blockers, 0 possibly blocking, 2 required, 4 nice to have.
- [Required] PR description: the auto-generated CodeRabbit block ("Dev Engineer Review" / "QA Engineer Review" / "Per-File QA Perspective") contradicts the change. It says the changed unit test file "is not listed in
test-db/orqa/", buttests/integration/test_lists/test-db/l0_cpu.ymlcollects it throughunittest/_torch/moe(CPU-Generic-x86-1/arm-1 run these shim tests on main today). It also says no runtime or CI results are available, while your Test Coverage section reports the passing runs. The PR template asks that a CodeRabbit summary make sense; please delete the block or correct it. - [Nice to have] The un-waived
accuracy/test_llm_api_pytorch.py::TestQwen3_6_35B_A3B::test_nvfp4_w4a16runs only inRTXPro6000D-PyTorch-Post-Merge-1(thepost_mergeblock ofl0_rtx_pro_6000.yml), so pre-merge CI never runs this fix on GPU. Please run/bot run --extra-stage "RTXPro6000D-PyTorch-Post-Merge-1"before merge and link the passing run. The DGX Spark (SM121) QA cases reported in the bug (Nemotron-3.5-Lightning NVFP4, the Qwen3.6 perf case) go through the same hook; mentioning them in the description lets QA close them with this fix.
|
Automatically added "ci: full pre-merge approved" because this PR has satisfied the required GitHub review approvals. Unresolved review conversations and other required checks remain independent merge requirements. |
…he validator signature it mirrors The shim now installs only when FlashInfer's _candidate_tile_fits has exactly the parameters of 0.6.17 to 0.7.1, the validator it mirrors, as the MLA tuning-config workaround in flashinfer_trtllm_gen.py does for its builder. Any other signature, such as 0.7.2's with enforce_search_floor, leaves FlashInfer's validator in place, so a later signature change cannot re-arm the shim's fixed keyword list. Tests: the pre-0.7.2 stand-in validator takes that exact parameter list; a new test checks that the hook leaves the installed validator in place when it takes enforce_search_floor; the new functions are annotated, and the kernel-build test takes its sizes from the file's named constants. Signed-off-by: trtllm-agent <296075020+trtllm-agent@users.noreply.github.com>
|
Thanks for the review. Pushed d1add85 with the inline points, each answered in its thread, and updated the description:
Repair Bot cannot start CI on this repository, so it cannot run |
|
/bot run |
|
PR_Github #83833 [ run ] triggered by Bot. Commit: |
Description
FlashInfer 0.7.2 fixed the SM12x W4A16 fused MoE
force_tile_configre-pin(flashinfer-ai/flashinfer#6292): the re-pin re-validates the tiles the selector
chose with
_candidate_tile_fits(..., enforce_search_floor=False), so theTC-decode ultra-wide FC2 tile (
tile_n=512,tile_k=32) passes.fused_moe_cute_dsl_b12x.pycarries a shim for the same problem, which everyW4A16 NVFP4 B12x MoE leaf installs over that validator at construction for
FlashInfer 0.6.17 and later. It recognized an upstream fix only by a
_ultra_wide_fc2_tile_fitsattribute, which FlashInfer 0.7.2 does not have, sowith the flashinfer-python pin at 0.7.2 (#20911) the shim stays installed and its
fixed keyword list rejects the new argument. Every W4A16 fused MoE launch through
run_w4a16_moegoes through that re-pin, so the first one, during executorwarmup, fails:
This change installs the shim only over the validator signature of FlashInfer
0.6.17 to 0.7.1, the one it mirrors, and leaves any other validator in place, such
as 0.7.2's, which adds
enforce_search_floor. The hook runs for every W4A16 NVFP4B12x MoE leaf, on SM120 and SM121 alike. The waiver of
accuracy/test_llm_api_pytorch.py::TestQwen3_6_35B_A3B::test_nvfp4_w4a16is removed.Test Coverage
tests/unittest/_torch/moe/test_cute_dsl_b12x_moe_backend.py::test_w4a16_forced_ultra_wide_fc2_tile_reaches_kernel_build(new,
cpu_only, collected byunittest/_torch/moeinl0_cpu.yml): after theshim hook runs, compiles the W4A16 fused MoE with the ultra-wide FC2 tile forced
through
force_tile_config, with the kernel build stubbed, and checks the forcedtile reaches the kernel build.
test_w4a16_ultra_wide_fc2_shim_stands_aside_on_enforce_search_floor(new,cpu_only): with the installed validator takingenforce_search_floor, the hookreturns
Falseand leaves that validator in place.test_w4a16_ultra_wide_fc2_shim_*tests now start from a validatorwith the 0.6.17 to 0.7.1 signature that applies the search floor to every tile, as
those releases do, so they keep covering the shim with FlashInfer 0.7.2 installed.
accuracy/test_llm_api_pytorch.py::TestQwen3_6_35B_A3B::test_nvfp4_w4a16(
l0_rtx_pro_6000.yml, post-merge), no longer waived.Verified with flashinfer-python 0.7.2, with main at 0bcbcfe built in the CI
image with the CI build flags (CUDA arch 120 only):
TestQwen3_6_35B_A3B::test_nvfp4_w4a16fails without thischange with the
TypeErrorabove and passes with it (GSM8K 95.830, threshold91.797), run in one pytest process after
TestQwen3_30B_A3B::test_nvfp4[latency_moe_cutlass-torch_compile=False]and[...-torch_compile=True], which pass as well.this change, the kernel-build test with the same
TypeError, and pass with it; thethree existing shim tests pass with and without it.
unittest/_torch/moewith-m cpu_onlypasses with this change (751 passed, 1 skipped by its waiver).Fixes https://nvbugs/7028060