File tree Expand file tree Collapse file tree 4 files changed +15
-18
lines changed
test/python/v2/experimental Expand file tree Collapse file tree 4 files changed +15
-18
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ AIMET quantization for PyTorch models provides the following functionality.
4949- :ref: `aimet_torch.quantsim <apiref-torch-quantsim >`
5050- :ref: `aimet_torch.nn <apiref-torch-nn >`
5151- :ref: `aimet_torch.quantization <apiref-torch-quantization >`
52- - :ref: `aimet_torch.onnx (beta) <apiref-torch-onnx >`
52+ - :ref: `aimet_torch.onnx <apiref-torch-onnx >`
5353- :ref: `aimet_torch.adaround <apiref-torch-adaround >`
5454- :ref: `aimet_torch.seq_mse <apiref-torch-seq-mse >`
5555- :ref: `aimet_torch.experimental.adascale <apiref-torch-adascale >`
Original file line number Diff line number Diff line change 11.. _apiref-torch-onnx :
22
3- ##############################
4- aimet_torch.onnx.export (beta)
5- ##############################
3+ #######################
4+ aimet_torch.onnx.export
5+ #######################
66
77.. autofunction :: aimet_torch.onnx.export
Original file line number Diff line number Diff line change @@ -99,10 +99,10 @@ def export(
9999
100100
101101 .. note::
102- Unlike `torch.onnx.export()`, this function allows up to opset 21.
103- to support 4/16-bit quantization only available in opset 21 .
104- However, exporting to opset 21 is a beta feature and not fully stable yet .
105- For robustness, opset 20 or lower is recommended whenever possible.
102+ For robustness, onnx >=1.19 is highly recommended with this API,
103+ especially when exporting large models (>2GB) .
104+ This is due to a known bug in onnx <1.19 version converter .
105+ For more information, see https://github.com/onnx/onnx/issues/6529
106106
107107 .. note::
108108 Dynamo-based export (`dynamo=True`) is not supported yet
Original file line number Diff line number Diff line change @@ -1208,17 +1208,14 @@ def large_model():
12081208 )
12091209
12101210
1211+ @pytest .fixture
1212+ def tmp_path ():
1213+ with tempfile .TemporaryDirectory () as tmpdir :
1214+ yield pathlib .Path (tmpdir ).resolve ()
1215+
1216+
12111217@torch .no_grad ()
1212- @pytest .mark .parametrize (
1213- "opset_version" ,
1214- [
1215- 19 ,
1216- # NOTE: Currently fails because onnx version converter
1217- # has a bug with large models. This bug is expected to be fixed in onnx 1.19.
1218- # TODO (kyunggeu): Uncomment this when onnx 1.19 is released
1219- # 21, TODO: Not supported yet
1220- ],
1221- )
1218+ @pytest .mark .parametrize ("opset_version" , [19 , 21 ])
12221219@pytest .mark .parametrize ("prequantize_constants" , [False , True ])
12231220def test_export_large_model (
12241221 large_model : torch .nn .Module ,
You can’t perform that action at this time.
0 commit comments