File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed
Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -134,3 +134,30 @@ def test_residualMLP(
134134 assert module .mx_specs ["a_elem_format" ] == mx_format
135135
136136 assert found_qmodule_mx
137+
138+
139+ @pytest .mark .skipif (
140+ not available_packages ["mx" ],
141+ reason = "Skipping mx_specs error test; No package found" ,
142+ )
143+ def test_mx_specs_after_qconfig_init (
144+ model_residualMLP : torch .nn .Module ,
145+ input_residualMLP : torch .FloatTensor ,
146+ config_fp32 : dict ,
147+ ):
148+ """
149+ Test if a default config w/ MX qmodes trigger setting mx_specs inside qmodel_prep
150+
151+ Args:
152+ model_residualMLP (torch.nn.Module): Single fp32 model.
153+ input_residualMLP (torch.FloatTensor): Random 16x128 tensor.
154+ config_fp32 (dict): Config w/ fp32 settings.
155+ """
156+ config_fp32 ["qa_mode" ] = "mx_fp8_e5m2"
157+ config_fp32 ["qw_mode" ] = "mx_fp8_e5m2"
158+
159+ assert "mx_specs" not in config_fp32
160+
161+ qmodel_prep (model_residualMLP , input_residualMLP , config_fp32 , use_dynamo = True )
162+
163+ assert "mx_specs" in config_fp32
You can’t perform that action at this time.
0 commit comments