vllm - ✅(Solved) Fix [vllm IR]: Remove `QuantFP8` in favour of direct `ir.ops` calls [1 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
vllm-project/vllm#40617Fetched 2026-04-23 07:23:53
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Participants
Timeline (top)
cross-referenced ×1labeled ×1subscribed ×1

QuantFP8 is a CustomOp whose forward_native already delegates, almost, entirely to IR ops (ir.ops.dynamic_group_quant_fp81, ir.ops.dynamic_quant_fp8, ir.ops.static_quant_fp8, ir.ops.static_group_quant_fp8). The IR ops handle platform dispatch internally, making the CustomOp` abstraction redundant.

Root Cause

QuantFP8 is a CustomOp whose forward_native already delegates, almost, entirely to IR ops (ir.ops.dynamic_group_quant_fp81, ir.ops.dynamic_quant_fp8, ir.ops.static_quant_fp8, ir.ops.static_group_quant_fp8). The IR ops handle platform dispatch internally, making the CustomOp` abstraction redundant.

Fix Action

Fix / Workaround

Description

QuantFP8 is a CustomOp whose forward_native already delegates, almost, entirely to IR ops (ir.ops.dynamic_group_quant_fp81, ir.ops.dynamic_quant_fp8, ir.ops.static_quant_fp8, ir.ops.static_group_quant_fp8). The IR ops handle platform dispatch internally, making the CustomOp` abstraction redundant.

PR fix notes

PR #39481: [vllm IR] Port FP8 Quantization to vLLM IR Ops

Description (problem / solution / changelog)

Purpose

Ports quant fp8 ops to IR following #38745 . The table below tracks all quant fp8 IR ops and their provider implementations. ✅ : Ported ❌: No existing implementation

Opnativeaitertritonvllm_cxpu
static_quant_fp8
dynamic_quant_fp8
dynamic_group_quant_fp8
static_group_quant_fp8

Notes:

  • per_token_group_quant_fp8_packed_for_deepgemm: Has different semantics from dynamic_group_quant_fp8 and requires a separate IR op.
  • per_token_group_quant_fp8 : not removed because deep_gemm_moe.py calls it with a pre-allocated out_q output buffer. IR ops must be purely functional and cannot write into caller-provided output tensors, so this usage cannot be expressed as an IR op without refactoring the call site.

Follow ups

  • Aiter dynamic quant pattern: Subclass RMSNormDynamicQuantPattern once it's refactored to use VllmFusionPatternMatcherPass to eliminate the duplicate.
  • Aiter group quant pattern: Same as above for RMSNormGroupQuantPattern.
  • deep_gemm_moe: Replace the per-token group quant call in fp8_utils.py with a direct IR op.

Test Plan

Test Result


<details> <summary> Essential Elements of an Effective PR Description Checklist </summary>
  • The purpose of the PR, such as "Fix some issue (link existing issues this PR will resolve)".
  • The test plan, such as providing test command.
  • The test results, such as pasting the results comparison before and after, or e2e results
  • (Optional) The necessary documentation update, such as updating supported_models.md and examples for a new model.
  • (Optional) Release notes update. If your change is user facing, please update the release notes draft in the Google Doc.
</details>

Changed files

  • tests/compile/passes/distributed/test_fusion_all_reduce.py (modified, +1/-3)
  • tests/compile/passes/test_fusion.py (modified, +10/-21)
  • tests/compile/passes/test_fusion_attn.py (modified, +3/-7)
  • tests/compile/passes/test_mla_attn_quant_fusion.py (modified, +2/-6)
  • tests/compile/passes/test_silu_mul_quant_fusion.py (modified, +14/-16)
  • tests/kernels/ir/test_quant.py (added, +588/-0)
  • tests/rocm/aiter/test_grouped_quant.py (modified, +15/-15)
  • vllm/_aiter_ops.py (modified, +0/-134)
  • vllm/compilation/passes/fusion/act_quant_fusion.py (modified, +14/-43)
  • vllm/compilation/passes/fusion/allreduce_rms_fusion.py (modified, +10/-15)
  • vllm/compilation/passes/fusion/attn_quant_fusion.py (modified, +3/-5)
  • vllm/compilation/passes/fusion/matcher_utils.py (modified, +11/-171)
  • vllm/compilation/passes/fusion/mla_attn_quant_fusion.py (modified, +33/-55)
  • vllm/compilation/passes/fusion/rms_quant_fusion.py (modified, +51/-90)
  • vllm/compilation/passes/fusion/rocm_aiter_fusion.py (modified, +51/-47)
  • vllm/compilation/passes/fusion/sequence_parallelism.py (modified, +8/-10)
  • vllm/config/kernel.py (modified, +12/-0)
  • vllm/ir/ops/__init__.py (modified, +13/-1)
  • vllm/ir/ops/quant.py (added, +180/-0)
  • vllm/kernels/__init__.py (modified, +2/-2)
  • vllm/kernels/aiter_ops.py (modified, +193/-0)
  • vllm/kernels/triton/__init__.py (added, +7/-0)
  • vllm/kernels/triton/quant.py (added, +210/-0)
  • vllm/kernels/vllm_c.py (modified, +128/-0)
  • vllm/kernels/xpu_ops.py (modified, +41/-0)
  • vllm/model_executor/layers/quantization/input_quant_fp8.py (modified, +31/-123)
  • vllm/model_executor/layers/quantization/utils/fp8_utils.py (modified, +2/-0)
  • vllm/platforms/cuda.py (modified, +5/-1)
  • vllm/platforms/rocm.py (modified, +20/-2)
  • vllm/platforms/xpu.py (modified, +4/-2)
RAW_BUFFERClick to expand / collapse

🚀 The feature, motivation and pitch

Description

QuantFP8 is a CustomOp whose forward_native already delegates, almost, entirely to IR ops (ir.ops.dynamic_group_quant_fp81, ir.ops.dynamic_quant_fp8, ir.ops.static_quant_fp8, ir.ops.static_group_quant_fp8). The IR ops handle platform dispatch internally, making the CustomOp` abstraction redundant.

Proposed change

Replace call sites that instantiate QuantFP8 with direct calls to the appropriate IR op, and remove the class.

Blocker

forward_cuda contains a special path for the DeepGemm packed scale format that calls per_token_group_quant_fp8_packed_for_deepgemm. This path has no equivalent in the IR ops and must be handled by retaining it as a separate call before QuantFP8 can be removed.

Alternatives

Retain QuantFP8 and accept the indirection. This leaves an unnecessary abstraction layer between call sites and the IR ops.

Additional context

No response

Before submitting a new issue...

  • Make sure you already searched for relevant issues, and asked the chatbot living at the bottom right corner of the documentation page, which can answer lots of frequently asked questions.

extent analysis

TL;DR

Replace QuantFP8 call sites with direct calls to the appropriate IR ops, while retaining a separate call for the DeepGemm packed scale format.

Guidance

  • Identify and replace all call sites that instantiate QuantFP8 with direct calls to the corresponding IR ops (ir.ops.dynamic_group_quant_fp81, ir.ops.dynamic_quant_fp8, ir.ops.static_quant_fp8, ir.ops.static_group_quant_fp8).
  • Retain the special path in forward_cuda for the DeepGemm packed scale format as a separate call, using per_token_group_quant_fp8_packed_for_deepgemm.
  • Remove the QuantFP8 class after all call sites have been updated.
  • Verify that the replacement IR ops handle platform dispatch correctly and that the retained special path works as expected.

Notes

The proposed change aims to remove an unnecessary abstraction layer, but it requires careful handling of the special path for the DeepGemm packed scale format.

Recommendation

Apply workaround: Retain the special path for the DeepGemm packed scale format and replace all other QuantFP8 call sites with direct IR op calls, as this approach allows for the removal of the redundant QuantFP8 class while maintaining functionality.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

vllm - ✅(Solved) Fix [vllm IR]: Remove `QuantFP8` in favour of direct `ir.ops` calls [1 pull requests, 1 participants]