Repository navigation
[TRTLLM-9578][feat] make PDL enabled by default - #9695
Conversation
|
/bot run |
📝 WalkthroughWalkthroughModified Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~5–10 minutes
Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
PR_Github #26903 [ run ] triggered by Bot. Commit: |
|
PR_Github #26903 [ run ] completed with state |
|
/bot run --disable-fail-fast |
|
PR_Github #27053 [ run ] triggered by Bot. Commit: |
|
PR_Github #27053 [ run ] completed with state |
|
/bot run --disable-fail-fast --add-multi-gpu-test |
|
PR_Github #27081 [ run ] triggered by Bot. Commit: |
|
PR_Github #27081 [ run ] completed with state |
|
/bot run --disable-fail-fast --add-multi-gpu-test |
|
PR_Github #27241 [ run ] triggered by Bot. Commit: |
|
PR_Github #27241 [ run ] completed with state |
|
/bot run --disable-fail-fast --add-multi-gpu-test |
|
PR_Github #27308 [ run ] triggered by Bot. Commit: |
|
PR_Github #27308 [ run ] completed with state |
04f1e80 to
42c1856
Compare
|
/bot run --disable-fail-fast --add-multi-gpu-test |
|
PR_Github #27510 [ run ] triggered by Bot. Commit: |
|
PR_Github #27510 [ run ] completed with state |
|
/bot run --disable-fail-fast --add-multi-gpu-test |
|
PR_Github #27600 [ run ] triggered by Bot. Commit: |
58d83bb to
37eac34
Compare
|
/bot run --disable-fail-fast --add-multi-gpu-test |
|
PR_Github #27600 [ run ] completed with state |
|
PR_Github #27657 [ run ] triggered by Bot. Commit: |
37eac34 to
f239d09
Compare
|
/bot run --disable-fail-fast --add-multi-gpu-test |
|
PR_Github #29592 [ run ] completed with state
|
|
/bot run --disable-fail-fast --add-multi-gpu-test |
797a917 to
e0bd47c
Compare
|
/bot run --disable-fail-fast --add-multi-gpu-test |
|
PR_Github #29732 [ run ] triggered by Bot. Commit: |
|
/bot run --disable-fail-fast --add-multi-gpu-test |
|
PR_Github #29768 [ run ] triggered by Bot. Commit: |
Signed-off-by: Zhenhuan Chen <[email protected]>
Signed-off-by: Zhenhuan Chen <[email protected]>
Signed-off-by: Zhenhuan Chen <[email protected]>
Signed-off-by: Zhenhuan Chen <[email protected]>
Signed-off-by: Zhenhuan Chen <[email protected]>
e0bd47c to
bf070ac
Compare
|
/bot run --disable-fail-fast --add-multi-gpu-test |
|
PR_Github #29776 [ run ] triggered by Bot. Commit: |
|
PR_Github #29776 [ run ] completed with state
|
|
/bot run --disable-fail-fast --add-multi-gpu-test |
|
PR_Github #29834 [ run ] triggered by Bot. Commit: |
|
PR_Github #29834 [ run ] completed with state
|
|
/bot run --disable-fail-fast --add-multi-gpu-test |
|
PR_Github #29892 [ run ] triggered by Bot. Commit: |
|
PR_Github #29892 [ run ] completed with state
|
|
/bot run --disable-fail-fast --add-multi-gpu-test |
|
PR_Github #29934 [ run ] triggered by Bot. Commit: |
|
PR_Github #29934 [ run ] completed with state |
Signed-off-by: Zhenhuan Chen <[email protected]> Signed-off-by: Daniil Kulko <[email protected]>
<!-- .github/pull_request_template.md --> ## 📌 Description Four fixes to the TRT-LLM CUTLASS MoE / GEMM sources under `csrc/nv_internal`, from upstream TensorRT-LLM commits FlashInfer's copies predate, plus one FlashInfer-side fix in the same quantization kernel. - ~~PDL wait without a memory clobber (NVIDIA/TensorRT-LLM#9695, header part)~~ dropped at review (`2419e49d6`): the header it changed, `cutlass_extensions/arch/grid_dependency_control.h`, is included by nothing in this tree. The MoE kernels (and TRT-LLM's own pingpong GEMM) take `cutlass/arch/grid_dependency_control.h` from the CUTLASS submodule, which is bare at pin `b46b16d0` and already carries the clobber on CUTLASS main; the fix arrives with the submodule bump, not here. - **NaN from `448 / amax`** ([NVIDIA/TensorRT-LLM#11256](NVIDIA/TensorRT-LLM#11256)). The 1x128 and 128x128 block-scale quantization kernels in `fp8_blockscale_gemm_kernel.cuh` guarded only `amax == 0`; a tiny nonzero amax gave an inf scale and NaN output. `amax` is clamped to `1e-10` first. - **`util_convert_type` returned a dangling fragment** ([NVIDIA/TensorRT-LLM#20017](NVIDIA/TensorRT-LLM#20017)). `moe_cute_util.cuh` built the result tensor over a stack `cutlass::Array` that goes out of scope on return; it now copies into a tensor that owns its storage, with a static assert that the input is contiguous. - **SM120 / SM121 launch check** ([NVIDIA/TensorRT-LLM#12704](NVIDIA/TensorRT-LLM#12704), launcher part). Consumer Blackwell has 99 KiB of shared memory per block; both TMA warp-specialized launchers now check the kernel's `SharedStorage` against `cudaDevAttrMaxSharedMemoryPerBlockOptin` before launching, so an oversized tile fails with a message instead of a launch error. Upstream's heuristic-level filter (keep only `CtaShape128x128x64B`) is not taken: FlashInfer's SM120 list already drops the `...x64B` tiles for FP8 activations, so the filter left W4A8 with no tactic on RTX PRO 6000 / Spark (first push of this PR), and the `128x128x128B` tile it relies on fits there. - **`scale_128x128_kernel` reduced its amax over the wrong rows** (FlashInfer-side, found in review). The reduction loop bounded the column check with the row index `i` instead of the inner index `j` (the write loop already used `j`): `scales_idx_x * 128 + i * 32 + lane_id >= dim_x` breaks out of the reduction at row `i >= (dim_x - scales_idx_x * 128) / 32`, so for any `dim_x` below about 4200 every 128x128 block's amax came from its first rows only and the remaining rows saturate at 448. Upstream still has `i`; FlashInfer's 2025-10 import carried it over and this fix is FlashInfer-first. Only the internal BF16-weight quantization path (`weight_scale=None`) is affected, and that kernel now reads all 128 rows of a block for the amax where it read the first few; its write loop already read the whole block, so the kernel is at most about 2x its old (wrong) cost on that path only. The amax floor is applied in fp32 so a half instantiation would not flush `1e-10` to 0. No kernel arithmetic changes except the amax clamp and the reduction bound above. ## 🔍 Related Issues [NVIDIA/TensorRT-LLM#9695](NVIDIA/TensorRT-LLM#9695), [NVIDIA/TensorRT-LLM#11256](NVIDIA/TensorRT-LLM#11256), [NVIDIA/TensorRT-LLM#20017](NVIDIA/TensorRT-LLM#20017), [NVIDIA/TensorRT-LLM#12704](NVIDIA/TensorRT-LLM#12704) (launcher part). [NVIDIA/TensorRT-LLM#11561](NVIDIA/TensorRT-LLM#11561) is not needed: FlashInfer gates the SM120 TMA warp-specialized path on `isValidSM120MOESpecialisation`, so pure-int weight-only configs never reach the SM120 list. ## 🚀 Pull Request Checklist Thank you for contributing to FlashInfer! Before we review your pull request, please make sure the following items are complete. ### ✅ Pre-commit Checks - [x] I have installed `pre-commit` by running `pip install pre-commit` (or used your preferred method). - [x] I have installed the hooks with `pre-commit install`. - [x] I have run the hooks manually with `pre-commit run --all-files` and fixed any reported issues. > If you are unsure about how to set up `pre-commit`, see [the pre-commit documentation](https://pre-commit.com/). ## 🧪 Tests - [x] Tests have been added or updated as needed. - [x] All tests are passing (`unittest`, etc.). New: `test_fp8_blockscale_gemm_weight_amax_covers_whole_block` (SM90a): weight blocks whose rows 0-3 are tiny and whose other rows sit near the FP8 maximum, against the BF16 reference; a reduction that stops after the first rows saturates the block. It runs in the GitLab H100 job (the file is SM90-only and skips on B200). For the upstream fixes no new tests: the SM120 / SM121 launch check needs consumer Blackwell hardware, the dangling fragment is undefined behavior that happens to work today, and the NaN needs an amax below `1e-10`. Run on B200 (CUDA 13.0 CI container): `tests/gemm/test_fp8_blockscale_gemm.py` and `tests/moe/test_trtllm_cutlass_fused_moe.py -k "test_moe[ or test_moe_fp8_block_scaling or test_moe_w4a8[ or test_moe_fp8[ or test_moe_nvfp4["`: 56 passed, 86 skipped (SM90-only and Hopper-only variants), at FlashInfer `e3ebb9e7dd` + this commit. ## 🔬 Experimental Track <!-- Only for PRs submitted under the experimental policy (CONTRIBUTING.md → "Experimental APIs and Backends"). Leave this section untouched for normal PRs. --> - [ ] This PR is **experimental**: it adds or changes code under `flashinfer/experimental/` and/or an `@flashinfer_experimental_api`. Tracking issue: # - [ ] The tracking issue names an owner, the reason for the experimental path, and a graduation plan with a target release. - [ ] Core changes are limited to a thin entry point (signature, shared validation, feature-gate check, backend selection, handoff). - [ ] Tests live in `tests/experimental/` and were validated on the intended hardware; a runnable example is included. - [ ] Nothing is registered in `flashinfer/aot.py`, and no experimental backend is reachable from `backend="auto"` without `FLASHINFER_ALLOW_EXPERIMENTAL_AUTO_BACKENDS=1`. (Calling an `@flashinfer_experimental_api` or naming a backend explicitly is itself the opt-in and needs no environment variable.) - [ ] **Test scope declared below.** The experimental CI lane runs exactly these targets, so keep them as narrow as the change allows. <!-- Required for experimental PRs. Replace the commented lines below with your targets. Do not delete the fence or change its `experimental-tests` tag — the experimental-track watcher reads it verbatim to decide which targets to ask CI for. --> ```experimental-tests # One target per line: a directory or a file. (A pytest ::selector is not # supported -- the sharding runner cannot consume one.) Must be under # tests/experimental/ and must exist. Delete these comment lines and add yours, e.g. # # tests/experimental/test_my_backend.py # tests/experimental/my_backend/ # # Declaring the whole tree (tests/experimental/) is allowed but means every # experimental PR pays for every other feature's tests, in every matrix cell. ``` ## Reviewer Notes Reviewers with SM120 / SM121 hardware: `tests/moe/test_trtllm_cutlass_fused_moe.py` covers the launch check; the GitLab lane runs it on RTX PRO 6000 and Spark.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.
Description
Test Coverage
PR Checklist
Please review the following before submitting your PR:
PR description clearly explains what and why. If using CodeRabbit's summary, please make sure it makes sense.
PR Follows TRT-LLM CODING GUIDELINES to the best of your knowledge.
Test cases are provided for new code paths (see test instructions)
Any new dependencies have been scanned for license and vulnerabilities
CODEOWNERS updated if ownership changes
Documentation updated as needed
Update tava architecture diagram if there is a significant design change in PR.
The reviewers assigned automatically/manually are appropriate for the PR.
Please check this after reviewing the above items as appropriate for this PR.
GitHub Bot Help
/bot [-h] ['run', 'kill', 'skip', 'reuse-pipeline'] ...Provide a user friendly way for developers to interact with a Jenkins server.
Run
/bot [-h|--help]to print this help message.See details below for each supported subcommand.
Details
run [--reuse-test (optional)pipeline-id --disable-fail-fast --skip-test --stage-list "A10-PyTorch-1, xxx" --gpu-type "A30, H100_PCIe" --test-backend "pytorch, cpp" --add-multi-gpu-test --only-multi-gpu-test --disable-multi-gpu-test --post-merge --extra-stage "H100_PCIe-TensorRT-Post-Merge-1, xxx" --detailed-log --debug(experimental)]Launch build/test pipelines. All previously running jobs will be killed.
--reuse-test (optional)pipeline-id(OPTIONAL) : Allow the new pipeline to reuse build artifacts and skip successful test stages from a specified pipeline or the last pipeline if no pipeline-id is indicated. If the Git commit ID has changed, this option will be always ignored. The DEFAULT behavior of the bot is to reuse build artifacts and successful test results from the last pipeline.--disable-reuse-test(OPTIONAL) : Explicitly prevent the pipeline from reusing build artifacts and skipping successful test stages from a previous pipeline. Ensure that all builds and tests are run regardless of previous successes.--disable-fail-fast(OPTIONAL) : Disable fail fast on build/tests/infra failures.--skip-test(OPTIONAL) : Skip all test stages, but still run build stages, package stages and sanity check stages. Note: Does NOT update GitHub check status.--stage-list "A10-PyTorch-1, xxx"(OPTIONAL) : Only run the specified test stages. Examples: "A10-PyTorch-1, xxx". Note: Does NOT update GitHub check status.--gpu-type "A30, H100_PCIe"(OPTIONAL) : Only run the test stages on the specified GPU types. Examples: "A30, H100_PCIe". Note: Does NOT update GitHub check status.--test-backend "pytorch, cpp"(OPTIONAL) : Skip test stages which don't match the specified backends. Only support [pytorch, cpp, tensorrt, triton]. Examples: "pytorch, cpp" (does not run test stages with tensorrt or triton backend). Note: Does NOT update GitHub pipeline status.--only-multi-gpu-test(OPTIONAL) : Only run the multi-GPU tests. Note: Does NOT update GitHub check status.--disable-multi-gpu-test(OPTIONAL) : Disable the multi-GPU tests. Note: Does NOT update GitHub check status.--add-multi-gpu-test(OPTIONAL) : Force run the multi-GPU tests in addition to running L0 pre-merge pipeline.--post-merge(OPTIONAL) : Run the L0 post-merge pipeline instead of the ordinary L0 pre-merge pipeline.--extra-stage "H100_PCIe-TensorRT-Post-Merge-1, xxx"(OPTIONAL) : Run the ordinary L0 pre-merge pipeline and specified test stages. Examples: --extra-stage "H100_PCIe-TensorRT-Post-Merge-1, xxx".--detailed-log(OPTIONAL) : Enable flushing out all logs to the Jenkins console. This will significantly increase the log volume and may slow down the job.--debug(OPTIONAL) : Experimental feature. Enable access to the CI container for debugging purpose. Note: Specify exactly one stage in thestage-listparameter to access the appropriate container environment. Note: Does NOT update GitHub check status.For guidance on mapping tests to stage names, see
docs/source/reference/ci-overview.mdand the
scripts/test_to_stage_mapping.pyhelper.kill
killKill all running builds associated with pull request.
skip
skip --comment COMMENTSkip testing for latest commit on pull request.
--comment "Reason for skipping build/test"is required. IMPORTANT NOTE: This is dangerous since lack of user care and validation can cause top of tree to break.reuse-pipeline
reuse-pipelineReuse a previous pipeline to validate current commit. This action will also kill all currently running builds associated with the pull request. IMPORTANT NOTE: This is dangerous since lack of user care and validation can cause top of tree to break.