Skip to content

Commit

Permalink
[ONNX] ONNX dev branch merge 01-06-2021 (#50163)
Browse files Browse the repository at this point in the history
Summary:
[ONNX] ONNX dev branch merge 01-06-2021
- [ONNX] Support onnx if/loop sequence output in opset 13 - (#49270)
- Symbolic function for torch.square (#49446)
- [ONNX] Add checks in ONNXSetDynamicInputShape (#49783) …
- [ONNX] Enable export af aten::__derive_index (#49514) …
- [ONNX] Update symbolic for unfold (#49378) …
- [ONNX] Update the sequence of initializers in exported graph so that it is as same as inputs. (#49798)
- [ONNX] Enable opset 13 ops (#49612) …
- [ONNX] Improve error message for supported model input types in ONNX export API. (#50119)
- [ONNX] Add a post-pass for If folding (#49410)

Pull Request resolved: #50163

Reviewed By: pbelevich

Differential Revision: D25821059

Pulled By: SplitInfinity

fbshipit-source-id: 9f511a93d9d5812d0ab0a49d61ed0fa5f8066948
  • Loading branch information
Spandan Tiwari authored and facebook-github-bot committed Jan 13, 2021
1 parent 30a8ba9 commit aeefe2c
Show file tree
Hide file tree
Showing 30 changed files with 1,511 additions and 168 deletions.
2 changes: 1 addition & 1 deletion .jenkins/caffe2/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ if [[ "$BUILD_ENVIRONMENT" == *onnx* ]]; then
# JIT C++ extensions require ninja, so put it into PATH.
export PATH="/var/lib/jenkins/.local/bin:$PATH"
if [[ "$BUILD_ENVIRONMENT" == *py3* ]]; then
pip install -q --user onnxruntime==1.5.2
pip install -q --user onnxruntime==1.6.0
fi
"$ROOT_DIR/scripts/onnx/test.sh"
fi
1 change: 1 addition & 0 deletions aten/src/ATen/core/interned_strings.h
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@ namespace c10 {
_(onnx, ReduceL2) \
_(onnx, Conv) \
_(onnx, BatchNormalization) \
_(onnx, ReduceProd) \
FORALL_ATTR_BASE_SYMBOLS(_) \
_(attr, Subgraph) \
_(attr, ReverseSubgraph) \
Expand Down
2 changes: 1 addition & 1 deletion scripts/onnx/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ if [[ "$BUILD_ENVIRONMENT" == *ort_test1* ]]; then
fi
if [[ "$BUILD_ENVIRONMENT" == *ort_test2* ]]; then
# Update the loop for new opsets
for i in $(seq 10 12); do
for i in $(seq 10 13); do
pytest "${args[@]}" \
"$top_dir/test/onnx/test_pytorch_onnx_onnxruntime.py::TestONNXRuntime_opset$i"
done
Expand Down
12 changes: 6 additions & 6 deletions test/onnx/expect/TestOperators.test_batchnorm.expect
Original file line number Diff line number Diff line change
Expand Up @@ -26,25 +26,25 @@ graph {
initializer {
dims: 2
data_type: 1
name: "bias"
raw_data: "\000\000\000\000\000\000\000\000"
name: "weight"
raw_data: "\000\000\200?\000\000\200?"
}
initializer {
dims: 2
data_type: 1
name: "running_mean"
name: "bias"
raw_data: "\000\000\000\000\000\000\000\000"
}
initializer {
dims: 2
data_type: 1
name: "running_var"
raw_data: "\000\000\200?\000\000\200?"
name: "running_mean"
raw_data: "\000\000\000\000\000\000\000\000"
}
initializer {
dims: 2
data_type: 1
name: "weight"
name: "running_var"
raw_data: "\000\000\200?\000\000\200?"
}
input {
Expand Down
12 changes: 6 additions & 6 deletions test/onnx/expect/TestOperators.test_batchnorm_1d.expect
Original file line number Diff line number Diff line change
Expand Up @@ -26,25 +26,25 @@ graph {
initializer {
dims: 2
data_type: 1
name: "bias"
raw_data: "\000\000\000\000\000\000\000\000"
name: "weight"
raw_data: "\000\000\200?\000\000\200?"
}
initializer {
dims: 2
data_type: 1
name: "running_mean"
name: "bias"
raw_data: "\000\000\000\000\000\000\000\000"
}
initializer {
dims: 2
data_type: 1
name: "running_var"
raw_data: "\000\000\200?\000\000\200?"
name: "running_mean"
raw_data: "\000\000\000\000\000\000\000\000"
}
initializer {
dims: 2
data_type: 1
name: "weight"
name: "running_var"
raw_data: "\000\000\200?\000\000\200?"
}
input {
Expand Down
12 changes: 6 additions & 6 deletions test/onnx/expect/TestOperators.test_batchnorm_onnx_irv4.expect
Original file line number Diff line number Diff line change
Expand Up @@ -26,25 +26,25 @@ graph {
initializer {
dims: 2
data_type: 1
name: "bias"
raw_data: "\000\000\000\000\000\000\000\000"
name: "weight"
raw_data: "\000\000\200?\000\000\200?"
}
initializer {
dims: 2
data_type: 1
name: "running_mean"
name: "bias"
raw_data: "\000\000\000\000\000\000\000\000"
}
initializer {
dims: 2
data_type: 1
name: "running_var"
raw_data: "\000\000\200?\000\000\200?"
name: "running_mean"
raw_data: "\000\000\000\000\000\000\000\000"
}
initializer {
dims: 2
data_type: 1
name: "weight"
name: "running_var"
raw_data: "\000\000\200?\000\000\200?"
}
input {
Expand Down
12 changes: 6 additions & 6 deletions test/onnx/expect/TestOperators.test_batchnorm_training.expect
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ graph {
}
}
name: "torch-jit-export"
initializer {
dims: 2
data_type: 1
name: "weight"
raw_data: "\000\000\200?\000\000\200?"
}
initializer {
dims: 2
data_type: 1
Expand All @@ -45,12 +51,6 @@ graph {
name: "running_var"
raw_data: "fff?fff?"
}
initializer {
dims: 2
data_type: 1
name: "weight"
raw_data: "\000\000\200?\000\000\200?"
}
input {
name: "input"
type {
Expand Down
8 changes: 4 additions & 4 deletions test/onnx/expect/TestOperators.test_layer_norm_aten.expect
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ graph {
dims: 10
dims: 10
data_type: 1
name: "bias"
raw_data: "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"
name: "weight"
raw_data: "\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?"
}
initializer {
dims: 10
dims: 10
data_type: 1
name: "weight"
raw_data: "\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?\000\000\200?"
name: "bias"
raw_data: "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"
}
input {
name: "input"
Expand Down
10 changes: 5 additions & 5 deletions test/onnx/expect/TestOperators.test_linear.expect
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@ graph {
name: "torch-jit-export"
initializer {
dims: 5
dims: 4
data_type: 1
name: "bias"
raw_data: "\324BO\276@\245T>\350\377\245\275\374u\336\276&\212\304>"
name: "weight"
raw_data: "\212\332\356>@\265u>p\303E\275 \320\306\274\354\201\221>\004\354\261\276\2746*>8\247)\276\340\035\224>\024\2446\276\200\211\312<\224\344,>D\356\257>\320\202\226\275\364\213\351>z\226\330\276\310\250\266\275\352F\377\276\000\250)=\244K\021>"
}
initializer {
dims: 5
dims: 4
data_type: 1
name: "weight"
raw_data: "\212\332\356>@\265u>p\303E\275 \320\306\274\354\201\221>\004\354\261\276\2746*>8\247)\276\340\035\224>\024\2446\276\200\211\312<\224\344,>D\356\257>\320\202\226\275\364\213\351>z\226\330\276\310\250\266\275\352F\377\276\000\250)=\244K\021>"
name: "bias"
raw_data: "\324BO\276@\245T>\350\377\245\275\374u\336\276&\212\304>"
}
input {
name: "input"
Expand Down

0 comments on commit aeefe2c

Please sign in to comment.