mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-01-27 23:00:20 +08:00
Merge remote-tracking branch 'origin/comfyanonymous-patch-1' into temp_pr
This commit is contained in:
commit
9420c1bb2b
@ -153,9 +153,9 @@ class TestMixedPrecisionOps(unittest.TestCase):
|
|||||||
state_dict2 = model.state_dict()
|
state_dict2 = model.state_dict()
|
||||||
|
|
||||||
# Verify layer1.weight is a QuantizedTensor with scale preserved
|
# Verify layer1.weight is a QuantizedTensor with scale preserved
|
||||||
self.assertIsInstance(state_dict2["layer1.weight"], QuantizedTensor)
|
self.assertEqual(state_dict2["layer1.weight"], fp8_weight)
|
||||||
self.assertEqual(state_dict2["layer1.weight"]._params.scale.item(), 3.0)
|
self.assertEqual(state_dict2["layer1.weight_scale"].item(), 3.0)
|
||||||
self.assertEqual(state_dict2["layer1.weight"]._layout_cls, "TensorCoreFP8E4M3Layout")
|
self.assertEqual(model.layer1.weight._layout_cls, "TensorCoreFP8E4M3Layout")
|
||||||
|
|
||||||
# Verify non-quantized layers are standard tensors
|
# Verify non-quantized layers are standard tensors
|
||||||
self.assertNotIsInstance(state_dict2["layer2.weight"], QuantizedTensor)
|
self.assertNotIsInstance(state_dict2["layer2.weight"], QuantizedTensor)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user