Commit Graph

1450 Commits (708fa346a6cffb9f1548730d77a19cc1c3d1991a)
 

Author SHA1 Message Date
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
Ashay Rane 93f7c0ceb5
build: update llvm tag to d2613d5b (#1343)
Summary of changes:
 - Update the dataflow analysis in RefineTypes.cpp
 - Add tosa-to-arith pass after tosa-to-linalg pass, since
   tosa-to-linalg (and canonicalizations) can produce tosa.const() ops
 - Fixed warning about not making `matchAndRewrite` as override
2022-09-07 14:35:14 -05:00
Gaurav Shukla 99093d0623 [TORCH] Add decomposition of `aten.linear` op
This commit adds decomposition of `aten.linear` op. Due to limited
support at tosa backend in case of dynamic dimensions, this
decomposition is currently disabled for tosa backend.

Signed-Off-by: Gaurav Shukla <gaurav@nod-labs.com>
2022-09-07 16:58:27 +05:30
Quinn Dawkins cc86cc0f02
Revert "Implement Non-Expand/Collapse Functionality for Aten.View (#1309)" (#1347)
Reverting commit a6a48ba233 to revise unit tests and address dynamic shape handling based on comments in #1309
2022-09-07 01:38:11 -04:00
JakopinA a6a48ba233
Implement Non-Expand/Collapse Functionality for Aten.View (#1309)
Focuses on statically sized cases such as [2, 3] -> [3, 2].
2022-09-06 14:46:04 -04:00
Tanyo Kwok 37f57a9828
Delete ConvertAtenNativeLayerNormOp from TorchToLinalg (#1336)
The ConvertAtenNativeLayerNormOp is delete because we have decomposition already
see https://github.com/llvm/torch-mlir/pull/1332
2022-09-05 10:19:20 +08:00
powderluv e6528f701a
Move CIs to use docker builds (#1316)
* Move CIs to use docker builds

Now that #1234 has landed and anyone can run CI / Release builds locally move GHA to use the same flow.

* update names

* Update comments
2022-09-02 18:35:40 -07:00
Sean Silva 7fa31817c5
Fix generated file checks (#1338)
No idea how this slipped by. Sorry about that.

Fixes #1334
2022-09-02 12:12:42 -07:00
Jacques Pienaar 51c868f4c0 Avoid linking to specific time
Recording was linking to specific time towards end of recording, changed to remove specific time.
2022-09-02 10:32:08 -07:00
powderluv 234b2f2bd4
Fix release builds to only build release (#1333)
We were defaulting to building Release and running tests. Tests are spawned separately.
2022-09-02 03:37:57 -07:00
Tanyo Kwok 512f2d9c23
Add decomposition to aten.native_layer_norm (#1332)
* Add decomposition to aten.native_layer_norm

* fix ci error
2022-09-02 09:29:22 +08:00
Tanyo Kwok 57d8ec151f
[MHLO] add VerifyMhloBackendContract (#1321)
* [MHLO] add VerifyMhloBackendContract

* guard with macro
2022-09-01 17:08:17 +08:00
powderluv 729609831c
Remove setting ulimit for docker runs (#1325)
We added both ipc=host and explicit ulimits. This _may_ be causing slow downs on GHA. Remove the ulimit setting still passes all the CI tests locally. `--ipc=host` is still required.
2022-08-31 20:37:53 -07:00
powderluv 9dbe41a85c
Drop Python3.8 binary releases. Still builds from source. (#1329)
Shows low download count and we can add it back if people ask for it. Should save release artifacts space and Release build time.
2022-08-31 20:30:01 -07:00
Sean Silva a924de3e1a Slightly tweak generated file checks
The new logic has the following benefits:
1. It does not clobber the working tree state. We expect testing to not
   change the work tree.
2. It correctly handles the case where a user has changes to the
   generated files, but hasn't checked them in yet (this happens
   frequently when adding new ops).
2022-08-31 20:03:25 -07:00
Tanyo Kwok 29cafdbb61
[MHLO] refactor pass configurations (#1315)
Related to https://github.com/llvm/torch-mlir/issues/1227

1. Reduce MHLO #ifdefs
2. Dismiss compilation warnings
2022-09-01 10:36:02 +08:00
powderluv 7769eb88f8
Set ccache logging to verbose temporarily (#1326)
This is to debug what is causing the exactly ccache look up failures etc.
2022-08-31 16:09:46 -07:00
powderluv 3704363892
Use pre-compiled headers for PyTorch Source builds (#1327)
This should speed up source builds and ccache. May cause issues on macOS (https://github.com/pytorch/pytorch/issues/80018)
2022-08-31 16:09:16 -07:00
powderluv 928c815ce2
Add shapelib and Torch ODS gen tests (#1318) 2022-08-31 15:01:59 -07:00