Allow caffe2-specific graph transformations for OperatorExportTypes.ONNX_ATEN_FALLBACK when BUILD_CAFFE2 is ON (#67460)#68490
Conversation
…NNX_ATEN_FALLBACK when BUILD_CAFFE2 is ON (#67460) The use of ATEN as a fallback operator during ONNX conversion is important for increasing operator coverage or even provide more efficient implementations over some ONNX ops. Currently this feature is available through `OperatorExportTypes.ONNX_ATEN_FALLBACK`, but it also performs changes to the graph that are runnable by Caffe2, only. This PR introduces restricts caffe2-specific graph transformations for `ONNX_ATEN_FALLBACK` operator export type for when pytorch is built with caffe2 support (aka BUILD_CAFFE2=1 during build) The first version of this PR introduced a new operator export type `ONNX_ATEN__STRICT_FALLBACK`, which essentially is the same as `ONNX_ATEN_FALLBACK` but without caffe2 transformations. It was preferred to not introduce a new operator export type, but to refine the existing aten fallback one ## BC-breaking note ### The global constant `torch.onnx.PYTORCH_ONNX_CAFFE2_BUNDLE` is removed in favor of a less visible `torch.onnx._CAFFE2_ATEN_FALLBACK`. `PYTORCH_ONNX_CAFFE2_BUNDLE` is really a dead code flag always set to False. One alternative would be fixing it, but #66658 disables Caffe2 build by default. Making a Caffe2 feature a private one seems to make more sense for future deprecation. ### The method `torch.onnx.export` now defaults to ONNX when `operator_export_type` is not specified. Previously `torch.onnx.export's operator_export_type` intended to default to `ONNX_ATEN_FALLBACK` when `PYTORCH_ONNX_CAFFE2_BUNDLE` was set, but it would never happen as `PYTORCH_ONNX_CAFFE2_BUNDLE` is always undefined [ghstack-poisoned]
CI Flow Status⚛️ CI FlowRuleset - Version:
You can add a comment to the PR and tag @pytorchbot with the following commands: # ciflow rerun, "ciflow/default" will always be added automatically
@pytorchbot ciflow rerun
# ciflow rerun with additional labels "-l <ciflow/label_name>", which is equivalent to adding these labels manually and trigger the rerun
@pytorchbot ciflow rerun -l ciflow/scheduled -l ciflow/slowFor more information, please take a look at the CI Flow Wiki. |
🔗 Helpful links
💊 CI failures summary and remediationsAs of commit dc33905 (more details on the Dr. CI page): 💚 💚 Looks good so far! There are no failures yet. 💚 💚 This comment was automatically generated by Dr. CI (expand for details).Please report bugs/suggestions to the (internal) Dr. CI Users group. |
|
@msaroufim has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
…portTypes.ONNX_ATEN_FALLBACK when BUILD_CAFFE2 is ON (#67460)" The use of ATEN as a fallback operator during ONNX conversion is important for increasing operator coverage or even provide more efficient implementations over some ONNX ops. Currently this feature is available through `OperatorExportTypes.ONNX_ATEN_FALLBACK`, but it also performs changes to the graph that are runnable by Caffe2, only. This PR introduces restricts caffe2-specific graph transformations for `ONNX_ATEN_FALLBACK` operator export type for when pytorch is built with caffe2 support (aka BUILD_CAFFE2=1 during build) The first version of this PR introduced a new operator export type `ONNX_ATEN__STRICT_FALLBACK`, which essentially is the same as `ONNX_ATEN_FALLBACK` but without caffe2 transformations. It was preferred to not introduce a new operator export type, but to refine the existing aten fallback one ## BC-breaking note ### The global constant `torch.onnx.PYTORCH_ONNX_CAFFE2_BUNDLE` is removed in favor of a less visible `torch.onnx._CAFFE2_ATEN_FALLBACK`. `PYTORCH_ONNX_CAFFE2_BUNDLE` is really a dead code flag always set to False. One alternative would be fixing it, but #66658 disables Caffe2 build by default. Making a Caffe2 feature a private one seems to make more sense for future deprecation. ### The method `torch.onnx.export` now defaults to ONNX when `operator_export_type` is not specified. Previously `torch.onnx.export's operator_export_type` intended to default to `ONNX_ATEN_FALLBACK` when `PYTORCH_ONNX_CAFFE2_BUNDLE` was set, but it would never happen as `PYTORCH_ONNX_CAFFE2_BUNDLE` is always undefined Differential Revision: [D32483781](https://our.internmc.facebook.com/intern/diff/D32483781) [ghstack-poisoned]
|
@msaroufim has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
…NNX_ATEN_FALLBACK when BUILD_CAFFE2 is ON (pytorch#67460) The use of ATEN as a fallback operator during ONNX conversion is important for increasing operator coverage or even provide more efficient implementations over some ONNX ops. Currently this feature is available through `OperatorExportTypes.ONNX_ATEN_FALLBACK`, but it also performs changes to the graph that are runnable by Caffe2, only. This PR introduces restricts caffe2-specific graph transformations for `ONNX_ATEN_FALLBACK` operator export type for when pytorch is built with caffe2 support (aka BUILD_CAFFE2=1 during build) The first version of this PR introduced a new operator export type `ONNX_ATEN__STRICT_FALLBACK`, which essentially is the same as `ONNX_ATEN_FALLBACK` but without caffe2 transformations. It was preferred to not introduce a new operator export type, but to refine the existing aten fallback one ## BC-breaking note ### The global constant `torch.onnx.PYTORCH_ONNX_CAFFE2_BUNDLE` is removed in favor of a less visible `torch.onnx._CAFFE2_ATEN_FALLBACK`. `PYTORCH_ONNX_CAFFE2_BUNDLE` is really a dead code flag always set to False. One alternative would be fixing it, but pytorch#66658 disables Caffe2 build by default. Making a Caffe2 feature a private one seems to make more sense for future deprecation. ### The method `torch.onnx.export` now defaults to ONNX when `operator_export_type` is not specified. Previously `torch.onnx.export's operator_export_type` intended to default to `ONNX_ATEN_FALLBACK` when `PYTORCH_ONNX_CAFFE2_BUNDLE` was set, but it would never happen as `PYTORCH_ONNX_CAFFE2_BUNDLE` is always undefined ghstack-source-id: 8ae8ac0 Pull Request resolved: pytorch#68490
…portTypes.ONNX_ATEN_FALLBACK when BUILD_CAFFE2 is ON (#67460)" The use of ATEN as a fallback operator during ONNX conversion is important for increasing operator coverage or even provide more efficient implementations over some ONNX ops. Currently this feature is available through `OperatorExportTypes.ONNX_ATEN_FALLBACK`, but it also performs changes to the graph that are runnable by Caffe2, only. This PR introduces restricts caffe2-specific graph transformations for `ONNX_ATEN_FALLBACK` operator export type for when pytorch is built with caffe2 support (aka BUILD_CAFFE2=1 during build) The first version of this PR introduced a new operator export type `ONNX_ATEN__STRICT_FALLBACK`, which essentially is the same as `ONNX_ATEN_FALLBACK` but without caffe2 transformations. It was preferred to not introduce a new operator export type, but to refine the existing aten fallback one ## BC-breaking note ### The global constant `torch.onnx.PYTORCH_ONNX_CAFFE2_BUNDLE` is removed in favor of a less visible `torch.onnx._CAFFE2_ATEN_FALLBACK`. `PYTORCH_ONNX_CAFFE2_BUNDLE` is really a dead code flag always set to False. One alternative would be fixing it, but #66658 disables Caffe2 build by default. Making a Caffe2 feature a private one seems to make more sense for future deprecation. ### The method `torch.onnx.export` now defaults to ONNX when `operator_export_type` is not specified. Previously `torch.onnx.export's operator_export_type` intended to default to `ONNX_ATEN_FALLBACK` when `PYTORCH_ONNX_CAFFE2_BUNDLE` was set, but it would never happen as `PYTORCH_ONNX_CAFFE2_BUNDLE` is always undefined Differential Revision: [D32483781](https://our.internmc.facebook.com/intern/diff/D32483781) [ghstack-poisoned]
|
@msaroufim has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
…portTypes.ONNX_ATEN_FALLBACK when BUILD_CAFFE2 is ON (#67460)" The use of ATEN as a fallback operator during ONNX conversion is important for increasing operator coverage or even provide more efficient implementations over some ONNX ops. Currently this feature is available through `OperatorExportTypes.ONNX_ATEN_FALLBACK`, but it also performs changes to the graph that are runnable by Caffe2, only. This PR introduces restricts caffe2-specific graph transformations for `ONNX_ATEN_FALLBACK` operator export type for when pytorch is built with caffe2 support (aka BUILD_CAFFE2=1 during build) The first version of this PR introduced a new operator export type `ONNX_ATEN__STRICT_FALLBACK`, which essentially is the same as `ONNX_ATEN_FALLBACK` but without caffe2 transformations. It was preferred to not introduce a new operator export type, but to refine the existing aten fallback one ## BC-breaking note ### The global constant `torch.onnx.PYTORCH_ONNX_CAFFE2_BUNDLE` is removed in favor of a less visible `torch.onnx._CAFFE2_ATEN_FALLBACK`. `PYTORCH_ONNX_CAFFE2_BUNDLE` is really a dead code flag always set to False. One alternative would be fixing it, but #66658 disables Caffe2 build by default. Making a Caffe2 feature a private one seems to make more sense for future deprecation. ### The method `torch.onnx.export` now defaults to ONNX when `operator_export_type` is not specified. Previously `torch.onnx.export's operator_export_type` intended to default to `ONNX_ATEN_FALLBACK` when `PYTORCH_ONNX_CAFFE2_BUNDLE` was set, but it would never happen as `PYTORCH_ONNX_CAFFE2_BUNDLE` is always undefined Differential Revision: [D32483781](https://our.internmc.facebook.com/intern/diff/D32483781) [ghstack-poisoned]
|
@msaroufim has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
…NNX_ATEN_FALLBACK when BUILD_CAFFE2 is ON (pytorch#67460) The use of ATEN as a fallback operator during ONNX conversion is important for increasing operator coverage or even provide more efficient implementations over some ONNX ops. Currently this feature is available through `OperatorExportTypes.ONNX_ATEN_FALLBACK`, but it also performs changes to the graph that are runnable by Caffe2, only. This PR introduces restricts caffe2-specific graph transformations for `ONNX_ATEN_FALLBACK` operator export type for when pytorch is built with caffe2 support (aka BUILD_CAFFE2=1 during build) The first version of this PR introduced a new operator export type `ONNX_ATEN__STRICT_FALLBACK`, which essentially is the same as `ONNX_ATEN_FALLBACK` but without caffe2 transformations. It was preferred to not introduce a new operator export type, but to refine the existing aten fallback one ## BC-breaking note ### The global constant `torch.onnx.PYTORCH_ONNX_CAFFE2_BUNDLE` is removed in favor of a less visible `torch.onnx._CAFFE2_ATEN_FALLBACK`. `PYTORCH_ONNX_CAFFE2_BUNDLE` is really a dead code flag always set to False. One alternative would be fixing it, but pytorch#66658 disables Caffe2 build by default. Making a Caffe2 feature a private one seems to make more sense for future deprecation. ### The method `torch.onnx.export` now defaults to ONNX when `operator_export_type` is not specified. Previously `torch.onnx.export's operator_export_type` intended to default to `ONNX_ATEN_FALLBACK` when `PYTORCH_ONNX_CAFFE2_BUNDLE` was set, but it would never happen as `PYTORCH_ONNX_CAFFE2_BUNDLE` is always undefined ghstack-source-id: 8ae8ac0 Pull Request resolved: pytorch#68490
…NNX_ATEN_FALLBACK when BUILD_CAFFE2 is ON (pytorch#67460) The use of ATEN as a fallback operator during ONNX conversion is important for increasing operator coverage or even provide more efficient implementations over some ONNX ops. Currently this feature is available through `OperatorExportTypes.ONNX_ATEN_FALLBACK`, but it also performs changes to the graph that are runnable by Caffe2, only. This PR introduces restricts caffe2-specific graph transformations for `ONNX_ATEN_FALLBACK` operator export type for when pytorch is built with caffe2 support (aka BUILD_CAFFE2=1 during build) The first version of this PR introduced a new operator export type `ONNX_ATEN__STRICT_FALLBACK`, which essentially is the same as `ONNX_ATEN_FALLBACK` but without caffe2 transformations. It was preferred to not introduce a new operator export type, but to refine the existing aten fallback one ## BC-breaking note ### The global constant `torch.onnx.PYTORCH_ONNX_CAFFE2_BUNDLE` is removed in favor of a less visible `torch.onnx._CAFFE2_ATEN_FALLBACK`. `PYTORCH_ONNX_CAFFE2_BUNDLE` is really a dead code flag always set to False. One alternative would be fixing it, but pytorch#66658 disables Caffe2 build by default. Making a Caffe2 feature a private one seems to make more sense for future deprecation. ### The method `torch.onnx.export` now defaults to ONNX when `operator_export_type` is not specified. Previously `torch.onnx.export's operator_export_type` intended to default to `ONNX_ATEN_FALLBACK` when `PYTORCH_ONNX_CAFFE2_BUNDLE` was set, but it would never happen as `PYTORCH_ONNX_CAFFE2_BUNDLE` is always undefined ghstack-source-id: 8ae8ac0 Pull Request resolved: pytorch#68490
…NNX_ATEN_FALLBACK when BUILD_CAFFE2 is ON (#67460) (#68490) Summary: Pull Request resolved: pytorch/pytorch#68490 The use of ATEN as a fallback operator during ONNX conversion is important for increasing operator coverage or even provide more efficient implementations over some ONNX ops. Currently this feature is available through `OperatorExportTypes.ONNX_ATEN_FALLBACK`, but it also performs changes to the graph that are runnable by Caffe2, only. This PR introduces restricts caffe2-specific graph transformations for `ONNX_ATEN_FALLBACK` operator export type for when pytorch is built with caffe2 support (aka BUILD_CAFFE2=1 during build) The first version of this PR introduced a new operator export type `ONNX_ATEN__STRICT_FALLBACK`, which essentially is the same as `ONNX_ATEN_FALLBACK` but without caffe2 transformations. It was preferred to not introduce a new operator export type, but to refine the existing aten fallback one ## BC-breaking note ### The global constant `torch.onnx.PYTORCH_ONNX_CAFFE2_BUNDLE` is removed in favor of a less visible `torch.onnx._CAFFE2_ATEN_FALLBACK`. `PYTORCH_ONNX_CAFFE2_BUNDLE` is really a dead code flag always set to False. One alternative would be fixing it, but #66658 disables Caffe2 build by default. Making a Caffe2 feature a private one seems to make more sense for future deprecation. ### The method `torch.onnx.export` now defaults to ONNX when `operator_export_type` is not specified. Previously `torch.onnx.export's operator_export_type` intended to default to `ONNX_ATEN_FALLBACK` when `PYTORCH_ONNX_CAFFE2_BUNDLE` was set, but it would never happen as `PYTORCH_ONNX_CAFFE2_BUNDLE` is always undefined Co-authored-by: Nikita Shulga <nshulga@fb.com> Test Plan: Imported from OSS Reviewed By: jansel Differential Revision: D32483781 Pulled By: malfet fbshipit-source-id: e9b447db9466b369e77d747188685495aec3f124 (cherry picked from commit 5fb1eb1b1973e47a8215978e96dd1284570f13e6)
…NNX_ATEN_FALLBACK when BUILD_CAFFE2 is ON (#67460) (#68490) Summary: Pull Request resolved: pytorch/pytorch#68490 The use of ATEN as a fallback operator during ONNX conversion is important for increasing operator coverage or even provide more efficient implementations over some ONNX ops. Currently this feature is available through `OperatorExportTypes.ONNX_ATEN_FALLBACK`, but it also performs changes to the graph that are runnable by Caffe2, only. This PR introduces restricts caffe2-specific graph transformations for `ONNX_ATEN_FALLBACK` operator export type for when pytorch is built with caffe2 support (aka BUILD_CAFFE2=1 during build) The first version of this PR introduced a new operator export type `ONNX_ATEN__STRICT_FALLBACK`, which essentially is the same as `ONNX_ATEN_FALLBACK` but without caffe2 transformations. It was preferred to not introduce a new operator export type, but to refine the existing aten fallback one ## BC-breaking note ### The global constant `torch.onnx.PYTORCH_ONNX_CAFFE2_BUNDLE` is removed in favor of a less visible `torch.onnx._CAFFE2_ATEN_FALLBACK`. `PYTORCH_ONNX_CAFFE2_BUNDLE` is really a dead code flag always set to False. One alternative would be fixing it, but #66658 disables Caffe2 build by default. Making a Caffe2 feature a private one seems to make more sense for future deprecation. ### The method `torch.onnx.export` now defaults to ONNX when `operator_export_type` is not specified. Previously `torch.onnx.export's operator_export_type` intended to default to `ONNX_ATEN_FALLBACK` when `PYTORCH_ONNX_CAFFE2_BUNDLE` was set, but it would never happen as `PYTORCH_ONNX_CAFFE2_BUNDLE` is always undefined Co-authored-by: Nikita Shulga <nshulga@fb.com> Test Plan: Imported from OSS Reviewed By: jansel Differential Revision: D32483781 Pulled By: malfet fbshipit-source-id: e9b447db9466b369e77d747188685495aec3f124 (cherry picked from commit 5fb1eb1b1973e47a8215978e96dd1284570f13e6)
…NNX_ATEN_FALLBACK when BUILD_CAFFE2 is ON (#67460) (#68490) Summary: Pull Request resolved: pytorch/pytorch#68490 The use of ATEN as a fallback operator during ONNX conversion is important for increasing operator coverage or even provide more efficient implementations over some ONNX ops. Currently this feature is available through `OperatorExportTypes.ONNX_ATEN_FALLBACK`, but it also performs changes to the graph that are runnable by Caffe2, only. This PR introduces restricts caffe2-specific graph transformations for `ONNX_ATEN_FALLBACK` operator export type for when pytorch is built with caffe2 support (aka BUILD_CAFFE2=1 during build) The first version of this PR introduced a new operator export type `ONNX_ATEN__STRICT_FALLBACK`, which essentially is the same as `ONNX_ATEN_FALLBACK` but without caffe2 transformations. It was preferred to not introduce a new operator export type, but to refine the existing aten fallback one ## BC-breaking note ### The global constant `torch.onnx.PYTORCH_ONNX_CAFFE2_BUNDLE` is removed in favor of a less visible `torch.onnx._CAFFE2_ATEN_FALLBACK`. `PYTORCH_ONNX_CAFFE2_BUNDLE` is really a dead code flag always set to False. One alternative would be fixing it, but #66658 disables Caffe2 build by default. Making a Caffe2 feature a private one seems to make more sense for future deprecation. ### The method `torch.onnx.export` now defaults to ONNX when `operator_export_type` is not specified. Previously `torch.onnx.export's operator_export_type` intended to default to `ONNX_ATEN_FALLBACK` when `PYTORCH_ONNX_CAFFE2_BUNDLE` was set, but it would never happen as `PYTORCH_ONNX_CAFFE2_BUNDLE` is always undefined Co-authored-by: Nikita Shulga <nshulga@fb.com> Test Plan: Imported from OSS Reviewed By: jansel Differential Revision: D32483781 Pulled By: malfet fbshipit-source-id: e9b447db9466b369e77d747188685495aec3f124 (cherry picked from commit 5fb1eb1b1973e47a8215978e96dd1284570f13e6)
…NNX_ATEN_FALLBACK when BUILD_CAFFE2 is ON (#67460) (#68490) Summary: Pull Request resolved: pytorch/pytorch#68490 The use of ATEN as a fallback operator during ONNX conversion is important for increasing operator coverage or even provide more efficient implementations over some ONNX ops. Currently this feature is available through `OperatorExportTypes.ONNX_ATEN_FALLBACK`, but it also performs changes to the graph that are runnable by Caffe2, only. This PR introduces restricts caffe2-specific graph transformations for `ONNX_ATEN_FALLBACK` operator export type for when pytorch is built with caffe2 support (aka BUILD_CAFFE2=1 during build) The first version of this PR introduced a new operator export type `ONNX_ATEN__STRICT_FALLBACK`, which essentially is the same as `ONNX_ATEN_FALLBACK` but without caffe2 transformations. It was preferred to not introduce a new operator export type, but to refine the existing aten fallback one ## BC-breaking note ### The global constant `torch.onnx.PYTORCH_ONNX_CAFFE2_BUNDLE` is removed in favor of a less visible `torch.onnx._CAFFE2_ATEN_FALLBACK`. `PYTORCH_ONNX_CAFFE2_BUNDLE` is really a dead code flag always set to False. One alternative would be fixing it, but #66658 disables Caffe2 build by default. Making a Caffe2 feature a private one seems to make more sense for future deprecation. ### The method `torch.onnx.export` now defaults to ONNX when `operator_export_type` is not specified. Previously `torch.onnx.export's operator_export_type` intended to default to `ONNX_ATEN_FALLBACK` when `PYTORCH_ONNX_CAFFE2_BUNDLE` was set, but it would never happen as `PYTORCH_ONNX_CAFFE2_BUNDLE` is always undefined Co-authored-by: Nikita Shulga <nshulga@fb.com> Test Plan: Imported from OSS Reviewed By: jansel Differential Revision: D32483781 Pulled By: malfet fbshipit-source-id: e9b447db9466b369e77d747188685495aec3f124 (cherry picked from commit 5fb1eb1b1973e47a8215978e96dd1284570f13e6)
…NNX_ATEN_FALLBACK when BUILD_CAFFE2 is ON (#67460) (#68490) Summary: Pull Request resolved: pytorch/pytorch#68490 The use of ATEN as a fallback operator during ONNX conversion is important for increasing operator coverage or even provide more efficient implementations over some ONNX ops. Currently this feature is available through `OperatorExportTypes.ONNX_ATEN_FALLBACK`, but it also performs changes to the graph that are runnable by Caffe2, only. This PR introduces restricts caffe2-specific graph transformations for `ONNX_ATEN_FALLBACK` operator export type for when pytorch is built with caffe2 support (aka BUILD_CAFFE2=1 during build) The first version of this PR introduced a new operator export type `ONNX_ATEN__STRICT_FALLBACK`, which essentially is the same as `ONNX_ATEN_FALLBACK` but without caffe2 transformations. It was preferred to not introduce a new operator export type, but to refine the existing aten fallback one ## BC-breaking note ### The global constant `torch.onnx.PYTORCH_ONNX_CAFFE2_BUNDLE` is removed in favor of a less visible `torch.onnx._CAFFE2_ATEN_FALLBACK`. `PYTORCH_ONNX_CAFFE2_BUNDLE` is really a dead code flag always set to False. One alternative would be fixing it, but #66658 disables Caffe2 build by default. Making a Caffe2 feature a private one seems to make more sense for future deprecation. ### The method `torch.onnx.export` now defaults to ONNX when `operator_export_type` is not specified. Previously `torch.onnx.export's operator_export_type` intended to default to `ONNX_ATEN_FALLBACK` when `PYTORCH_ONNX_CAFFE2_BUNDLE` was set, but it would never happen as `PYTORCH_ONNX_CAFFE2_BUNDLE` is always undefined Co-authored-by: Nikita Shulga <nshulga@fb.com> Test Plan: Imported from OSS Reviewed By: jansel Differential Revision: D32483781 Pulled By: malfet fbshipit-source-id: e9b447db9466b369e77d747188685495aec3f124 (cherry picked from commit 5fb1eb1b1973e47a8215978e96dd1284570f13e6)
…NNX_ATEN_FALLBACK when BUILD_CAFFE2 is ON (#67460) (#68490) Summary: Pull Request resolved: pytorch/pytorch#68490 The use of ATEN as a fallback operator during ONNX conversion is important for increasing operator coverage or even provide more efficient implementations over some ONNX ops. Currently this feature is available through `OperatorExportTypes.ONNX_ATEN_FALLBACK`, but it also performs changes to the graph that are runnable by Caffe2, only. This PR introduces restricts caffe2-specific graph transformations for `ONNX_ATEN_FALLBACK` operator export type for when pytorch is built with caffe2 support (aka BUILD_CAFFE2=1 during build) The first version of this PR introduced a new operator export type `ONNX_ATEN__STRICT_FALLBACK`, which essentially is the same as `ONNX_ATEN_FALLBACK` but without caffe2 transformations. It was preferred to not introduce a new operator export type, but to refine the existing aten fallback one ## BC-breaking note ### The global constant `torch.onnx.PYTORCH_ONNX_CAFFE2_BUNDLE` is removed in favor of a less visible `torch.onnx._CAFFE2_ATEN_FALLBACK`. `PYTORCH_ONNX_CAFFE2_BUNDLE` is really a dead code flag always set to False. One alternative would be fixing it, but #66658 disables Caffe2 build by default. Making a Caffe2 feature a private one seems to make more sense for future deprecation. ### The method `torch.onnx.export` now defaults to ONNX when `operator_export_type` is not specified. Previously `torch.onnx.export's operator_export_type` intended to default to `ONNX_ATEN_FALLBACK` when `PYTORCH_ONNX_CAFFE2_BUNDLE` was set, but it would never happen as `PYTORCH_ONNX_CAFFE2_BUNDLE` is always undefined Co-authored-by: Nikita Shulga <nshulga@fb.com> Test Plan: Imported from OSS Reviewed By: jansel Differential Revision: D32483781 Pulled By: malfet fbshipit-source-id: e9b447db9466b369e77d747188685495aec3f124 (cherry picked from commit 5fb1eb1b1973e47a8215978e96dd1284570f13e6)
…NNX_ATEN_FALLBACK when BUILD_CAFFE2 is ON (#67460) (#68490) Summary: Pull Request resolved: pytorch/pytorch#68490 The use of ATEN as a fallback operator during ONNX conversion is important for increasing operator coverage or even provide more efficient implementations over some ONNX ops. Currently this feature is available through `OperatorExportTypes.ONNX_ATEN_FALLBACK`, but it also performs changes to the graph that are runnable by Caffe2, only. This PR introduces restricts caffe2-specific graph transformations for `ONNX_ATEN_FALLBACK` operator export type for when pytorch is built with caffe2 support (aka BUILD_CAFFE2=1 during build) The first version of this PR introduced a new operator export type `ONNX_ATEN__STRICT_FALLBACK`, which essentially is the same as `ONNX_ATEN_FALLBACK` but without caffe2 transformations. It was preferred to not introduce a new operator export type, but to refine the existing aten fallback one ## BC-breaking note ### The global constant `torch.onnx.PYTORCH_ONNX_CAFFE2_BUNDLE` is removed in favor of a less visible `torch.onnx._CAFFE2_ATEN_FALLBACK`. `PYTORCH_ONNX_CAFFE2_BUNDLE` is really a dead code flag always set to False. One alternative would be fixing it, but #66658 disables Caffe2 build by default. Making a Caffe2 feature a private one seems to make more sense for future deprecation. ### The method `torch.onnx.export` now defaults to ONNX when `operator_export_type` is not specified. Previously `torch.onnx.export's operator_export_type` intended to default to `ONNX_ATEN_FALLBACK` when `PYTORCH_ONNX_CAFFE2_BUNDLE` was set, but it would never happen as `PYTORCH_ONNX_CAFFE2_BUNDLE` is always undefined Co-authored-by: Nikita Shulga <nshulga@fb.com> Test Plan: Imported from OSS Reviewed By: jansel Differential Revision: D32483781 Pulled By: malfet fbshipit-source-id: e9b447db9466b369e77d747188685495aec3f124 (cherry picked from commit 5fb1eb1b1973e47a8215978e96dd1284570f13e6)
…NNX_ATEN_FALLBACK when BUILD_CAFFE2 is ON (#67460) (#68490) Summary: Pull Request resolved: pytorch/pytorch#68490 The use of ATEN as a fallback operator during ONNX conversion is important for increasing operator coverage or even provide more efficient implementations over some ONNX ops. Currently this feature is available through `OperatorExportTypes.ONNX_ATEN_FALLBACK`, but it also performs changes to the graph that are runnable by Caffe2, only. This PR introduces restricts caffe2-specific graph transformations for `ONNX_ATEN_FALLBACK` operator export type for when pytorch is built with caffe2 support (aka BUILD_CAFFE2=1 during build) The first version of this PR introduced a new operator export type `ONNX_ATEN__STRICT_FALLBACK`, which essentially is the same as `ONNX_ATEN_FALLBACK` but without caffe2 transformations. It was preferred to not introduce a new operator export type, but to refine the existing aten fallback one ## BC-breaking note ### The global constant `torch.onnx.PYTORCH_ONNX_CAFFE2_BUNDLE` is removed in favor of a less visible `torch.onnx._CAFFE2_ATEN_FALLBACK`. `PYTORCH_ONNX_CAFFE2_BUNDLE` is really a dead code flag always set to False. One alternative would be fixing it, but #66658 disables Caffe2 build by default. Making a Caffe2 feature a private one seems to make more sense for future deprecation. ### The method `torch.onnx.export` now defaults to ONNX when `operator_export_type` is not specified. Previously `torch.onnx.export's operator_export_type` intended to default to `ONNX_ATEN_FALLBACK` when `PYTORCH_ONNX_CAFFE2_BUNDLE` was set, but it would never happen as `PYTORCH_ONNX_CAFFE2_BUNDLE` is always undefined Co-authored-by: Nikita Shulga <nshulga@fb.com> Test Plan: Imported from OSS Reviewed By: jansel Differential Revision: D32483781 Pulled By: malfet fbshipit-source-id: e9b447db9466b369e77d747188685495aec3f124 (cherry picked from commit 5fb1eb1b1973e47a8215978e96dd1284570f13e6)
…NNX_ATEN_FALLBACK when BUILD_CAFFE2 is ON (#67460) (#68490) Summary: Pull Request resolved: pytorch/pytorch#68490 The use of ATEN as a fallback operator during ONNX conversion is important for increasing operator coverage or even provide more efficient implementations over some ONNX ops. Currently this feature is available through `OperatorExportTypes.ONNX_ATEN_FALLBACK`, but it also performs changes to the graph that are runnable by Caffe2, only. This PR introduces restricts caffe2-specific graph transformations for `ONNX_ATEN_FALLBACK` operator export type for when pytorch is built with caffe2 support (aka BUILD_CAFFE2=1 during build) The first version of this PR introduced a new operator export type `ONNX_ATEN__STRICT_FALLBACK`, which essentially is the same as `ONNX_ATEN_FALLBACK` but without caffe2 transformations. It was preferred to not introduce a new operator export type, but to refine the existing aten fallback one ## BC-breaking note ### The global constant `torch.onnx.PYTORCH_ONNX_CAFFE2_BUNDLE` is removed in favor of a less visible `torch.onnx._CAFFE2_ATEN_FALLBACK`. `PYTORCH_ONNX_CAFFE2_BUNDLE` is really a dead code flag always set to False. One alternative would be fixing it, but #66658 disables Caffe2 build by default. Making a Caffe2 feature a private one seems to make more sense for future deprecation. ### The method `torch.onnx.export` now defaults to ONNX when `operator_export_type` is not specified. Previously `torch.onnx.export's operator_export_type` intended to default to `ONNX_ATEN_FALLBACK` when `PYTORCH_ONNX_CAFFE2_BUNDLE` was set, but it would never happen as `PYTORCH_ONNX_CAFFE2_BUNDLE` is always undefined Co-authored-by: Nikita Shulga <nshulga@fb.com> Test Plan: Imported from OSS Reviewed By: jansel Differential Revision: D32483781 Pulled By: malfet fbshipit-source-id: e9b447db9466b369e77d747188685495aec3f124 (cherry picked from commit 5fb1eb1b1973e47a8215978e96dd1284570f13e6)
…NNX_ATEN_FALLBACK when BUILD_CAFFE2 is ON (#67460) (#68490) Summary: Pull Request resolved: pytorch/pytorch#68490 The use of ATEN as a fallback operator during ONNX conversion is important for increasing operator coverage or even provide more efficient implementations over some ONNX ops. Currently this feature is available through `OperatorExportTypes.ONNX_ATEN_FALLBACK`, but it also performs changes to the graph that are runnable by Caffe2, only. This PR introduces restricts caffe2-specific graph transformations for `ONNX_ATEN_FALLBACK` operator export type for when pytorch is built with caffe2 support (aka BUILD_CAFFE2=1 during build) The first version of this PR introduced a new operator export type `ONNX_ATEN__STRICT_FALLBACK`, which essentially is the same as `ONNX_ATEN_FALLBACK` but without caffe2 transformations. It was preferred to not introduce a new operator export type, but to refine the existing aten fallback one ## BC-breaking note ### The global constant `torch.onnx.PYTORCH_ONNX_CAFFE2_BUNDLE` is removed in favor of a less visible `torch.onnx._CAFFE2_ATEN_FALLBACK`. `PYTORCH_ONNX_CAFFE2_BUNDLE` is really a dead code flag always set to False. One alternative would be fixing it, but #66658 disables Caffe2 build by default. Making a Caffe2 feature a private one seems to make more sense for future deprecation. ### The method `torch.onnx.export` now defaults to ONNX when `operator_export_type` is not specified. Previously `torch.onnx.export's operator_export_type` intended to default to `ONNX_ATEN_FALLBACK` when `PYTORCH_ONNX_CAFFE2_BUNDLE` was set, but it would never happen as `PYTORCH_ONNX_CAFFE2_BUNDLE` is always undefined Co-authored-by: Nikita Shulga <nshulga@fb.com> Test Plan: Imported from OSS Reviewed By: jansel Differential Revision: D32483781 Pulled By: malfet fbshipit-source-id: e9b447db9466b369e77d747188685495aec3f124 (cherry picked from commit 5fb1eb1b1973e47a8215978e96dd1284570f13e6)
…NNX_ATEN_FALLBACK when BUILD_CAFFE2 is ON (#67460) (#68490) Summary: Pull Request resolved: pytorch/pytorch#68490 The use of ATEN as a fallback operator during ONNX conversion is important for increasing operator coverage or even provide more efficient implementations over some ONNX ops. Currently this feature is available through `OperatorExportTypes.ONNX_ATEN_FALLBACK`, but it also performs changes to the graph that are runnable by Caffe2, only. This PR introduces restricts caffe2-specific graph transformations for `ONNX_ATEN_FALLBACK` operator export type for when pytorch is built with caffe2 support (aka BUILD_CAFFE2=1 during build) The first version of this PR introduced a new operator export type `ONNX_ATEN__STRICT_FALLBACK`, which essentially is the same as `ONNX_ATEN_FALLBACK` but without caffe2 transformations. It was preferred to not introduce a new operator export type, but to refine the existing aten fallback one ## BC-breaking note ### The global constant `torch.onnx.PYTORCH_ONNX_CAFFE2_BUNDLE` is removed in favor of a less visible `torch.onnx._CAFFE2_ATEN_FALLBACK`. `PYTORCH_ONNX_CAFFE2_BUNDLE` is really a dead code flag always set to False. One alternative would be fixing it, but #66658 disables Caffe2 build by default. Making a Caffe2 feature a private one seems to make more sense for future deprecation. ### The method `torch.onnx.export` now defaults to ONNX when `operator_export_type` is not specified. Previously `torch.onnx.export's operator_export_type` intended to default to `ONNX_ATEN_FALLBACK` when `PYTORCH_ONNX_CAFFE2_BUNDLE` was set, but it would never happen as `PYTORCH_ONNX_CAFFE2_BUNDLE` is always undefined Co-authored-by: Nikita Shulga <nshulga@fb.com> Test Plan: Imported from OSS Reviewed By: jansel Differential Revision: D32483781 Pulled By: malfet fbshipit-source-id: e9b447db9466b369e77d747188685495aec3f124 (cherry picked from commit 5fb1eb1b1973e47a8215978e96dd1284570f13e6)
…NNX_ATEN_FALLBACK when BUILD_CAFFE2 is ON (#67460) (#68490) Summary: Pull Request resolved: pytorch/pytorch#68490 The use of ATEN as a fallback operator during ONNX conversion is important for increasing operator coverage or even provide more efficient implementations over some ONNX ops. Currently this feature is available through `OperatorExportTypes.ONNX_ATEN_FALLBACK`, but it also performs changes to the graph that are runnable by Caffe2, only. This PR introduces restricts caffe2-specific graph transformations for `ONNX_ATEN_FALLBACK` operator export type for when pytorch is built with caffe2 support (aka BUILD_CAFFE2=1 during build) The first version of this PR introduced a new operator export type `ONNX_ATEN__STRICT_FALLBACK`, which essentially is the same as `ONNX_ATEN_FALLBACK` but without caffe2 transformations. It was preferred to not introduce a new operator export type, but to refine the existing aten fallback one ## BC-breaking note ### The global constant `torch.onnx.PYTORCH_ONNX_CAFFE2_BUNDLE` is removed in favor of a less visible `torch.onnx._CAFFE2_ATEN_FALLBACK`. `PYTORCH_ONNX_CAFFE2_BUNDLE` is really a dead code flag always set to False. One alternative would be fixing it, but #66658 disables Caffe2 build by default. Making a Caffe2 feature a private one seems to make more sense for future deprecation. ### The method `torch.onnx.export` now defaults to ONNX when `operator_export_type` is not specified. Previously `torch.onnx.export's operator_export_type` intended to default to `ONNX_ATEN_FALLBACK` when `PYTORCH_ONNX_CAFFE2_BUNDLE` was set, but it would never happen as `PYTORCH_ONNX_CAFFE2_BUNDLE` is always undefined Co-authored-by: Nikita Shulga <nshulga@fb.com> Test Plan: Imported from OSS Reviewed By: jansel Differential Revision: D32483781 Pulled By: malfet fbshipit-source-id: e9b447db9466b369e77d747188685495aec3f124 (cherry picked from commit 5fb1eb1b1973e47a8215978e96dd1284570f13e6)
…NNX_ATEN_FALLBACK when BUILD_CAFFE2 is ON (#67460) (#68490) Summary: Pull Request resolved: pytorch/pytorch#68490 The use of ATEN as a fallback operator during ONNX conversion is important for increasing operator coverage or even provide more efficient implementations over some ONNX ops. Currently this feature is available through `OperatorExportTypes.ONNX_ATEN_FALLBACK`, but it also performs changes to the graph that are runnable by Caffe2, only. This PR introduces restricts caffe2-specific graph transformations for `ONNX_ATEN_FALLBACK` operator export type for when pytorch is built with caffe2 support (aka BUILD_CAFFE2=1 during build) The first version of this PR introduced a new operator export type `ONNX_ATEN__STRICT_FALLBACK`, which essentially is the same as `ONNX_ATEN_FALLBACK` but without caffe2 transformations. It was preferred to not introduce a new operator export type, but to refine the existing aten fallback one ## BC-breaking note ### The global constant `torch.onnx.PYTORCH_ONNX_CAFFE2_BUNDLE` is removed in favor of a less visible `torch.onnx._CAFFE2_ATEN_FALLBACK`. `PYTORCH_ONNX_CAFFE2_BUNDLE` is really a dead code flag always set to False. One alternative would be fixing it, but #66658 disables Caffe2 build by default. Making a Caffe2 feature a private one seems to make more sense for future deprecation. ### The method `torch.onnx.export` now defaults to ONNX when `operator_export_type` is not specified. Previously `torch.onnx.export's operator_export_type` intended to default to `ONNX_ATEN_FALLBACK` when `PYTORCH_ONNX_CAFFE2_BUNDLE` was set, but it would never happen as `PYTORCH_ONNX_CAFFE2_BUNDLE` is always undefined Co-authored-by: Nikita Shulga <nshulga@fb.com> Test Plan: Imported from OSS Reviewed By: jansel Differential Revision: D32483781 Pulled By: malfet fbshipit-source-id: e9b447db9466b369e77d747188685495aec3f124 (cherry picked from commit 5fb1eb1b1973e47a8215978e96dd1284570f13e6)
…NNX_ATEN_FALLBACK when BUILD_CAFFE2 is ON (#67460) (#68490) Summary: Pull Request resolved: pytorch/pytorch#68490 The use of ATEN as a fallback operator during ONNX conversion is important for increasing operator coverage or even provide more efficient implementations over some ONNX ops. Currently this feature is available through `OperatorExportTypes.ONNX_ATEN_FALLBACK`, but it also performs changes to the graph that are runnable by Caffe2, only. This PR introduces restricts caffe2-specific graph transformations for `ONNX_ATEN_FALLBACK` operator export type for when pytorch is built with caffe2 support (aka BUILD_CAFFE2=1 during build) The first version of this PR introduced a new operator export type `ONNX_ATEN__STRICT_FALLBACK`, which essentially is the same as `ONNX_ATEN_FALLBACK` but without caffe2 transformations. It was preferred to not introduce a new operator export type, but to refine the existing aten fallback one ## BC-breaking note ### The global constant `torch.onnx.PYTORCH_ONNX_CAFFE2_BUNDLE` is removed in favor of a less visible `torch.onnx._CAFFE2_ATEN_FALLBACK`. `PYTORCH_ONNX_CAFFE2_BUNDLE` is really a dead code flag always set to False. One alternative would be fixing it, but #66658 disables Caffe2 build by default. Making a Caffe2 feature a private one seems to make more sense for future deprecation. ### The method `torch.onnx.export` now defaults to ONNX when `operator_export_type` is not specified. Previously `torch.onnx.export's operator_export_type` intended to default to `ONNX_ATEN_FALLBACK` when `PYTORCH_ONNX_CAFFE2_BUNDLE` was set, but it would never happen as `PYTORCH_ONNX_CAFFE2_BUNDLE` is always undefined Co-authored-by: Nikita Shulga <nshulga@fb.com> Test Plan: Imported from OSS Reviewed By: jansel Differential Revision: D32483781 Pulled By: malfet fbshipit-source-id: e9b447db9466b369e77d747188685495aec3f124 (cherry picked from commit 5fb1eb1b1973e47a8215978e96dd1284570f13e6)
…NNX_ATEN_FALLBACK when BUILD_CAFFE2 is ON (#67460) (#68490) Summary: Pull Request resolved: pytorch/pytorch#68490 The use of ATEN as a fallback operator during ONNX conversion is important for increasing operator coverage or even provide more efficient implementations over some ONNX ops. Currently this feature is available through `OperatorExportTypes.ONNX_ATEN_FALLBACK`, but it also performs changes to the graph that are runnable by Caffe2, only. This PR introduces restricts caffe2-specific graph transformations for `ONNX_ATEN_FALLBACK` operator export type for when pytorch is built with caffe2 support (aka BUILD_CAFFE2=1 during build) The first version of this PR introduced a new operator export type `ONNX_ATEN__STRICT_FALLBACK`, which essentially is the same as `ONNX_ATEN_FALLBACK` but without caffe2 transformations. It was preferred to not introduce a new operator export type, but to refine the existing aten fallback one ## BC-breaking note ### The global constant `torch.onnx.PYTORCH_ONNX_CAFFE2_BUNDLE` is removed in favor of a less visible `torch.onnx._CAFFE2_ATEN_FALLBACK`. `PYTORCH_ONNX_CAFFE2_BUNDLE` is really a dead code flag always set to False. One alternative would be fixing it, but #66658 disables Caffe2 build by default. Making a Caffe2 feature a private one seems to make more sense for future deprecation. ### The method `torch.onnx.export` now defaults to ONNX when `operator_export_type` is not specified. Previously `torch.onnx.export's operator_export_type` intended to default to `ONNX_ATEN_FALLBACK` when `PYTORCH_ONNX_CAFFE2_BUNDLE` was set, but it would never happen as `PYTORCH_ONNX_CAFFE2_BUNDLE` is always undefined Co-authored-by: Nikita Shulga <nshulga@fb.com> Test Plan: Imported from OSS Reviewed By: jansel Differential Revision: D32483781 Pulled By: malfet fbshipit-source-id: e9b447db9466b369e77d747188685495aec3f124 (cherry picked from commit 5fb1eb1b1973e47a8215978e96dd1284570f13e6)
…NNX_ATEN_FALLBACK when BUILD_CAFFE2 is ON (#67460) (#68490) Summary: Pull Request resolved: pytorch/pytorch#68490 The use of ATEN as a fallback operator during ONNX conversion is important for increasing operator coverage or even provide more efficient implementations over some ONNX ops. Currently this feature is available through `OperatorExportTypes.ONNX_ATEN_FALLBACK`, but it also performs changes to the graph that are runnable by Caffe2, only. This PR introduces restricts caffe2-specific graph transformations for `ONNX_ATEN_FALLBACK` operator export type for when pytorch is built with caffe2 support (aka BUILD_CAFFE2=1 during build) The first version of this PR introduced a new operator export type `ONNX_ATEN__STRICT_FALLBACK`, which essentially is the same as `ONNX_ATEN_FALLBACK` but without caffe2 transformations. It was preferred to not introduce a new operator export type, but to refine the existing aten fallback one ## BC-breaking note ### The global constant `torch.onnx.PYTORCH_ONNX_CAFFE2_BUNDLE` is removed in favor of a less visible `torch.onnx._CAFFE2_ATEN_FALLBACK`. `PYTORCH_ONNX_CAFFE2_BUNDLE` is really a dead code flag always set to False. One alternative would be fixing it, but #66658 disables Caffe2 build by default. Making a Caffe2 feature a private one seems to make more sense for future deprecation. ### The method `torch.onnx.export` now defaults to ONNX when `operator_export_type` is not specified. Previously `torch.onnx.export's operator_export_type` intended to default to `ONNX_ATEN_FALLBACK` when `PYTORCH_ONNX_CAFFE2_BUNDLE` was set, but it would never happen as `PYTORCH_ONNX_CAFFE2_BUNDLE` is always undefined Co-authored-by: Nikita Shulga <nshulga@fb.com> Test Plan: Imported from OSS Reviewed By: jansel Differential Revision: D32483781 Pulled By: malfet fbshipit-source-id: e9b447db9466b369e77d747188685495aec3f124 (cherry picked from commit 5fb1eb1b1973e47a8215978e96dd1284570f13e6)
This PR introduces 3 BC changes: First, this PR propagates `BUILD_CAFFE2` flag to `libtorch` and `libtorch_python`, which is necessary for non-caffe2 ONNX runtimes when using `ONNX_ATEN_FALLBACK` operator export type. Second, as a complement of #68490, this PR refactors Caffe2's Aten ops symbolics to consider not only the `operator_export_type` (aka `ONNX_ATEN_FALLBACK`) to emit Caffe2 Aten ops, but also whether `BUILD_CAFFE2` (which is called `torch.onnx._CAFFE2_ATEN_FALLBACK` in python binding) is set. Lastly, it renames `onnx::ATen` to `aten::ATen` for ONNX spec consistency in a BC fashion. ONNX doesn't have `ATen` op on its spec, but PyTorch ONNX converter emits them. Non-Caffe2 backend engines would be mislead by such operator's name/domain. A non-ideal workaround would be to have Aten ops handled based on its name and ignore the (non-complaint) domain. Moreover, users could incorrectly file bugs to either ONNX or ONNX Runtime when they inspect the model and notice the presence of an unspecified ONNX operator. Pull Request resolved: #73954 Approved by: https://github.com/BowenBao, https://github.com/malfet, https://github.com/garymm, https://github.com/jiafatom
Summary: This PR introduces 3 BC changes: First, this PR propagates `BUILD_CAFFE2` flag to `libtorch` and `libtorch_python`, which is necessary for non-caffe2 ONNX runtimes when using `ONNX_ATEN_FALLBACK` operator export type. Second, as a complement of #68490, this PR refactors Caffe2's Aten ops symbolics to consider not only the `operator_export_type` (aka `ONNX_ATEN_FALLBACK`) to emit Caffe2 Aten ops, but also whether `BUILD_CAFFE2` (which is called `torch.onnx._CAFFE2_ATEN_FALLBACK` in python binding) is set. Lastly, it renames `onnx::ATen` to `aten::ATen` for ONNX spec consistency in a BC fashion. ONNX doesn't have `ATen` op on its spec, but PyTorch ONNX converter emits them. Non-Caffe2 backend engines would be mislead by such operator's name/domain. A non-ideal workaround would be to have Aten ops handled based on its name and ignore the (non-complaint) domain. Moreover, users could incorrectly file bugs to either ONNX or ONNX Runtime when they inspect the model and notice the presence of an unspecified ONNX operator. Pull Request resolved: #73954 Reviewed By: anjali411 Differential Revision: D34978368 Pulled By: malfet fbshipit-source-id: 775b281e90fdea77379fe36212cff1f57b95f6a1
…tTypes.ONNX_ATEN_FALLBACK when BUILD_CAFFE2 is ON (pytorch#67460) (pytorch#68490)" This reverts commit eb4238f.
Stack from ghstack:
The use of ATEN as a fallback operator during ONNX conversion is important for increasing operator coverage or even provide more efficient implementations over some ONNX ops.
Currently this feature is available through
OperatorExportTypes.ONNX_ATEN_FALLBACK,but it also performs changes to the graph that are runnable by Caffe2, only.
This PR introduces restricts caffe2-specific graph transformations for
ONNX_ATEN_FALLBACKoperator export type for when pytorch is built with caffe2 support (aka BUILD_CAFFE2=1 during build)
The first version of this PR introduced a new operator export type
ONNX_ATEN__STRICT_FALLBACK,which essentially is the same as
ONNX_ATEN_FALLBACKbut without caffe2 transformations.It was preferred to not introduce a new operator export type, but to refine the existing aten fallback one
BC-breaking note
The global constant
torch.onnx.PYTORCH_ONNX_CAFFE2_BUNDLEis removed in favor ofa less visible
torch.onnx._CAFFE2_ATEN_FALLBACK.PYTORCH_ONNX_CAFFE2_BUNDLEis really a dead code flag always set to False.One alternative would be fixing it, but #66658 disables Caffe2 build by default.
Making a Caffe2 feature a private one seems to make more sense for future deprecation.
The method
torch.onnx.exportnow defaults to ONNX whenoperator_export_typeis not specified.Previously
torch.onnx.export's operator_export_typeintended to default toONNX_ATEN_FALLBACKwhenPYTORCH_ONNX_CAFFE2_BUNDLEwas set, but it would never happen asPYTORCH_ONNX_CAFFE2_BUNDLEis always undefinedDifferential Revision: D32483781