torch-mlir/python/npcomp
Sean Silva 30356c41c8 Add torch-adjust-calling-conventions pass.
This pass incorporates torch.type_bound info and also removes NoneType
returns (eventually it will rewrite tuple types too, but can't yet
because !basicpy.TupleType doesn't track element types).

Recommend looking at adjust-calling-conventions.mlir first to see what
it is doing, and holding your nose for the implementation of the pass.
I decided to implement this with the conversion framework, because it
gives us *some* goodies for type conversion -- mainly avoiding large
amounts of tricky RAUW dances. Unfortunately, the conversion framework
isn't a perfect fit for a couple reasons:
- the incorporation of torch.type_bound is a context-sensitive rewrite
  (requires looking at the arg attr, not just the type).
- NoneType conversion is 1->0, which requires some special handling
- (not implemented yet) 1->N tuple type conversions require special
  handling.
It's a little bit scary, but on balance doing it the other way would
have its own downsides.
2021-04-05 17:56:35 -07:00
..
compiler Add torch-adjust-calling-conventions pass. 2021-04-05 17:56:35 -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 Bump llvm-project to 223dcdcfbe23affdf17ada7f023ee1872fd76160 2021-04-05 17:56:35 -07: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