Repository navigation
Conversation
[ghstack-poisoned]
This PR needs a
|
|
@claude /pr-review |
|
Claude finished @Gasoonjia's task in 18m 31s —— View job This PR adds bucketed small-M (2..16) NVFP4 linear ops and routes dispatch to them, but on SM120 an explicit Full reviewPR Review: #25434SummaryAdds Backward Compatibility
API Design
Testing
Code Quality
Performance
RecommendationRequest Changes The |
|
Thanks. |
|
@claude /pr-review |
|
Claude finished @Gasoonjia's task in 37m 24s —— View job Approve: no correctness bugs found this round; what remains is minor: the README and docstrings still misstate where the small-M buckets apply, the new Detailed review: PR #25434 (round 7)SummaryAdds the small-M NVFP4 bucket ops API Design
Testing
Performance
RecommendationApprove. Nothing blocks. The doc and test items are minor follow-ups, and the ROCm item needs either a reply or a one-line gate. Task list
|
[ghstack-poisoned]
[ghstack-poisoned]
|
CI update: the A10G Authored with Claude Code. |
|
@claude /pr-review |
|
Claude finished @Gasoonjia's task in 29m 47s —— View job Approve: I found no correctness bugs. Four small items remain: the README's small-M sentence still contradicts the code (open since round 7), the new quick-test comment overstates bucket-16 coverage, one test decodes picks with the wrong module's constant, and the ROCm question (open since round 5) still has no answer. Full review (round 8)PR Review: #25434SummaryThe PR adds the
All 13 changed files were reviewed by reading the code. No tests were run, because this job has no GPU. API Design
Testing
Performance
RecommendationApprove. Nothing blocks:
Task list
|
[ghstack-poisoned]
|
Follow-up: the exhaustive switch is now the directory's existing Authored with Claude Code. |
Stack from ghstack (oldest at bottom):
Packed decode steps (several sessions, or a speculative verify block) run the same weights for a handful of rows. The M=1 GEMV reads the weights once per row, and the prefill kernels tile M at 16+ rows with M-sized setup, both wasting bandwidth here.
nvfp4_small_m_gemm.pyadds one op per static M bucket (triton::nvfp4_small_m_gemm_m{2,4,8,16}, aQuantizedGemmFamily) that times three kernels and split-K at AOTI compile time and keeps the fastest:rows: CUDA-core GEMV that decodes each weight tile once and applies it to all rows (BF16 activations; exact software FP4 decode without native FP4),w4a4: native FP4 tensor-core GEMM on a 16-row tile (SM120+),w4a16: BF16 tensor-core GEMM with in-register dequant.Dispatch routes
auto/w4a16NVFP4 linears whose M is statically in 2..16 (including dynamic M bounded by the bucket), andw4a8ones with M in 5..16 (its W4A8 GEMV serves decode), to the bucket op viaselect_bucket; M = 1 keeps the decode GEMV and wider M keeps prefill. With native FP4, M 2..4 keeps the decode GEMVs (nvfp4_auto_decodeforauto,nvfp4_gemvforw4a16): on an RTX 5090 the buckets were no faster thannvfp4_auto_decode, whose BF16 candidate is that GEMV (per forward, M=2 13.15 vs 11.13 ms, M=3 6.73 vs 6.72, M=4 7.24 vs 6.82). Onlyautomay time W4A4 and receives the static activation scale;w4a16/w4a8passweight_only=True, which rejects the W4A4 candidates.w4a4bypasses the buckets, the FP32 prefill output policy and an explicitET_CUDA_NVFP4_PREFILL_IMPL=dequantkeep M 5..16 off them, andET_CUDA_NVFP4_SMALL_M=0(validated as 0/1) disables them. Candidates are ordered by activation precision (rows, W4A16, W4A4) so autotune near-ties keep BF16 activations; the ops validate their operands.Authored with Claude Code.
Differential Revision: D131418688
NOTE FOR REVIEWERS: This PR has internal Meta-specific changes or comments, please review them on Phabricator!