Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions test/prototype/mx_formats/test_inference_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,16 @@ def test_inference_workflow_nvfp4(
f"Got a sqnr of {sqnr} for NVFP4 recipe with bias={bias}, mm_config={mm_config}"
)

# serialization
with tempfile.NamedTemporaryFile() as f:
torch.save(m_mx.state_dict(), f)
f.seek(0)

# temporary workaround for https://github.com/pytorch/ao/issues/3077
torch.serialization.add_safe_globals([getattr])

_ = torch.load(f, weights_only=True)


class VLLMIntegrationTestCase(TorchAOIntegrationTestCase):
@pytest.mark.skipif(not torch.cuda.is_available(), reason="CUDA not available")
Expand Down
1 change: 1 addition & 0 deletions torchao/prototype/mx_formats/inference_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ def _nvfp4_inference_linear_transform(
NVFP4MMConfig,
MXGemmKernelChoice,
QuantizeTensorToMXKwargs,
QuantizeTensorToNVFP4Kwargs,
ScaleCalculationMode,
]
)
Expand Down
Loading