Remove old validation code for dequantization of nvfp4#5592
Conversation
|
Review updated until commit c6cf36a Description
|
| Relevant files | |||||||
|---|---|---|---|---|---|---|---|
| Enhancement |
|
PR Reviewer Guide
Here are some key observations to aid the review process:
| 🧪 PR contains tests |
| ⚡ Recommended focus areas for review |
Missing dequantize_fp4 function
dequantize_fp4 function that is not defined in this file. This function appears to be part of the new dequantization implementation that should be available. Need to verify this function exists and is properly imported. |
|
!test |
Greptile OverviewGreptile SummaryThis PR removes deprecated FP4 (nvfp4) dequantization code in favor of the newer functions (
Confidence Score: 5/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram
participant Test as Test Code
participant DP as narrow_precision.py
participant U as unpack_fp4()
participant F as fp4_to_fp32()
participant D as dequantize_fp4()
Note over Test,D: Old Flow (Removed)
Test->>DP: unpack_fp4_bytes(tensor)
DP->>DP: e2m1_to_fp32() per element
DP-->>Test: float32 tensor
Note over Test,D: New Flow
Test->>U: unpack_fp4(tensor.view(uint8))
U-->>Test: unpacked nibbles
Test->>F: fp4_to_fp32(unpacked)
F-->>Test: float32 tensor (via LUT)
Note over Test,D: dequantize_to_dtype (Refactored)
Test->>DP: dequantize_to_dtype(tensor, sf, scale)
DP->>D: dequantize_fp4(tensor, sf, amax)
D->>U: unpack_fp4()
D->>F: fp4_to_fp32()
D-->>DP: scaled float32 tensor
DP-->>Test: reshaped result
|
There was a problem hiding this comment.
Additional Comments (1)
-
tests/python/direct_utils/narrow_precision.py, line 14-54 (link)logic: removing
unpack_fp4_bytes,e2m1_to_fp32, andkE2M1ToFloatArraywill break tests that still import and use these functions:tests/python/direct/test_python_frontend.py:2700usesunpack_fp4_bytestests/python/direct/test_cutlass_nvfp4_gemm.py:155-156usesunpack_fp4_bytes
these test files need to be updated to either use the new
dequantize_fp4function or haveunpack_fp4_bytesremain available
1 file reviewed, 1 comment
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
|
!test |
Co-authored-by: jjsjann123 <jiej@nvidia.com>
|
!test |
|
!test |
Stacked on top of #5591.
This removes old validation code in favor of new dequantization of nvfp4 that was added in above mentioned PR.
No tests needed.