Skip to content

[ROCm] Expose kFp8DynamicTokenSym on AITER PTPC linears - #54248

Merged
AndreasKaratzas merged 9 commits into
vllm-project:mainfrom
rebklee:rebklee/aiter-ptpc-input-quant-key
Sep 16, 2026
Merged

AndreasKaratzas merged 9 commits into
vllm-project:mainfrom
rebklee:rebklee/aiter-ptpc-input-quant-key

Conversation

@rebklee

@rebklee rebklee commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Purpose

FP8ScaledMMLinearKernel.apply_weights already no-ops in-kernel quant on a matching QuantizedActivation. The AITER PTPC kernels never exposed input_quant_key(), so expose_input_quant_key left the layer unmarked and producers could not skip dynamic_per_token_scaled_quant.

Return kFp8DynamicTokenSym from input_quant_key() on the AITER PTPC kernels (AiterPreshuffledPerTokenFp8ScaledMMLinearKernel, AiterPerTokenFp8ScaledMMLinearKernel, AiterHipbMMPerTokenFp8ScaledMMLinearKernel).

Fp8PtpcOnlineLinearMethod and QuarkW8A8Fp8 call expose_input_quant_key after kernel init.

Not a duplicate. #44260 landed the QuantizedActivation contract and CUDA static-FP8 consumers; AITER PTPC kernels still return None, so expose_input_quant_key never marks the layer. #44132 added Fp8PtpcOnlineLinearMethod without that call. #33773 landed the GEMMs, not the fusion key.

Test Plan

Extended tests/fusion/test_quant_activation_contract.py with the three AITER PTPC kernels.

Added test_quark_fp8_ptpc_exposes_kernel_input_quant_key: QuarkW8A8Fp8.create_weights copies the kernel's input_quant_key onto the layer.

  • pytest tests/fusion/test_quant_activation_contract.py --noconftest
  • pytest tests/quantization/test_quark.py::test_quark_fp8_ptpc_exposes_kernel_input_quant_key

Test Result

Image: vllm/vllm-openai-rocm:nightly-1dc464d42681d22f38caf1fdc1eb632dc4421c45

  • tests/fusion/test_quant_activation_contract.py — 4 passed
  • tests/quantization/test_quark.py::test_quark_fp8_ptpc_exposes_kernel_input_quant_key — 1 passed (VLLM_ROCM_USE_AITER=1)

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

Comment thread tests/fusion/test_quant_activation_contract.py
Comment thread vllm/model_executor/layers/quantization/online/fp8.py Outdated
Comment thread vllm/model_executor/layers/quantization/online/fp8.py
Comment thread vllm/model_executor/layers/quantization/online/fp8.py Outdated
Comment thread vllm/model_executor/layers/quantization/online/fp8.py
Comment thread vllm/model_executor/kernels/linear/scaled_mm/aiter.py Outdated
Comment thread vllm/model_executor/kernels/linear/scaled_mm/aiter.py Outdated
Comment thread tests/fusion/test_quant_activation_contract.py
@rebklee
rebklee force-pushed the rebklee/aiter-ptpc-input-quant-key branch 3 times, most recently from 151da3d to 8598ebf Compare September 1, 2026 01:59
@mergify

mergify Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

This pull request has merge conflicts that must be resolved before it can be
merged. Please rebase the PR, @rebklee.

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify

mergify Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

This pull request has merge conflicts that must be resolved before it can be
merged. Please rebase the PR, @rebklee.

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify Bot added the needs-rebase label Sep 3, 2026
FP8ScaledMMLinearKernel.apply_weights already consumes a matching QuantizedActivation, but the AITER PTPC kernels never exposed input_quant_key(), so expose_input_quant_key left the layer unmarked.

Return the key from the AITER PTPC kernels and expose it on Fp8PtpcOnlineLinearMethod.

Do not override input_quant_key on FP8ScaledMMLinearKernel: torch fallbacks call get_output_padding() via get_current_vllm_config(), which is unset in profile_run.

Signed-off-by: Rebecca Lee <rebecca.lee@amd.com>
Move fusion.quant_activation below fused_moe (ruff I001).

Signed-off-by: Rebecca Lee <rebecca.lee@amd.com>
Signed-off-by: Rebecca Lee <rebecca.lee@amd.com>
Signed-off-by: Rebecca Lee <rebecca.lee@amd.com>
Signed-off-by: Rebecca Lee <rebecca.lee@amd.com>
@rebklee
rebklee force-pushed the rebklee/aiter-ptpc-input-quant-key branch from df9435a to 281f214 Compare September 9, 2026 04:37
@mergify mergify Bot removed the needs-rebase label Sep 9, 2026
@dllehr-amd
dllehr-amd self-requested a review September 9, 2026 17:33

@dllehr-amd dllehr-amd left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @rebklee

@AndreasKaratzas AndreasKaratzas added the verified Run pre-commit for new contributors without triggering other tests label Sep 9, 2026
@AndreasKaratzas

Copy link
Copy Markdown
Member

/ci run

@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown

✅ Triggered Buildkite CI #87971 for commit 281f21439978.

@mergify

mergify Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

This pull request has merge conflicts that must be resolved before it can be
merged. Please rebase the PR, @rebklee.

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify Bot added the needs-rebase label Sep 11, 2026
Signed-off-by: Rebecca Lee <rebecca.lee@amd.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@mergify mergify Bot removed the needs-rebase label Sep 11, 2026
@rebklee

rebklee commented Sep 15, 2026

Copy link
Copy Markdown
Contributor Author

/ci run

@github-actions

Copy link
Copy Markdown

✅ Triggered Buildkite CI #89135 for commit 0c9da067074a.

Signed-off-by: Rebecca Lee <rebecca.lee@amd.com>
@rebklee

rebklee commented Sep 15, 2026

Copy link
Copy Markdown
Contributor Author

/ci run

@github-actions

Copy link
Copy Markdown

✅ Triggered Buildkite CI #89189 for commit 2f78ba7e8113.

@rebklee

rebklee commented Sep 16, 2026

Copy link
Copy Markdown
Contributor Author

@AndreasKaratzas this is approved and passing CI on 2f78ba7. Could you please take a look and add ready if it looks good? Thanks!

rebklee added a commit to rebklee/vllm that referenced this pull request Sep 16, 2026
This branch carried its own copy of vllm-project#54248: the three aiter.py
input_quant_key() methods, the online/fp8.py QuantizedActivation
plumbing, and the contract test's AITER kernel registrations. Those
files now come from vllm-project#54248 alone, and this branch keeps only the KDA
gated-RMSNorm fusion, inert until vllm-project#54248 lands -- the same dependency
that vllm-project#55043 already has.

Signed-off-by: Rebecca Lee <rebecca.lee@amd.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@AndreasKaratzas
AndreasKaratzas merged commit 6ca2b23 into vllm-project:main Sep 16, 2026
154 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in AMD Sep 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

quantization rocm Related to AMD ROCm verified Run pre-commit for new contributors without triggering other tests

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants