torch-mlir/python/npcomp
Sean Silva 703428eff4 Add support for "trailing_" and "out" variants of various ops.
We already had the `promoteTrailingOutTensor` flag, but weren't using
it. A inplaceVariantKernelName flag needed to be added.

This change is a little dissatisfying, as the conversions done by the
RecognizeKernelsPass are currently non-orthogonal. In particular,
`kDropResultAndAliasArg0` probably won't work as intended if mixed with
these (we probably need to promote kDropResultAndAliasArg0 to not be an
arg-level thing anyway, as we have done with promoteTrailingOutTensor).

This involved adding a new op `numpy.overwrite_array`.

```
numpy.overwrite_array %arg2 overwrites %arg0 : tensor<2x3xf32>, !numpy.ndarray<[2,3]:f32>
```

This models the destructive update behavior. Note that in the above op,
we cannot simply RAUW %arg0 with a suitably conveted %arg2 (for example,
%arg0 might have uses that are not dominated by %arg2, or might have an
alias relation with some other array in the program). In general, we
need a pass analogous to "SSA-formation" which knows how to see through
these to uncover an underlying tensor program.

Also, add tanh_out_e2e.py/div_inplace_e2e.py and fix some bitrot in
refjit.py which is my running example I'm trying to get working.
2021-03-19 10:34:50 -07:00
..
compiler Add support for "trailing_" and "out" variants of various ops. 2021-03-19 10:34:50 -07:00
dialects Bump llvm-project to e31c77b1827fa4dd3511f21af11cfab18ecf6d38 2021-03-10 11:01:16 -08:00
frontends Add pytorch interface to ATen Dialect (#30) 2020-08-21 11:22:47 -07:00
torch Add initial python bindings for c10 dispatcher internals. (#55) 2020-09-24 16:26:29 -07:00
tracing NFC: Delete npcomp python API and switch to upstream. 2021-01-08 10:46:24 -08:00
utils Add script tools/format_source.sh and run it on all python and c++ sources. 2020-06-13 14:53:54 -07:00
__init__.py Bump llvm-project to e31c77b1827fa4dd3511f21af11cfab18ecf6d38 2021-03-10 11:01:16 -08:00
decorators.py Add script tools/format_source.sh and run it on all python and c++ sources. 2020-06-13 14:53:54 -07:00
exporter.py Add script tools/format_source.sh and run it on all python and c++ sources. 2020-06-13 14:53:54 -07:00
smoketest.py Move python native library to python_native/_npcomp...so. 2020-05-06 22:44:12 -07:00
types.py Add script tools/format_source.sh and run it on all python and c++ sources. 2020-06-13 14:53:54 -07:00