Skip to content

[Quant] Let DeepGEMM consume prequantized activations - #51939

Draft
WoosukKwon wants to merge 1 commit into
vllm-project:mainfrom
WoosukKwon:agent/deepgemm-prequant-linear
Draft

WoosukKwon wants to merge 1 commit into
vllm-project:mainfrom
WoosukKwon:agent/deepgemm-prequant-linear

Conversation

@WoosukKwon

Copy link
Copy Markdown
Collaborator

Purpose

Let block-scaled DeepGEMM linear kernels consume a compatible
QuantizedActivation produced upstream instead of quantizing the same BF16
activation again.

The kernel now advertises its dynamic 1x128 FP8 input contract, preserves the
original output shape, and trims only the logical rows from compiler-padded
packed UE8M0 scale storage at the custom-op boundary.

This is an independent reusable prerequisite extracted from #51936; it does not
include MoE, all-reduce, model, or MTP changes.

Duplicate-work check

No issue number was provided. I searched open PRs for DeepGEMM prequantized activation. The only exact match was the superseded draft #51936. #49828 adds
a standalone SiLU/multiply dynamic per-token CUDA kernel and does not add this
block-scaled linear input contract.

Tests

.venv/bin/python -m pytest tests/fusion/test_quant_activation_contract.py -q
# 5 passed

pre-commit run --files \
  tests/fusion/test_quant_activation_contract.py \
  vllm/model_executor/kernels/linear/scaled_mm/BlockScaledMMLinearKernel.py \
  vllm/model_executor/kernels/linear/scaled_mm/deep_gemm.py \
  vllm/model_executor/layers/quantization/fp8.py
# all applicable hooks passed

AI assistance disclosure

This change was developed with OpenAI Codex assistance. This is a draft PR;
the human submitter must review every changed line and confirm they understand
and can defend the change before marking it ready.

Advertise the dynamic block-FP8 input contract and bypass duplicate activation quantization in block-scaled DeepGEMM linear kernels.

Co-authored-by: OpenAI Codex <noreply@openai.com>

Signed-off-by: Woosuk Kwon <woosuk@inferact.ai>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant