Repository navigation
FP8 tests: same automatic dequant route on sm89+, no Fp8Dequantize leak between files - #15078
Merged
Merged
Conversation
test_explicit_and_automatic_dequantize_reload[False] relied on transformers dequantizing a device_map="cpu" fp8 load by itself, which it only does without CUDA or below sm89; report a pre-sm89 card so L4/H100/B200 take the same route. test_fp8_16bit_text_loader_dequant does real fp8 loads in process, which patch transformers' Fp8Dequantize for the rest of the session, so the ragged-block test's unpatched case stopped raising when run after it. Restore the class after each loader test, and unwrap the ragged patch in the ragged test's unpatched class.
Member
Author
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Member
Author
|
@codex review |
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.
Three FP8 tests fail on main depending on the GPU and on which other test files run in the same pytest session. These are test bugs, not library bugs. This PR changes tests only.
Failures
1.
test_fp8_dequant_save_policy.py::test_explicit_and_automatic_dequantize_reload[False]device_map = "cpu"FP8 load by itself.FineGrainedFP8HfQuantizer.validate_environmentonly does that when there is no CUDA, or when the GPU is below sm89. On L4, H100 and B200 the weights stay FP8 and the first assert fails.2.
test_fp8_ragged_block_dequant.py::test_ragged_rows_match_block_reference[glm5_3]and[ling3]test_fp8_16bit_text_loader_dequant.pydoes real in-process FP8 loads, and Unsloth's quantizer wrapper then patches transformers'Fp8Dequantizewith the ragged-block fix for the rest of the session. After that, the unpatched case in the ragged test no longer raisesValueError.Fp8Dequantizeafter each test, with the same fixturetest_fp8_dequant_save_policy.pyalready uses;Either change alone made the IDs pass. Both are kept so neither file depends on the other.
Results
Colab, transformers 5.17.0, main (09e30cf) and this branch in the same VM per GPU. "Batch" means all
tests/test_fp8_*files in one pytest call.save_policy[False],ragged[glm5_3],ragged[ling3]ragged[glm5_3],ragged[ling3]The 5 other T4 failures are the same IDs on both sides and are not touched here:
test_fp8_pre_sm89_byte_dequant.py::test_under_torch_compile, which FP8 dequant under compile: keep the torch path for bf16 on cards without native bf16 #15071 fixes; that commit is not in this run's base;test_fp8_to_nf4_load.py.