[tests] fix torchao tests - #14258
Open
sayakpaul wants to merge 2 commits into
Open
Conversation
dg845
reviewed
Aug 4, 2026
Comment on lines
+872
to
+880
| # version=2 int4 defaults to the "plain" packing format, which routes through the | ||
| # fbgemm/mslk Int4Tensor kernels. Pin the packing format to the tinygemm | ||
| # (_convert_weight_to_int4pack) path on CUDA and plain_int32 on Intel XPU so the tests | ||
| # don't require those extra kernels to be installed. | ||
| if config_name == "Int4WeightOnlyConfig": | ||
| if torch_device == "xpu": | ||
| config_kwargs["int4_packing_format"] = "plain_int32" | ||
| elif torch_device == "cuda": | ||
| config_kwargs["int4_packing_format"] = "tile_packed_to_4d" |
Collaborator
There was a problem hiding this comment.
Is this change intended mainly for XPU devices, or both XPU and CUDA devices? I had to install mslk (on CUDA) so that the int4wo variants of the following Flux transformer TorchAO tests would not raise an mslk ImportError:
TestFluxTransformerTorchAo::test_torchao_quantization_num_parametersTestFluxTransformerTorchAo::test_torchao_quantization_memory_footprintTestFluxTransformerTorchAo::test_torchao_quantization_inference
dg845
reviewed
Aug 4, 2026
| class TestFluxTransformerTorchAo(FluxTransformerTesterConfig, TorchAoTesterMixin): | ||
| """TorchAO quantization tests for Flux Transformer.""" | ||
|
|
||
| modules_to_not_convert_for_test = ["proj_out"] |
Collaborator
There was a problem hiding this comment.
Can you explain the motivation for not converting the proj_out layers here?
dg845
reviewed
Aug 4, 2026
dg845
left a comment
Collaborator
There was a problem hiding this comment.
Thanks! Left some comments.
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.
No description provided.