Commit Graph

1418 Commits (53e76b8ab606b3d6c3b66e2f970e95d116723375)
 

Author SHA1 Message Date
Ashay Rane 53e76b8ab6
build: create RollPyTorch to update PyTorch version in Torch-MLIR (#1419)
This patch fetches the most recent nightly (binary) build of PyTorch,
before pinning it in pytorch-requirements.txt, which is referenced in
the top-level requirements.txt file.  This way, end users will continue
to be able to run `pip -r requirements.txt` without worrying whether
doing so will break their Torch-MLIR build.

This patch also fetches the git commit hash that corresponds to the
nightly release, and this hash is passed to the out-of-tree build so
that it can build PyTorch from source.

If we were to sort the torch versions as numbers (in the usual
descending order), then 1.9 appears before 1.13.  To fix this problem,
we use the `--version-sort` flag (along with `--reverse` for specifying
a descending order).  We also filter out lines that don't contain
version numbers by only considering lines that start with a digit.

As a matter of slight clarity, this patch renames the variable
`torch_from_src` to `torch_from_bin`, since that variable is initialized
to `TM_USE_PYTORCH_BINARY`.

Co-authored-by: powderluv <powderluv@users.noreply.github.com>
2022-09-28 15:38:30 -05:00
Daniel Ellis 8d3ca887df Update installation instructions to point to new releases page. 2022-09-27 14:26:38 -04:00
JakopinA 8ef0c874c2
Implement Expand/Collapse Functionality for Aten.View (#1353) 2022-09-27 11:08:14 -07:00
Ashay Rane 78bfbf2474
build: re-enable TOSA tests after upstream LLVM rollback (#1417) 2022-09-27 07:35:33 -05:00
Eric Kunze cb1b8796a2
Convert torch si literals into signless for TOSA (#1421) 2022-09-26 16:54:27 -07:00
武家伟 c03aa63325
[MLIR] Add canonicalizer for aten.slice.t op (#1413)
* [MLIR] Add canonicalizer for aten.slice.t op

* Add mlir tests and strength the canonicalizer

* rename variable

Co-authored-by: Vremold <xremold@gamil.com>
2022-09-26 14:35:50 -07:00
Ashay Rane a60acf272d
build: update llvm tag to bebc9695 (#1415)
Summary of changes:
 - Renamed OptionalArrayRefParameter since the name conflicts with an
   upstream symbol that has a different meaning
   (https://reviews.llvm.org/D133819)
 - Removed extraneous dependency between TorchMLIRTorchToMhlo and
   ChloOps, since the existing dependency on MhloDialect is sufficient
 - Fixed code to prevent warnings related to comparisons between signed
   and unsigned values
2022-09-26 11:44:54 -05:00
Jae Hoon (Antonio) Kim 3e27aa2be3
Fix as_strided/slice symint (#1401)
* Fix as_strided symint

* Re-enable LTC tests

* Re-enable LTC

* Add hardtanh shape inference function

* Fix slice symint
2022-09-26 12:16:49 -04:00
Quinn Dawkins 41d45400be
Change out-of-tree build flag name (#1416) 2022-09-26 11:58:05 -04:00
武家伟 ab7aa01b1e
[MHLO] Add torch-to-mhlo e2e support for aten.gather op (#1410)
* Add torch-to-mhlo e2e support for aten.gather op 

* Add more e2e tests for torch.aten.gather op
2022-09-25 22:07:46 +08:00
Vivek Khandelwal bc11e1aba6 [tosa] Add "-tosa-to-tensor" pass in the lowering pipeline
Signed-Off By: Vivek Khandelwal<vivek@nod-labs.com>
2022-09-24 10:03:07 +05:30
Daniel Ellis 1dfe5efe9e Create github action for creating pip-compatible releases index 2022-09-23 15:26:19 -04:00
Quinn Dawkins 53bf09ceef
Fix iterator types for embedding bag sum mode (#1371) 2022-09-23 13:13:47 -04:00
Ashay Rane b0b2b3a199
build: add missing dependency on MLIRTorchTypesIncGen (#1405) 2022-09-23 08:08:16 -05:00
Tanyo Kwok 16dd7e2e5f
Fix dynamic shapes type verifications (#1409)
* Fix dynamic shapes type verifications
2022-09-23 20:50:29 +08:00
Tanyo Kwok 72e422b589
Add relu6 and binary broadcasts (#1408)
* Add relu6 and binary broadcasts
2022-09-23 20:39:15 +08:00
Sean Silva 7a77f9fe3d Add a way to turn off crashing tests
This adds a very long and obnoxious option to disable crashing tests.
The right fix here is to use the right multiprocessing techniques to
ensure that segfaulting tests can be XFAILed like normal tests, but we
currently don't know how to implement "catch a segfault" in Python
(patches or even just ideas welcome).

Motivated by #1361, where we ended up removing two tests from *all*
backends due to a failure in one backend, which is undesirable.
2022-09-23 05:01:39 -07:00
Tanyo Kwok 061a97c3f2
Replace empty_like && empty_memory_format with full/full_like (#1398)
* Replace empty_like && empty_memory_format with full/full_like

* fix broadcast rank0 tensor
2022-09-23 10:24:36 +08:00
Quinn Dawkins 8f2bf4ce10
Add build flag for out-of-tree builds (#1403) 2022-09-22 22:01:37 -04:00
Sean Silva 566234f97a
Disable LTC again (#1400)
https://github.com/llvm/torch-mlir/issues/1396
2022-09-22 17:49:13 -05:00
Vivek Khandelwal 4ef6e69ed4
[MLIR][TORCH] Add TorchToTosa lowering for aten.clone op (#1388)
Signed-Off By: Vivek Khandelwal <vivek@nod-labs.com>

Co-authored-by: Suraj Sudhir <16977902+sjarus@users.noreply.github.com>
2022-09-20 15:07:46 -07:00
Vivek Khandelwal 5090ac9359
[MLIR][TORCH] Add a test for sum.dim_IntList op working for tosa (#1387)
Signed-Off By: Vivek Khandelwal<vivek@nod-labs.com>

Co-authored-by: Suraj Sudhir <16977902+sjarus@users.noreply.github.com>
2022-09-20 11:38:09 -07:00
Vivek Khandelwal 1ffd42bbde
[MLIR][TORCH] Add TorchToTosa lowering for aten.broadcast_to op (#1386)
Signed-Off By: Vivek Khandelwal<vivek@nod-labs.com>
2022-09-20 10:04:51 -07:00
武家伟 0e2e94d542
Add torch-to-mhlo e2e support for AtenArangeStartStepOp (#1385)
Co-authored-by: Vremold <xremold@gamil.com>
2022-09-20 22:31:24 +08:00
Jae Hoon (Antonio) Kim 8967463980
Fix symint ops and blacklist `lift_fresh_copy` (#1373)
* Add symint to native functions yaml

* Re-enable LTC

* Fix new_empty_strided and narrow_copy
2022-09-20 10:16:04 -04:00
武家伟 4f3cd236dd
Strength the shape inference for aten.arange-like op (#1367)
Strength the shape inference for aten.arange-like op by
1. registering aten.sub and aten.ceil.Scalar op and design folders for them.
2. register a new constant-like op: Torch::ConstantNumberOp and design canonicalizer for it.
2022-09-20 12:40:19 +08:00
Sambhav Jain bb47b36eac
Add a `AllowedInModuleInitializer` trait to denote ops that are permitted in the module initializer (#1379)
This PR adds an `AllowedInModuleInitializer` trait to keep track of ops that are permitted in the module initializer. We have a handful of such ops that are produced by the IValue importer, and so this change avoids maintaining a list of ops in `TorchOps.cpp` that could lead to spurious merge conflicts, and help us integrate torch-mlir in our downstream compiler better. Please let me know if you'd prefer a better name for the trait itself. Feedback is welcome!
2022-09-19 14:56:35 -07:00
Ashay Rane e17fcea94e
build: update llvm tag to 458598cc (#1382)
No changes are required to Torch-MLIR, other than updating the MHLO
submodule to point to the branch that works with the new LLVM tag.
2022-09-19 09:39:04 -05:00
powderluv 45edef3391
Disable libzstd detection to fix M1 builds (#1380)
Previously we `sudo rm -f` the non-universal zstd installed in the GHA. The CI has this fix but it doesn't take effect in the Release builds without this change.
2022-09-18 16:50:16 -07:00
long.chen 797feaf129
[torch-mlir][Tosa] fix during torch.max.dim lower to tosa the reshape's new shape attr mismatch reshape's result type (#1378) 2022-09-16 21:29:56 -07:00
Vivek Khandelwal 04f3a4ffce [MLIR][TORCH] Add support for bool element type for aten.sum[.dim_IntList] op
This commit adds bool element type support for `aten.sum` and
`aten.sum.dim_IntList` op.

Signed-Off By: Vivek Khandelwal <vivek@nod-labs.com>
2022-09-17 09:18:34 +05:30
Ashay Rane 1895b581c4
shape-lib: generate string as multiple lines to work with MSVC (#1370)
As @oroppas identified, literal strings that are over 16,380 characters
cause the MSVC compiler to throw an error (C2026), eventually causing
the Windows build of Torch-MLIR to fail because the length of the
generated MLIR for the shape library crosses the allowed threshold.

This patch fixes the problem by making the Python script generate one
literal string per line to satisfy the MSVC compiler.

Thanks to @oroppas for the bulk of the effort required to resolve this!
2022-09-16 15:16:01 -05:00
Vivek Khandelwal 51e3c3f1ed [MLIR][TORCH] Add failing test to xfail_sets.py
Signed-Off By: Vivek Khandelwal <vivek@nod-labs.com>
2022-09-16 17:12:21 +05:30
武家伟 b316918947
Add AtenClampOp conversion pattern to MHLO (#1356)
Add AtenClampOp conversion pattern to MHLO
2022-09-16 15:09:21 +08:00
Sambhav Jain e749831434
[Arch] Remove torch_dispatch frontend and move figure to docs/ dir (#1372)
Addresses leftover comment from earlier PRs: #1254 , #1265 to remove `torch_dispatch` frontend. In addition, moves the main arch diagram into `docs/` directory for consistency.
2022-09-14 23:00:38 -07:00
powderluv 9111b9ab21
Update Torch-MLIR architecture diagram (#1265) 2022-09-14 18:47:01 -07:00
Sean Silva 851ce0c940 Remove TorchLoweringPipelineOptions from TorchConversion pipelines
TorchLoweringPipelineOptions only applies to the frontend lowering
pipeline.
2022-09-14 11:20:29 -07:00
Ashay Rane 2bb5f4d8fe
build: update llvm tag to 4d4ca6c9 (#1359)
Summary of changes:
 - Updated emitAccessorPrefix since the default value has changed
   (https://reviews.llvm.org/D133179)
 - Updated RefineTypes pass since Lattice::isUninitialized() is removed
   (https://reviews.llvm.org/D132800)
 - Updated MHLO tag so that it builds with the updated LLVM tag
 - Disabled two tests that cause segfaults in the TOSA backend (see Issue
   #1361)
2022-09-13 21:24:43 -05:00
Ashay Rane a9e1014fc7
python: add `CHECK-LABEL` statements to localize checks (#1363)
It seems as though an upstream change in PyTorch has caused the module
dump to include not just the module being tested, but also several
seemingly unrelated functions in the `torch._decom.decompositions`
namespace.  The presence of these new functions caused lit to match
variables against incorrect statements (i.e.  statements in the
unrelated functions instead of the module under test).

This patch inserts `CHECK-LABEL` statements in the failing tests so that
lit ignores these unrelated functions and only checks the statements at
or after the test module definition.
2022-09-13 15:44:13 -05:00
Sean Silva 1c8b389ead Add more info about unit tests. 2022-09-13 12:14:22 -07:00
gpetters94 48418b9c22
Fold away type_as (#1358) 2022-09-12 18:59:12 -04:00
Tanyo Kwok 7f63a17a46
[MHLO] add new options to pipeline (#1331) 2022-09-12 10:27:41 -07:00
Vivek Khandelwal 71b1f0dd7a [MLIR][TORCH] Add E2E support for aten.index.Tensor_hacked_twin op
This commit adds lowering of `index.Tensor_hacked_twin` op.

Signed-Off By: Vivek Khandelwal <vivek@nod-labs.com>
2022-09-12 21:47:18 +05:30
George Petterson a12b9c4492 Add lowering for aten::cumsum 2022-09-12 09:28:07 +05:30
Vivek Khandelwal 326f21229e [MLIR][TORCH] Fix shape calculation for aten::pow.Tensor_Tensor op
Signed-Off By: Vivek Khandelwal <vivek@nod-labs.com>
2022-09-08 21:14:12 +05:30
Vivek Khandelwal e35741fb1d [MLIR][TORCH] Add E2E support for aten.bitwise_not op
This commit adds lowering of `aten.bitwise_not` op.

Signed-Off By: Vivek Khandelwal <vivek@nod-labs.com>
2022-09-08 17:52:12 +05:30
Vivek Khandelwal 7dfadc2498 [MLIR][TORCH] Add E2E support for aten.lift_fresh_copy op
This commit adds lowering of `aten.lift_fresh_copy` op.

Signed-Off By: Vivek Khandelwal <vivek@nod-labs.com>
2022-09-08 12:32:16 +05:30
Vivek Khandelwal c19fccfca2 [MLIR][TORCH] Add E2E support for aten.pow.Tensor_Tensor op
This commit adds lowering of `aten.pow.Tensor_Tensor` op.

Signed-Off By: Vivek Khandelwal <vivek@nod-labs.com>
2022-09-08 10:01:42 +05:30
武家伟 6a1893a517
[MLIR][MHLO] Add AtenFrobeniusNormDimOp and add its conversion pattern to MHLO and linalg (#1306)
* Add aten.frobenius_norm.dim op and init its conversion pattern to linalg and MHLO, 
* run symbolic-shape-optimization before hlo-legalize-to-linalg to fit more mhlo e2e tests.
2022-09-08 10:15:36 +08:00
Sambhav Jain 068eec41cb
[Bazel] Remove MHLO enable flag (#1350)
The `-DTORCH_MLIR_ENABLE_MHLO` flag was recently introduced for `TorchMLIRTorchConversionPassesIncGen` [here](https://sourcegraph.com/github.com/llvm/torch-mlir@99093d0623c3d3e6fb961ad0c8fda5ee9fc264fe/-/blob/utils/bazel/torch-mlir-overlay/BUILD.bazel?L319) in [this recent PR](https://github.com/llvm/torch-mlir/pull/1321) (was already present for `TorchMLIRConversionPassesIncGen` [here](https://sourcegraph.com/github.com/llvm/torch-mlir@99093d0623c3d3e6fb961ad0c8fda5ee9fc264fe/-/blob/utils/bazel/torch-mlir-overlay/BUILD.bazel?L288)). Before this PR, the MHLO sources in TorchConversion were not being built. This indicates a build issue that pre-existed but didn’t trigger until this path was enabled recently. Disabling to get the build green for now, until we can diagnose and fix the build for MHLO sources in TorchConversion.
2022-09-07 13:11:19 -07:00