[#10245][feat] AutoDeploy: Support Finegrained FP8 quantization - #10897
Conversation
20c2781 to
49e52c3
Compare
|
/bot run |
|
PR_Github #33625 [ run ] triggered by Bot. Commit: |
|
PR_Github #33625 [ run ] completed with state
|
c6999f1 to
e4e971c
Compare
|
@CodeRabbit summary |
✅ Actions performedSummary regeneration triggered. |
📝 WalkthroughWalkthroughThis pull request introduces fine-grained FP8 quantization support for linear and MoE layers, including new custom operations, quantization and fusion transforms, configuration entries, and comprehensive test coverage spanning both PyTorch and TRT-LLM execution paths. Changes
Sequence DiagramsequenceDiagram
participant Config as YAML Config
participant Quantizer as Quantization Transform
participant GraphOp as Graph Operations
participant Kernel as FP8 Kernel<br/>(torch/trtllm)
participant Fuser as Fusion Transform
participant Sharder as Sharding Transform
Config->>Quantizer: Load finegrained_fp8_linear transform
Quantizer->>GraphOp: Replace linear ops with fake_quant_finegrained_fp8_linear<br/>per-block scales
GraphOp->>Kernel: Execute with FP8 weights + scales
Kernel-->>GraphOp: FP8 quantized output
Fuser->>GraphOp: Detect fake_quant patterns
Fuser->>Kernel: Fuse into trtllm_finegrained_fp8_linear<br/>or torch variant
GraphOp->>Sharder: Optimized graph (post-fusion)
Sharder->>Sharder: Shard weights and per-block scales<br/>for TP/EP
Sharder-->>GraphOp: Sharded quantized graph
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Tip Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord. 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 |
|
/bot run |
|
PR_Github #34613 [ run ] triggered by Bot. Commit: |
|
PR_Github #34613 [ run ] completed with state
|
e4e971c to
46fabf8
Compare
|
/bot run --extra-stage "DGX_B200-4_GPUs-AutoDeploy-1, DGX_H100-4_GPUs-AutoDeploy-1" |
|
PR_Github #36097 [ run ] triggered by Bot. Commit: |
|
/bot run --extra-stage "DGX_B200-4_GPUs-AutoDeploy-1, DGX_H100-4_GPUs-AutoDeploy-1" |
|
PR_Github #36110 [ run ] triggered by Bot. Commit: |
|
PR_Github #36110 [ run ] completed with state
|
d4a16b1 to
7be5017
Compare
|
/bot run --extra-stage "DGX_B200-4_GPUs-AutoDeploy-1, DGX_H100-4_GPUs-AutoDeploy-1" |
|
PR_Github #36174 [ run ] triggered by Bot. Commit: |
greg-kwasniewski1
left a comment
There was a problem hiding this comment.
An open question: should we multiply the function and class variants? It's fine, I guess, to have a separate class, pattern matcher, then torch_X_op, + (fake variants), then trtllm_X_op + (alltoall variants).
But since it appears to me that the finegrained_fp8 quantization is:
- only supported for compute capabilities > SM100
- it falls back to "default" FP8 quantization for hopper
- it diverges from "default" FP8 only in the last stage by calling different quantization of hidden states and
torch.ops.trtllm.fp8_block_scale_moe_runnerinstead oftorch.ops.trtllm.fused_moe
Would that make sense if the default/finegrained FP8 quantization be just a flag /runtime check inside trtllm_quant_fp8_moe_fused ?
I kinda agree that combination of functions for handling class/op/pattern-matcher is increasing. I've cleaned up the MoE alltoall code paths to be simpler now. But overloading the op seems to make it more complex inside the op. Sure, the Hopper path ends up calling the same backend op, but, still it calls it with entirely different arguments. Fundamentally, the following things change between the default fp8 and this finegrained FP8:
|
+ review comments Signed-off-by: Balamurugan Marimuthu <246387390+bmarimuthu-nv@users.noreply.github.com>
d389049 to
8b4df4e
Compare
|
/bot run --extra-stage "DGX_B200-4_GPUs-AutoDeploy-1, DGX_H100-4_GPUs-AutoDeploy-1" --disable-fail-fast |
|
PR_Github #37774 [ run ] triggered by Bot. Commit: |
|
PR_Github #37774 [ run ] completed with state
|
Signed-off-by: Balamurugan Marimuthu <246387390+bmarimuthu-nv@users.noreply.github.com>
|
/bot run --extra-stage "DGX_B200-4_GPUs-AutoDeploy-1, DGX_H100-4_GPUs-AutoDeploy-1" --disable-fail-fast --reuse-test |
|
PR_Github #37822 [ run ] triggered by Bot. Commit: |
|
PR_Github #37822 [ run ] completed with state
|
|
/bot run --extra-stage "DGX_B200-4_GPUs-AutoDeploy-1, DGX_H100-4_GPUs-AutoDeploy-1" --disable-fail-fast --reuse-test |
|
PR_Github #37895 [ run ] triggered by Bot. Commit: |
|
PR_Github #37895 [ run ] completed with state |
Greg mentioned offline that the all suggestions are not blocking. I have also made changes & simplified the code paths as per his review.
|
/bot run --extra-stage "DGX_B200-4_GPUs-AutoDeploy-1, DGX_H100-4_GPUs-AutoDeploy-1" --disable-fail-fast |
|
PR_Github #37926 [ run ] triggered by Bot. Commit: |
|
PR_Github #37926 [ run ] completed with state |
…NVIDIA#10897) Signed-off-by: Fridah-nv <201670829+Fridah-nv@users.noreply.github.com> Signed-off-by: Balamurugan Marimuthu <246387390+bmarimuthu-nv@users.noreply.github.com> Co-authored-by: Fridah-nv <201670829+Fridah-nv@users.noreply.github.com>
…NVIDIA#10897) Signed-off-by: Fridah-nv <201670829+Fridah-nv@users.noreply.github.com> Signed-off-by: Balamurugan Marimuthu <246387390+bmarimuthu-nv@users.noreply.github.com> Co-authored-by: Fridah-nv <201670829+Fridah-nv@users.noreply.github.com>
…NVIDIA#10897) Signed-off-by: Fridah-nv <201670829+Fridah-nv@users.noreply.github.com> Signed-off-by: Balamurugan Marimuthu <246387390+bmarimuthu-nv@users.noreply.github.com> Co-authored-by: Fridah-nv <201670829+Fridah-nv@users.noreply.github.com>
Summary by CodeRabbit
Release Notes
New Features
Tests
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.