mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-07 12:21:27 +01:00
Fixes #97728 Fixes #98622 Fixes https://github.com/microsoft/onnx-script/issues/393 Provide op_level_debug in exporter which creates randomnied torch.Tensor based on FakeTensorProp real shape as inputs of both torch ops and ONNX symbolic function. The PR leverages on Transformer class to create a new fx.Graph, but shares the same Module with the original one to save memory. The test is different from [op_correctness_test.py](https://github.com/microsoft/onnx-script/blob/main/onnxscript/tests/function_libs/torch_aten/ops_correctness_test.py) as op_level_debug generating real tensors based on the fake tensors in the model. Limitation: 1. Some of the trace_only function is not supported due to lack of param_schema which leads to arg/kwargs wronly split and ndarray wrapping. (WARNINGS in SARIF) 2. The ops with dim/indices (INT64) is not supported that they need the information(shape) from other input args. (WARNINGS in SARIF) 3. sym_size and built-in ops are not supported. 4. op_level_debug only labels results in SARIF. It doesn't stop exporter. 5. Introduce ONNX owning FakeTensorProp supports int/float/bool 6. parametrized op_level_debug and dynamic_shapes into FX tests Pull Request resolved: https://github.com/pytorch/pytorch/pull/97494 Approved by: https://github.com/justinchuby, https://github.com/BowenBao
25 lines
567 B
Python
25 lines
567 B
Python
"""Constant values used in ONNX."""
|
|
|
|
ONNX_ARCHIVE_MODEL_PROTO_NAME = "__MODEL_PROTO"
|
|
|
|
ONNX_BASE_OPSET = 9
|
|
ONNX_MIN_OPSET = 7
|
|
ONNX_MAX_OPSET = 18
|
|
# ONNX_DEFAULT_OPSET generated by tools/onnx/update_default_opset_version.py
|
|
ONNX_DEFAULT_OPSET = 14
|
|
ONNX_CONSTANT_FOLDING_MIN_OPSET = 9
|
|
|
|
PYTORCH_GITHUB_ISSUES_URL = "https://github.com/pytorch/pytorch/issues"
|
|
|
|
INT64_MAX = 9223372036854775807
|
|
INT32_MAX = 2147483647
|
|
INT16_MAX = 32767
|
|
INT8_MAX = 127
|
|
UINT8_MAX = 255
|
|
|
|
INT64_MIN = -9223372036854775808
|
|
INT32_MIN = -2147483648
|
|
INT16_MIN = -32768
|
|
INT8_MIN = -128
|
|
UINT8_MIN = 0
|