Conversation
Start the ActivationQuantFusionPass manual-fusion migration (RFC #43224) on the producer side of the QuantizedActivation contract (#44260). Adds maybe_fused_act_quant: given an activation and the linear it feeds, it emits a QuantizedActivation via the fused silu_and_mul_quant kernel when the linear advertises a consumable input_quant_key, and falls back to the plain activation otherwise. Llama's MLP forward calls it for down_proj; the change to model code is one line. When manual fusion fires the silu_and_mul pattern is already consumed, so the compiler ActivationQuantFusionPass finds nothing and the two never double-fuse. Only (SiluAndMul, kFp8StaticTensorSym) is registered for now. Smoke tested on RedHatAI/Llama-3.2-1B-Instruct-FP8 (default compiled + CUDA-graph path): all down_proj layers take the fused branch and generations are coherent. AI assistance (Claude) was used; all changed lines are human-reviewed. Signed-off-by: mgoin <mgoin64@gmail.com> Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.
Tip: disable this comment in your organization's Code Review settings.
4 tasks
Contributor
|
This pull request has merge conflicts that must be resolved before it can be |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Starts the
ActivationQuantFusionPassmanual-fusion migration (RFC #43224, specific tracker #43501) on the producer side of theQuantizedActivationcontract (#44260).Adds
maybe_fused_act_quant: given an activation and the linear it feeds, it emits aQuantizedActivationvia the fusedsilu_and_mul_quantkernel when the linear advertises a consumableinput_quant_key, and falls back to the plain activation otherwise. Llama's MLP forward calls it fordown_proj— the model-code change is one line. When manual fusion fires thesilu_and_mulpattern is already consumed, so the compilerActivationQuantFusionPassfinds nothing and the two never double-fuse. Only(SiluAndMul, kFp8StaticTensorSym)is registered for now; other schemes/activations are one table row each.Not a duplicate: builds on the landed contract (#44260) and is the activation-quant counterpart to the AR+RMSNorm manual fusion in #45855; no open PR covers the producer side.
Test
Smoke tested on
RedHatAI/Llama-3.2-1B-Instruct-FP8(default compiled + CUDA-graph path): all 16mlp.down_projlayers take the fused branch (input_quant_key == kFp8StaticTensorSym) and generations are coherent — theQuantizedActivationflows through the compileddown_proj.forwardintoapply_weightswith no graph break. TP2 coherence and an A/B vs. the compiler pass are follow-ups.AI assistance (Claude) was used; all changed lines are human-reviewed.