pytorch/test/cpp/jit
Michael Suo fefa6d305e fix side-effects and aliasing for custom ops (#18711)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/18711
ghimport-source-id: c9caedc0660b2b7ba3730cd0e1a2e0e9c3cf422b

Stack from [ghstack](https://github.com/ezyang/ghstack):
* **#18711 [jit] fix side-effects and aliasing for custom ops**

Previously we didn't track aliasing, mutation, or side effects for
custom ops. This PR adds in guards with the most conservative
assumptions possible: the op will
1) have side effects,
2) write to everything
3) produce a wildcard.

In order to tell whether a given operator is a custom op, this PR introduces
the concept of a "reserved" namespace (basically all our builtin namespaces).
Custom ops live in non-reserved namespaces, so a check on the namespace
is sufficient to tell whether a schema/node is "custom" or not.

This is just to get things correct for now. Follow-ups to this:
- Users should be able to specify aliasing/mutability without having to learn
the whole alias annotation schema.
- Relax assumptions a bit. In particular outputs can only alias input tensors,
they don't have to be wildcards.

Fixes #18490

Differential Revision: D14730978

fbshipit-source-id: 540b47a24ccf24145051609bdcc99c97e46e0fe0
2019-04-05 10:48:14 -07:00
..
__init__.py Add train() / eval() / is_training() to C++ ScriptModule API (#16044) 2019-02-01 13:07:38 -08:00
CMakeLists.txt unify cpp tests (#17947) 2019-03-12 21:35:40 -07:00
test_alias_analysis.h fix side-effects and aliasing for custom ops (#18711) 2019-04-05 10:48:14 -07:00
test_argument_spec.h Breakup Test Misc (batch 1/2) (#18071) 2019-03-15 13:56:19 -07:00
test_autodiff.h Add ability to specialize class types to ArgumentSpec (#18314) 2019-04-02 17:35:57 -07:00
test_base.h fix double free in test_jit (#18121) 2019-03-18 09:59:13 -07:00
test_class_parser.h add support for parsing class defs to the string frontend (#17628) 2019-03-11 19:13:55 -07:00
test_code_template.h Breakup test misc pt2 (#18191) 2019-03-19 19:41:22 -07:00
test_constant_pooling.h Remove remaining test jit expects redux (#17924) 2019-03-12 11:33:34 -07:00
test_create_autodiff_subgraphs.h Breakup Test Misc (batch 1/2) (#18071) 2019-03-15 13:56:19 -07:00
test_custom_operators.h fix side-effects and aliasing for custom ops (#18711) 2019-04-05 10:48:14 -07:00
test_dynamic_dag.h Breakup test misc pt2 (#18191) 2019-03-19 19:41:22 -07:00
test_fuser.h Breakup test misc pt2 (#18191) 2019-03-19 19:41:22 -07:00
test_graph_executor.h Breakup Test Misc (batch 1/2) (#18071) 2019-03-15 13:56:19 -07:00
test_interpreter.h Breakup test misc pt2 (#18191) 2019-03-19 19:41:22 -07:00
test_ir.h Breakup Test Misc (batch 1/2) (#18071) 2019-03-15 13:56:19 -07:00
test_irparser.h Re-land Parsing file check (#18570) 2019-04-01 11:56:32 -07:00
test_ivalue.h Breakup Test Misc (batch 1/2) (#18071) 2019-03-15 13:56:19 -07:00
test_misc.h fix side-effects and aliasing for custom ops (#18711) 2019-04-05 10:48:14 -07:00
test_netdef_converter.h JIT IR - Make valueMapPtr optional in convertNetDefToIR (#17942) 2019-03-14 12:22:49 -07:00
test_peephole_optimize.h Optimize boolean expressions & unwraps (#18259) 2019-03-25 21:50:57 -07:00
test_subgraph_utils.h Breakup Test Misc (batch 1/2) (#18071) 2019-03-15 13:56:19 -07:00
test_utils.h Breakup Test Misc (batch 1/2) (#18071) 2019-03-15 13:56:19 -07:00
test.cpp fix side-effects and aliasing for custom ops (#18711) 2019-04-05 10:48:14 -07:00
tests_setup.py Add train() / eval() / is_training() to C++ ScriptModule API (#16044) 2019-02-01 13:07:38 -08:00