Repository navigation
Conversation
[ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/25430
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 New Failure, 1 Cancelled Job, 1 PendingAs of commit 0fe52bc with merge base 9f49fe2 ( NEW FAILURE - The following job has failed:
CANCELLED JOB - The following job was cancelled. Please retry:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This PR needs a
|
|
@claude /pr-review |
|
Claude finished @Gasoonjia's task in 19m 27s —— View job Summary: The decode math is exact for every finite input, but the new PR Review: #25430 — detailed findingsSummaryThis PR replaces the software E2M1/E4M3 decode in the NVFP4 GEMV and W4A16 kernels (used on GPUs without native FP4) with exact FP16 bit placement. It also runs the paired W4A16 kernel on every GPU and turns on the unit-scale BF16 shortcut for the software path. I checked the math by working through the bits by hand: all 16 E2M1 codes, all 254 finite E4M3 bytes, and their FP32 products come out exact. The problems are how NaN scales are handled, Code Quality
Testing
Performance
RecommendationRequest Changes: decide on NaN-scale behaviour and document it (or bring back NaN propagation), and remove
Not done: GPU tests were not run because there is no GPU here. The numeric claims were checked by working through the bits by hand. |
|
Claude finished @Gasoonjia's task in 19m 49s —— View job No new issues this round. Three minor items from earlier rounds are still open; they are listed below but not argued again. Approve. PR Review: #25430 — detailed findingsSummaryBelow SM120, the PR decodes NVFP4 exactly by placing FP16 bits in a shared These items from earlier rounds are still open at this head. I did not raise them again as findings:
RecommendationApprove. Nothing blocks.
Not run: no tests, on GPU or otherwise, because there is no GPU here. This review comes from reading the code at |
[ghstack-poisoned]
[ghstack-poisoned]
|
CI update: the A10G Authored with Claude Code. |
|
@claude /pr-review |
|
Claude finished @Gasoonjia's task in 19m 28s —— View job No correctness bugs. One item should be fixed before landing: the quick/exhaustive split from the latest update misses this PR's two largest kernel sweeps, and both run in the PR Review: #25430 — detailed findingsSummaryBelow SM120, the PR decodes NVFP4 exactly by FP16 bit placement through a shared Still open from earlier rounds (listed, not argued again):
Infrastructure
Code Quality
RecommendationApprove. Nothing blocks. The sweep gap is worth fixing before landing, because it affects the same job the latest update is meant to fix.
Not run: no tests, because there is no GPU here. The CUDA workflow for this head was still queued, so I couldn't read its |
[ghstack-poisoned]
|
Done: both of this PR's large kernel sweeps are split now.
Authored with Claude Code. |
Stack from ghstack (oldest at bottom):
Without native E2M1 conversion (below SM120) the GEMV decoded each code through a float LUT expression, and W4A16 used a separate element-wise kernel. Both now place the bits directly: an E2M1 code becomes an FP16 value times 2**-14 and an E4M3 scale an FP16 value times 2**-8, both exact for every finite byte, and one FP32 multiply by 2**22 restores the product. Kernels assume finite E4M3 scales:
CudaNVFP4Tensor.from_exportablerejects the NaN bytes 0x7F/0xFF (after the constructor's dtype checks), so the decode needs no NaN select (on A100 one cost ~0.29 ms/token in the W4A8 decode GEMV). The in-repo quantizer used to give an all-zero weight a zero global scale and so NaN block scales; it now uses a unit global scale there, and the weight packs and runs as zeros. GEMV and W4A16 share one_decode_pair(q, s, NATIVE)helper that returns the exact products; the GEMV'sNATIVE_E4M3variant is gone (native FP4 implies native E4M3). W4A16 runs the paired (two codes per byte) kernel on every GPU, so the old element-wise kernel is removed. Unit-scale BF16 GEMV skips the extra rounding on all GPUs: E2M1 x E4M3 products have at most six significant bits, sounit_scalenow only requires a global scale of 1 (finite scales of either sign).Authored with Claude Code.
Differential Revision: D131418683
NOTE FOR REVIEWERS: This PR has internal Meta-specific changes or comments, please review them on Phabricator!