Fix nvfp4 convert_and_update_tensor shape check#2670
Fix nvfp4 convert_and_update_tensor shape check#2670skydoorkai wants to merge 12 commits intoNVIDIA:mainfrom
Conversation
Signed-off-by: 乙划 <zht108229@antgroup.com>
for more information, see https://pre-commit.ci
Greptile SummaryThis PR fixes a shape validation bug in nvfp4 quantization when using 3D (or N-D) tensors. Previously, the code directly compared rowwise data shapes (which preserve N-D structure) with columnwise data shapes (enforced to 2D), causing failures. The fix introduces Confidence Score: 4/5
Important Files Changed
Last reviewed commit: 36c173b |
Additional Comments (2)
|
|
@skydoorkai I think the comments from Greptile make sense (even though they are not very high priority). Could you fix those? Other than that LGTM. |
Signed-off-by: 乙划 <zht108229@antgroup.com>
for more information, see https://pre-commit.ci
Updated according to Greptile comments to add headers and compare 2D shapes. |
|
/te-ci pytorch |
Signed-off-by: 乙划 <zht108229@antgroup.com>
for more information, see https://pre-commit.ci
|
@ptrendx can you review again after the modification? |
Description
This is to fix #2607
For nvfp4's columnwise data , it is using enforced 2D shape. Thus, the original check would fail if rowwise_data shape is 3D shape.
To fix :
(1) expected_data should be enforced into 2D shape from rowwise_data's shape.
(2) use rowwise_data's shape as the “ground truth" shape.
Fixes # (issue)
Type of change
Changes
Please list the changes introduced in this PR:
Checklist: