Fix fp8 UT bugs#42442
Closed
YangKai0616 wants to merge 4 commits intohuggingface:mainfrom
YangKai0616:main
Closed
Conversation
Contributor
Author
SunMarc
reviewed
Nov 27, 2025
|
|
||
| current_key_name_str = re.sub(r"\d+", "*", current_key_name) | ||
| if not any(key in current_key_name_str for key in (modules_to_not_convert or [])): | ||
| if not any(key in current_key_name_parts for key in (modules_to_not_convert or [])): |
Member
There was a problem hiding this comment.
maybe we can use the same logic as mxfp4 ? We have the following function should_convert_module. Indeed here the logic here changed recently and this needs to be fixed
Contributor
|
[For maintainers] Suggested jobs to run (before merge) run-slow: finegrained_fp8 |
Member
|
This is a bit more complex to fix those due to the refactor, so I decided to open a PR to fix those. I've added you as a co-author. Thanks for running those tests ;) |
Contributor
Author
|
Alright, I will follow the changes in the new PR and close this PR. |
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.
What does this PR do?
When running the tests with the command
pytest -rA tests/quantization/finegrained_fp8/test_fp8.py, the current output reports the following errors:The errors can be categorized into two types:
EXPECTED_OUTPUTRoot cause: The
_dtypeused meta model parameter dtype in here, while theEXPECTED_OUTPUTappears to be the result obtained with a fixed dtype oftorch.float32. After I explicitly set_dtypetotorch.float32, the result matches the expected output.This PR updates the
EXPECTED_OUTPUTaccordingly. Please let me know your insights, thx!nb_linears - 25 ≠ nb_fp8_linearRoot cause: The replacement operation in here can lead to patterns like
XX.fc1.XX → XX.fc*.XX, in which case the layer namefc1listed inmodules_to_not_convertfails to match the actual layer.This PR fixes the string matching logic.