Repository navigation
test: compare fp32 model outputs with assert_close - #142
Merged
dengqiaoyu merged 1 commit intoOct 20, 2026
Merged
Conversation
dengqiaoyu
requested review from
NehalBhandari,
crowbat,
pkmandke,
u-simha and
vineet-g
October 16, 2026 19:13
pkmandke
reviewed
Oct 19, 2026
| torch.testing.assert_close( | ||
| default_final(input_data), folded_final(input_data), atol=0, rtol=0 | ||
| ) | ||
| torch.testing.assert_close(folded_final(input_data), default_final(input_data)) |
Member
There was a problem hiding this comment.
This test doesn't exercise mmap and only tests to ensure that the fold_quantize flag is a no-op. We should ideally get/expect bit-exact match. Are we seeing this to be flaky?
Member
There was a problem hiding this comment.
Do you think deepcopy would change memory layout?
I'd say if this particular test hasn't been observed to be flaky then let's have a torch.equal for it.
crowbat
approved these changes
Oct 19, 2026
pkmandke
approved these changes
Oct 19, 2026
pkmandke
left a comment
Member
There was a problem hiding this comment.
Might be better to use torch.equal for test_fold_quantize_is_noop unless it has been observed to be flaky.
NehalBhandari
approved these changes
Oct 19, 2026
vineet-g
approved these changes
Oct 19, 2026
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.
torch.equalfails with max diff of5.96e-08, useassert_closeinstead.test_fold_quantize_is_noop @pkmandke
test_finalize_mmap_is_file_backed_and_output_preserving @pkmandke
test_finalize_mmap_preserves_weight_sharing @pkmandke
TestKMeansPalettizer::test_finalize_mmap_matches_non_mmap_output @vineet-g
TestKMeansPalettizer::test_finalize_state_dict_safetensors_roundtrip @vineet-g
TestKMeansPalettizerLoadFromStateDict::test_reproduces_prepared_model @crowbat
TestEagerQuantizer::test_prepare_basic @crowbat
TestEagerQuantizer::test_e2e_workflow @u-simha
TestKMeansPalettizer::test_finalize_torch_backend @NehalBhandari
TestGraphModeQuantizer::test_end_to_end_workflow @NehalBhandari