Comments (5)
Summary
The output of ONNX Runtime does not match that of PyTorch when executing test
ops_test.TestOutputConsistencyFullGraphCPU.test_output_match_opinfo__special_erfcx_cpu_float32
, sample 0
in ONNX Script TorchLib
.
To recreate this report, use
CREATE_REPRODUCTION_REPORT=1 python -m pytest onnxscript/tests/function_libs/torch_lib/ops_test.py -k test_output_match_opinfo__special_erfcx_cpu_float32
Inputs
Shapes: ['Tensor<torch.Size([20]), dtype=torch.float32>']
Details
kwargs = {}
inputs = (tensor([ 6.8808, 7.4701, -2.1085, 8.2675, -1.9719, 1.8161, -4.3817, 5.2855,
7.9339, -6.6027, 7.8228, 1.6844, 6.6493, 1.2189, 4.3397, -1.2707,
6.9380, 1.3303, -4.2016, 2.2941]),)
Expected output
Shape: torch.Size([20])
Details
expected = tensor([8.1154e-02, 7.4867e-02, 1.7025e+02, 6.7753e-02, 9.7418e+01, 2.7655e-01,
4.3567e+08, 1.0493e-01, 7.0559e-02, 1.7144e+19, 7.1546e-02, 2.9381e-01,
8.3921e-02, 3.7443e-01, 1.2680e-01, 9.6895e+00, 8.0499e-02, 3.5172e-01,
9.2827e+07, 2.2725e-01])
Actual output
Shape: torch.Size([20])
Details
actual = tensor([0.0000e+00, 0.0000e+00, 1.7025e+02, 0.0000e+00, 9.7418e+01, 2.7655e-01,
4.3567e+08, 0.0000e+00, 0.0000e+00, 1.7144e+19, 0.0000e+00, 2.9381e-01,
0.0000e+00, 3.7443e-01, 0.0000e+00, 9.6895e+00, 0.0000e+00, 3.5172e-01,
9.2827e+07, 2.2724e-01])
Difference
Details
--- actual
+++ expected
@@ -1,4 +1,4 @@
-tensor([0.0000e+00, 0.0000e+00, 1.7025e+02, 0.0000e+00, 9.7418e+01, 2.7655e-01,
- 4.3567e+08, 0.0000e+00, 0.0000e+00, 1.7144e+19, 0.0000e+00, 2.9381e-01,
- 0.0000e+00, 3.7443e-01, 0.0000e+00, 9.6895e+00, 0.0000e+00, 3.5172e-01,
- 9.2827e+07, 2.2724e-01])
+tensor([8.1154e-02, 7.4867e-02, 1.7025e+02, 6.7753e-02, 9.7418e+01, 2.7655e-01,
+ 4.3567e+08, 1.0493e-01, 7.0559e-02, 1.7144e+19, 7.1546e-02, 2.9381e-01,
+ 8.3921e-02, 3.7443e-01, 1.2680e-01, 9.6895e+00, 8.0499e-02, 3.5172e-01,
+ 9.2827e+07, 2.2725e-01])
Full error stack
Tensor-likes are not close!
Mismatched elements: 9 / 20 (45.0%)
Greatest absolute difference: 0.12679913640022278 at index (14,) (up to 1e-05 allowed)
Greatest relative difference: 1.0 at index (0,) (up to 1.3e-06 allowed)
File "/home/justinchu/dev/onnx-script/onnxscript/tests/function_libs/torch_lib/ops_test.py", line 266, in run_test_output_match
torch.testing.assert_close(
File "/home/justinchu/anaconda3/envs/onnx/lib/python3.10/site-packages/torch/testing/_comparison.py", line 1520, in assert_close
raise error_metas[0].to_error(msg)
from onnxscript.
Summary
The output of ONNX Runtime does not match that of PyTorch when executing test
ops_test.TestOutputConsistencyFullGraphCPU.test_output_match_opinfo__special_erfcx_cpu_float32
,sample 0
in ONNX ScriptTorchLib
.To recreate this report, use
CREATE_REPRODUCTION_REPORT=1 python -m pytest onnxscript/tests/function_libs/torch_lib/ops_test.py -k test_output_match_opinfo__special_erfcx_cpu_float32Inputs
Shapes:
['Tensor<torch.Size([20]), dtype=torch.float32>']
Details
Expected output
Shape:
torch.Size([20])
Details
Actual output
Shape:
torch.Size([20])
Details
Difference
Details
Full error stack
Tensor-likes are not close! Mismatched elements: 9 / 20 (45.0%) Greatest absolute difference: 0.12679913640022278 at index (14,) (up to 1e-05 allowed) Greatest relative difference: 1.0 at index (0,) (up to 1.3e-06 allowed) File "/home/justinchu/dev/onnx-script/onnxscript/tests/function_libs/torch_lib/ops_test.py", line 266, in run_test_output_match torch.testing.assert_close( File "/home/justinchu/anaconda3/envs/onnx/lib/python3.10/site-packages/torch/testing/_comparison.py", line 1520, in assert_close raise error_metas[0].to_error(msg)
Should we raise an issue there?
from onnxscript.
This is our own issue in torchlib I believe. The implementation is not numerically stable.
from onnxscript.
I feel like it's either PyTorch impl (math) or ORT ops precision issue.
from onnxscript.
from onnxscript.
Related Issues (20)
- Transformations that impact graph outputs
- Add onnx.checker.check_model into optimizer/rewriter HOT 2
- Dynamo models from torchbench has duplicated opset imports
- [IR] `copy_from` method for transferring metadata
- Pass to convert a model with bfloat16 inputs to float16 HOT 4
- Optimizer produces a wrong model if run after it is optimized and inlined HOT 1
- [torchlib] native_layer_norm_float32 is failing on MacOS CI with significant absolute difference HOT 5
- ConstantFolder fails shape inference on second iteration HOT 3
- [IR] Common passes
- [IR] Dead code elimination pass
- Atomicity in optimization/rewrite passes HOT 1
- [rewriter/optimizer] Port ORT-model-conversion tools and integrate Optimizer and Rewriter Tools
- [tracking] Enable dynamo_export tests for python=3.12
- [Rewriter] Why doesn't it match? HOT 1
- Use SVG from netron in documentations
- [IR] Tensor todos
- [IR] Values that are initialized but not graph inputs do not have their ValueInfo preserved HOT 2
- [IR] Allow values as outputs to ir.Node initializer HOT 3
- Issue in gemm_to_matmul_add
- Optimizer failure on the phi-3 model
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from onnxscript.