Commit Graph

2341 Commits (099e1f4cf5cc070d411f404e08d1e25eaa648efe)
 

Author SHA1 Message Date
Vivek Khandelwal d10a86f51c Disable LTC for arm release
Also, revert https://github.com/llvm/torch-mlir/pull/2488.
Disabling LTC based on the discussion here:
https://discord.com/channels/636084430946959380/742573221882364009/1156272667813494824
2023-10-02 22:22:07 +05:30
Stella Laurenzo b75c208f4e
update PyTorch version to 2.2.0.dev20231002 (#2497)
torch version: 2.2.0.dev20231002
torch commit hash: 4dae8b49630d2784f6a5d8726db30923e2d1e077
torchvision version: 0.17.0.dev20231002

Co-authored-by: Roll PyTorch Action <torch-mlir@users.noreply.github.com>
2023-10-02 08:02:15 -07:00
Vivek Khandelwal 9293326e1e [MLIR][TORCH] Add support for bitwise_right_shit and bitwise_and.Scalar op
Signed-Off By: Vivek Khandelwal <vivek@nod-labs.com>
2023-10-02 13:06:59 +05:30
Vivek Khandelwal c434736ee9 [MLIR][TORCH] Add support for conversion to int8 dtype
Signed-Off By: Vivek Khandelwal <vivek@nod-labs.com>
2023-10-02 09:48:46 +05:30
Vivek Khandelwal 71ac62f3a8 build: manually update PyTorch version
Set PyTorch and TorchVision version to nightly release 2023-09-28.

aten.baddbmm changes done because upstream PyTorch has now added
support for fp16 gemm on CPU.
Refer: 9399e0b1ff
2023-10-02 09:48:32 +05:30
Stella Laurenzo 860be09a39
Elide dynamic broadcast checks when in strict symbolic shapes mode. (#2496)
When importing dynamic shaped programs from Dynamo, via torch.compile or
torch.export, we can assume that strict symbolic shape checks have been
done prior to generating torch IR. Among other shape checking, this
eliminates the case where an unknown dimension can be dynamically '1' in
a way that signals a broadcast.

Adds a `isAssumingStrictSymbolicShapes` utility which consults a
`torch.assume_strict_symbolic_shapes` attribute on an enclosing scope
and returns true if present.

In the linalg pipeline, many runtime checks are elided when this returns
true.
2023-09-29 16:45:48 -07:00
saienduri 4e1dd3bf10
add e2e support for torch.log10 (#2479) 2023-09-28 10:17:03 -07:00
Vivek Khandelwal 8abfa5b196
Use PyTorch nightly for Arm release build (#2488)
The LTC backend has drifted from being able to pass tests on the stable
PyTorch version, so pinning to nightly on ARM.

Signed-Off By: Vivek Khandelwal <vivek@nod-labs.com>
2023-09-27 09:40:32 -07:00
Ramiro Leal-Cavazos 7c6b9d2445
[linalg] Fix handling of trailing size-1 dimensions in aten.view (#2474)
This commit adds to the lowering of `aten.view` handling for the
following cases:

- `(..., a.size(i))` -> `(..., a.size(i), 1, ..., 1)`
- `(..., a.size(i), 1, ..., 1)` -> `(..., a.size(i))`

Fixes: https://github.com/llvm/torch-mlir/issues/2448
2023-09-27 09:09:30 -07:00
Stella Laurenzo e69266a936
update PyTorch version to 2.2.0.dev20230927 (#2489)
torch version: 2.2.0.dev20230927
torch commit hash: d7520d8668dc08f7bed27a64f006c909006e653a
torchvision version: 0.17.0.dev20230927

Co-authored-by: Roll PyTorch Action <torch-mlir@users.noreply.github.com>
2023-09-27 08:45:35 -07:00
Vivek Khandelwal 7760bda8ee build: manually update PyTorch version
Set PyTorch and TorchVision version to nightly release 2023-09-26.

aten._convolution.deprecated changes done because upstream PyTorch has
now added support for fp16 native convolution on CPU.
Refer: 7c9052165a

Signed-Off By: Vivek Khandelwal <vivek@nod-labs.com>
2023-09-27 16:24:58 +05:30
Daniel Garvey ff7f8b21dc
update llvm-project to d13da154a7c7eff77df8686b2de1cfdfa7cc7029 (#2483) 2023-09-26 16:15:55 -05:00
Ramiro Leal-Cavazos c9fd78988e
[NFC] Clean-up `ConvertAtenViewOp` in linalg backend (#2470)
While trying to fix a bug in the `ConvertAtenViewOp` pattern in the
linalg backend, I realized that the pattern had become quite complex and
had accumulated some dead code, making it hard to reason about.

This commit simplifies the pattern quite a bit. The main changes are:
1. All the static helper functions in the `ConvertAtenViewOp` class have
been simplified, both in their signature and their body. Each one now
performs simple calculations on arrays, and take the least number of
arguments necessary.
2. The body of [the `while`
loop](9fce566b0c/lib/Conversion/TorchToLinalg/DataMovement.cpp (L407))
inside the main pattern has been changed to work on `MutableArrayRef`
slices, to avoid having to keep track of `start` and `end` indices for
the input and output shape arrays.
3. All the heuristics used to determine the mapping between the input
and output dimensions are now in [this relatively short `if-else`
section](9fce566b0c/lib/Conversion/TorchToLinalg/DataMovement.cpp (L428-L460)),
making it easy to see what is going on.
4. Dead code was eliminated + updates to some of the documentation
comments

This commit does not add any new functionality to the
`ConvertAtenViewOp` pattern.
2023-09-26 09:20:01 -07:00
Bruce Kim a520d39f84
[MLIR][TORCH] Add device "cpu" support for aten.to.dtype_layout op (#2481)
This PR adds device="cpu" support for `aten.to_dtypeLayout` op and
corresponding e2e test suit.
(refer:  PR https://github.com/llvm/torch-mlir/pull/812/)
2023-09-25 10:00:19 -04:00
Ashay Rane 5f772e8cb4
CI: reconcile differences between RollPyTorch and pre-merge checks (#2482) 2023-09-23 07:00:16 -07:00
Vivek Khandelwal 6699cbcc74
build: manually update PyTorch version (#2480)
Set PyTorch and TorchVision version to nightly release 2023-09-22.

Signed-Off By: Vivek Khandelwal <vivek@nod-labs.com>
2023-09-22 14:25:18 -07:00
Gleb Kazantaev 059041e0fe
[LTC] Support torch.ones/zeros/arange ops (#2440) 2023-09-21 13:25:14 -04:00
Ben Vanik b9847b1904
Fixing implicit double to float casts. (#2476)
MSVC (and other compilers with implicit narrowing warnings) don't like
this type mismatch.
2023-09-20 10:48:40 -07:00
David Gens 023fc90072
[Torch Dialect] add avg_pool 2d and 3d op variants (#2473)
Adds ODS for `avg_pool2d` and `avg_pool3d`, including their backward and
`adaptive_` variants.
2023-09-20 13:47:08 -04:00
Stella Laurenzo 20ea1c9e91
Revert accidental change to submodule origin. (#2477) 2023-09-20 14:05:52 +08:00
Stella Laurenzo 278c41e938
Bump llvm-project to f66cd9e9556a53142a26a5c21a72e21f1579217c. (#2466)
Picks up DenseResourceElementsAttr python support and fixes minf/maxf
C++ rename.
2023-09-19 10:50:53 -07:00
Vivek Khandelwal b03efdf2e4 build: manually update PyTorch version
Set PyTorch and TorchVision version to nightly release 2023-09-18.

Signed-Off By: Vivek Khandelwal <vivek@nod-labs.com>
2023-09-19 21:14:05 +05:30
Boian Petkantchin 7a7be60dcf
Fix python package install instructions (#2464) 2023-09-14 10:23:44 -07:00
Sambhav Jain 3d974ed988
[Bazel] Replace mlir-hlo with stablehlo (#2463)
Aligns with https://github.com/llvm/torch-mlir/pull/2460 and fixes bazel
build.

GHA workflow:
https://github.com/sjain-stanford/torch-mlir/actions/runs/6178894329
2023-09-14 08:59:31 -07:00
Bruce Kim 40913a36c2
[MLIR][TORCH] Add E2E support for aten.empty_strided decomposition op (redo PR) (#2459)
Making the same PR with #2457, as I accidentally thought the review was already made and merged it (reverted).

Add decompose empty_strided op.
Referring to #1776, this decomposition op only supports default stride values, because accessing the tensor or indexing over that, the indices are determined by the strides.
In MLIR, this is not implicitly supported but assumes that the strides are default while iterating over the tensor.
2023-09-13 10:04:31 -07:00
Vivek Khandelwal 4b4c38da46 build: manually update PyTorch version
Set PyTorch and TorchVision version to nightly release 2023-09-13.
Ref: 464f9c3725

Signed-Off By: Vivek Khandelwal <vivek@nod-labs.com>
2023-09-13 21:25:21 +05:30
Stella Laurenzo 107ed0dec9
Fix two CMake issues that were causing Windows compilation failures. (#2461)
At some point in the past month, stablehlo gained a number of patches that implement a non-trivial bit of threaded reference code. It fails to compile in Windows in pretty catastrophic ways.

But this isn't the main problem: by way of the MLIR CMake macros being used, if we include stablehlo before our code, we end up building the whole project, whether needed or not.
2023-09-12 20:51:45 -07:00
Stella Laurenzo 078d1e1a1d
Remove mlir-hlo (replace with stablehlo). (#2460)
We just have to do this: I ran into an issue today where I needed to make a one line patch to stablehlo to work around a compiler issue, and it is completely unapparent how to do so given that the mlir-hlo repo is a read-only export and is at the tail end of a multi-week integration chain from the open-source stablehlo repo.

We've discussed this often enough and gotten +1 from everyone that they are ok with taking the e2e testing hit if it becomes necessary: It is necessary as the current situation is unmanageable.

Looking at it, I expect it wouldn't actually be very difficult to build a little runner binary out of the stablehlo interpreter and subprocess call that in order to get the testing coverage back. I leave that as an exercise to the users of this part of the stack and recommend following the breadcrumbs from the deleted python/torch_mlir_e2e_test/stablehlo_backends/linalg_on_tensors.py file and the main.py changes.

Note that I am pointing us at a stablehlo fork for the moment until it is apparent that we don't need to carry any local patches to it. We can update this in a few days if everything is clear.
2023-09-12 19:10:02 -07:00
Stella Laurenzo a00a0d4bfb
Integrate llvm-project and mlir-hlo. (#2454)
Corresponding commits:

* mlir-hlo: 16886a108eff5197f816ca0f1950cc5ff1b078d9
* stablehlo: 77a59815a82b34f7b08ed2d42a711d9920682d0e
* llvm-project: 4acc3ffbb0af5631bc7916aeff3570f448899647

* Adapt to ByteCodeOpInterface changes.
* Adapt to RegionBranchPoint changes: https://reviews.llvm.org/D159116
* Adapt inferReturnTypes to get the value from properties.
* Adapt invalid.mlir to properties syntax
* [TOSA] Align with custom assembly format change.
* [TOSA] handle change of axis to int32 type
* [TOSA] Restore improper convert to i32

Landing with Windows broken (it cannot be fixed because of the way the mlir-hlo dep is inserted). Will followup with an untangling.
---------

Co-authored-by: TatWai Chong <tatwai.chong@arm.com>
Co-authored-by: Eric Kunze <eric.kunze@arm.com>
2023-09-12 15:09:57 -07:00
Ramiro Leal-Cavazos 106b58597a
Revert "[MLIR][TORCH] Add E2E support for aten.empty_strided decomposition op (#2457)" (#2458)
This reverts commit 97bec86a8b.
2023-09-12 13:57:47 -07:00
Bruce Kim 97bec86a8b
[MLIR][TORCH] Add E2E support for aten.empty_strided decomposition op (#2457)
* implemented e2e test case, shape, dtype func

* AtenEmptyStrided decompose op implemented

* xfailed test module in ltc
2023-09-12 13:37:02 -07:00
Arham Khan 82456eefed
[MLIR][TORCH] add E2E support for aten.new_full (#2425)
* implement aten.new_full

* remove extraneous tests
2023-09-12 09:29:08 -05:00
Vivek Khandelwal 23b72244b1 [MLIR][TORCH] Add different dtype support for aten.bmm op
Signed-Off By: Vivek Khandelwal <vivek@nod-labs.com>
2023-09-12 12:38:46 +05:30
Vivek Khandelwal c1f379f3bf build: manually update PyTorch version
Set PyTorch and TorchVision version to nightly release 2023-09-11.

Signed-Off By: Vivek Khandelwal <vivek@nod-labs.com>
2023-09-12 12:38:37 +05:30
Yuanqiang Liu 5895b9f8ca
fix compile warning (#2453) 2023-09-12 09:31:47 +08:00
Yuanqiang Liu 1f20b7275d
[Torch Dialect] add canonicalize for aten.min.other (#2452) 2023-09-11 17:28:22 +08:00
Stella Laurenzo cc4a5d9f4b
update PyTorch version to 2.2.0.dev20230909 (#2450)
- torch version: 2.2.0.dev20230909
 - torch commit hash: 11d2c766f14dae98296056ee16827ffbd6a4d509
 - torchvision version: 0.17.0.dev20230909

Co-authored-by: Roll PyTorch Action <torch-mlir@users.noreply.github.com>
2023-09-09 08:00:39 -07:00
Stella Laurenzo 4dac1a551a
update PyTorch version to 2.2.0.dev20230908 (#2433)
- torch version: 2.2.0.dev20230908
 - torch commit hash: 806d1a871ddfd2d38e1791489892009feaec8425
 - torchvision version: 0.17.0.dev20230908

Co-authored-by: Roll PyTorch Action <torch-mlir@users.noreply.github.com>
2023-09-08 08:23:28 -07:00
powderluv cfd70dfb0d
Update merge-rollpytorch.yml with approved actors (#2446) 2023-09-08 05:00:09 -07:00
Bruce Kim 27b55b1d5f
implemented complex tensor aten mul (#2444) 2023-09-07 13:29:15 -07:00
Stella Laurenzo a8fd275a00 Fix build issue on MSVC by not having a conditional on disjoint types. 2023-09-06 20:05:31 -07:00
Vivek Khandelwal 67ae97f368 build: manually update PyTorch version
Set PyTorch and TorchVision version to nightly release 2023-09-06.

Signed-Off By: Vivek Khandelwal <vivek@nod-labs.com>
2023-09-06 22:36:55 +05:30
Jiawei Wu b411a40b3d
[Torch Dialect] emit aten.__or__Tensor Op (#2437)
* emit aten.__or__TensorOp

* bug fix

* remove convert to stablehlo

* code style refinement
2023-09-06 14:21:51 +08:00
Stella Laurenzo fcb3b718a5 Properly guard clang-specific pragma.
Avoids unsupported pragma warning on GCC.
2023-09-06 00:43:50 -07:00
Stella Laurenzo 29fdc3833c Fix GCC warning recommending parens.
Found with a more strict set of warning flags on GCC 9.
2023-09-06 00:23:23 -07:00
Jerin Philip 9cb5d38cd1
[MLIR][TORCH] Add E2E `torch.aten.prod_dim_int` (#2423)
Uses the existing reduction codepath, adding modifications or branches
required alongside for prod.
2023-09-05 13:38:51 -07:00
Jiawei Wu c93c6970e8
[stablehlo] add dtype conversion when converting AtenScalarImplicitOp (#2439) 2023-09-06 01:57:15 +08:00
Vivek Khandelwal 3841fe3035 [MLIR][TORCH] Add StableHLO lowering for embedding_bag.padding_idx op
Signed-Off By: Vivek Khandelwal <vivek@nod-labs.com>
2023-09-05 21:32:23 +05:30
Jiawei Wu d62045f64d
emit aten.max.other op (#2436) 2023-09-05 10:52:32 +08:00
Matthias Gehre a3ac4513e4
build_tools/python_deploy/build_linux_packages.sh: Disable dynamo testing for stable pytorch (#2426) 2023-09-04 10:02:07 +02:00