torch-mlir/lib
Sean Silva c4123d4d4d Add npcomp-verify-backend-contract pass.
This pass verifies that a given module satisfies the contract that we
have for backends. This is phrased as an "allowlist", because we want to
keep this interface tight. Also, this gives much better diagnostics than
a backend randomly crashing or failing to compile would (though they
could still be improved).

This was especially painful because if we had
`tensor<?x!numpy.any_dtype>` slip through, at some point RefBackend
would convert it to a memref type and trip the "verify type invariants"
assertion which gives no location or anything and crashed the process,
which was very unpleasant.

We implement this with the dialect conversion framework, which works
reasonably well and was quick to put together and familiar, but is still
very "op oriented". We probably want to make this hand-rolled
eventually, especially the error reporting (the most useful kind of
error for a dialect conversion user is not necessarily the best for this
use case). Also, in production, these error will go to users, and need
to be surfaced carefully such as "the compiler needs a type annotation
on this function parameter" which in general requires some special
analysis, wordsmithing, and overall awareness of the e2e use case (such
as how much we can lean into certain source locations) to provide a
meaningful user-level diagnostic.

Also, add `inline` to the current frontend lowering pass pipeline to
allow slightly more complicated programs that otherwise would fail on
shape inference.
2021-04-20 12:00:35 -07:00
..
Backend Add npcomp-verify-backend-contract pass. 2021-04-20 12:00:35 -07:00
CAPI Add npcomp-verify-backend-contract pass. 2021-04-20 12:00:35 -07:00
Conversion Add `aten.mm` to linalg lowering. 2021-04-16 12:03:31 -07:00
Dialect Add `aten.mm` to linalg lowering. 2021-04-16 12:03:31 -07:00
RefBackend Bump llvm-project to 223dcdcfbe23affdf17ada7f023ee1872fd76160 2021-04-05 17:56:35 -07:00
Typing Bump llvm-project to c68d2895a1f4019b387c69d1e5eec31b0eb5e7b0 2021-02-22 12:23:24 -08:00
CMakeLists.txt Add npcomp-verify-backend-contract pass. 2021-04-20 12:00:35 -07:00
InitAll.cpp Add npcomp-verify-backend-contract pass. 2021-04-20 12:00:35 -07:00