Commit Graph

2663 Commits (b98f7f75dc944e3269b4922fa9186f4cf3e7e55a)
 

Author SHA1 Message Date
Yuanqiang Liu faec8698ea
[Torch Dialect] Support recompose aten.split.Tensor + prim.ListUnpack (#2192) 2023-06-07 01:38:04 +08:00
Roll PyTorch Action e29c5e8003 update PyTorch version to 2.1.0.dev20230606
- torch version: 2.1.0.dev20230606
 - torch commit hash: 4d648e450b8e1386c0079f22c38aebc14fb93872
 - torchvision version: 0.16.0.dev20230606
2023-06-06 19:11:12 +05:30
Vivek Khandelwal da886280fe
[MLIR][TORCH] Add E2E support for aten.tril op (#2202)
Signed-Off By: Vivek Khandelwal <vivek@nod-labs.com>
2023-06-05 16:17:01 -07:00
Ashay Rane 173050ec8a
CI: Fix yaml syntax in merge-rollpytorch.yml (#2201)
This patch fixes the indentation in the yaml file.
2023-06-05 09:43:00 -05:00
Sean Silva c732b7031e
update PyTorch version to 2.1.0.dev20230605 (#2199)
- torch version: 2.1.0.dev20230605
 - torch commit hash: 7a5da818220cc4c950128db5ea65ec98dece559e
 - torchvision version: 0.16.0.dev20230605

Co-authored-by: Roll PyTorch Action <torch-mlir@users.noreply.github.com>
2023-06-05 08:48:52 -05:00
Ashay Rane c804dac925
CI: Introduce workflow to auto-merge RollPyTorch updates (#2196)
This patch adds a new workflow that runs when an update to the
rollpytorch branch by silvasean (in whose name the RollPyTorch action
runs) causes the regular CI build to complete without errors.  Upon
execution, this workflow currently just prints the PR number(s) of the
PR created by the RollPyTorch action, but once this is working as
expected, we will add the step to merge the PR changes.
2023-06-05 08:48:20 -05:00
Sean Silva 75bc6cb119
update PyTorch version to 2.1.0.dev20230604 (#2195)
- torch version: 2.1.0.dev20230604
 - torch commit hash: 810edae5137bdc0cd25ac2f133d6633d6146b1e9
 - torchvision version: 0.16.0.dev20230604

Co-authored-by: Roll PyTorch Action <torch-mlir@users.noreply.github.com>
2023-06-04 09:29:15 -05:00
Sean Silva 4f323ec352
update PyTorch version to 2.1.0.dev20230603 (#2193)
- torch version: 2.1.0.dev20230603
 - torch commit hash: 7726721661ea114acb81a860519d0a1501d88fca
 - torchvision version: 0.16.0.dev20230603

Co-authored-by: Roll PyTorch Action <torch-mlir@users.noreply.github.com>
2023-06-03 09:27:10 -05:00
Sean Silva 4659c6c8f0
update PyTorch version to 2.1.0.dev20230602 (#2191)
- torch version: 2.1.0.dev20230602
 - torch commit hash: 52c7a761c5cb6ae94acf2298827309fba3dbc0f4
 - torchvision version: 0.16.0.dev20230602

Co-authored-by: Roll PyTorch Action <torch-mlir@users.noreply.github.com>
2023-06-02 09:18:26 -05:00
Ashay Rane 755d0c46da
CI: Spot fixes related to nightly and stable PyTorch builds (#2190)
* CI: Skip (redundant) libtorch build when using stable PyTorch version

When we use PyTorch stable builds, there is no need to build libtorch
from source, making the stable-pytorch-with-torch-binary-OFF
configuration redundant with stable-pytorch-with-torch-binary-ON.  This
patch drops the redundant configuration from CI.

* CI: Simplify guard conditions for creating and using libtorch cache

Whether libtorch is enabled or not is predicated on a host of conditions
such as the platform, in-tree versus out-of-tree build, and stable
versus nightly PyTorch builds.  Instead of repeating these conditions to
guard whether to create or use the libtorch cache artifacts (and getting
them almost incorrect), this patch predicates the relevant pipeline
steps to whether libtorch is enabled, thus making the conditions far
simpler.
2023-06-01 22:58:25 -07:00
Ramiro Leal-Cavazos a46b5c6af2 Fix types + off-by-1 error, clamp `end` in slice+copy_ recomposition
The `copy_` op being replaced by `RecomposeSliceCopy_` operates on a
subset of the tensor being mutated, while the `index_put` op being
used to replace the `copy_` op operates on the entire tensor being
mutated. This means that the result type of the `index_put` should be
the type of the input to `index_put` and we need to make sure that
`copy_` does not have users before replacing to avoid type conflicts.

This commit also fixes the result type used for the
`AtenArangeStartStepOp`, and an off-by-1 error when creating the
indices vector.

Lastly, this commit also clamps the `end` value from the slice to the
size of the dimension.
2023-06-01 11:14:53 -07:00
Ramiro Leal-Cavazos 281dccc681 [LINALG] Add dynamic support for `PrimMinIntOp` 2023-06-01 11:14:53 -07:00
Sean Silva 1eb992876c
update PyTorch version to 2.1.0.dev20230601 (#2189) 2023-06-01 07:46:03 -07:00
Zhekun Zhang 8af3e50662
[Torch Dialect] Add support for AtenScalarTensorOp (#2085)
* add scalar_tensor op

* add dynamo pass test; needs PR2062

* try to fix

* Empty commit, trigger test

* Empty commit, trigger test

* address comments

* use dtype function

* fix decompose rule

* remove unused include

* Empty commit, trigger test

* fix test

* disable ltc

* fix dtype

---------

Co-authored-by: zhekun.zhang <zhekun.zhang@bytedance.com>
2023-06-01 11:38:50 +08:00
Sean Silva 7ab16d38cf
update PyTorch version to 2.1.0.dev20230531 (#2188)
- torch version: 2.1.0.dev20230531
 - torch commit hash: 48552338649ccc467060f5f93dbe19e2acbc4d1a
 - torchvision version: 0.16.0.dev20230531

Co-authored-by: Roll PyTorch Action <torch-mlir@users.noreply.github.com>
2023-05-31 10:51:17 -07:00
Yuanqiang Liu 72b8070e57
[Importer] import constant tuple (#2132)
* [Importer] import constant tuple

* update

* update

* update
2023-05-31 14:14:14 +08:00
Ramiro Leal-Cavazos 479b2175ef
Add `ReadOnly` trait to `copy.to_vtensor` (#2179)
Before inlining a global slot, the users of the global slot are
checked to see if they are `ReadOnly` or `MemoryEffectFree` to make
sure that the global slot is not being mutated. Because the op
`copy.to_vtensor` currently does not have the `ReadOnly` trait, if a
global slot is passed to `copy.to_vtensor`, the pass
`InlineGlobalSlots` will fail.

The op `copy.to_vtensor` is `ReadOnly`, since it does not modify the
contents of the input tensor; it simply makes a new copy. This commit
adds the trait as well as an e2e test that generates the case of a
global slot being passed to a `copy.to_vtensor`.
2023-05-30 21:40:36 +00:00
maxbartel db3f2e3fde
Add Stable PyTorch CI Pipeline (#2038)
* feat: split pytorch requirements into stable and nightly

* fix: add true to tests to see full output

* refactor: add comments to explain true statement

* feat: move some tests to experimental mode

* refactor: refactor pipeline into more fine grained difference

* feat: add version differentiation for some tests

* feat: activate more configs

* refactor: change implementation to use less requirement files

* refactor: remove contraints used for testing

* fix: revert some requirement file names

* refactor: remove unnecessary ninja install

* fix: fix version parsing

* refactor: remove dependency on torchvision in main requirements file

* refactor: remove index url

* style: remove unnecesary line switch

* fix: readd index url
2023-05-30 12:16:24 -07:00
Vivek Khandelwal 959f4f48d5 [MLIR][TORCH] Add support for the total_weight for aten.nll_loss_forward op
Signed-Off By: Vivek Khandelwal <vivek@nod-labs.com>
2023-05-30 20:29:27 +05:30
Gaurav Shukla 552887783a [TM_TENSOR] Add `aten.scatter.[src|value]` op
This commit adds support of `aten.scatter.src` and `aten.scatter.value`
ops.

Signed-Off-by: Gaurav Shukla <gaurav@nod-labs.com>
2023-05-29 12:35:53 +05:30
George Petterson b9d29dc055 Add correct type checking for tm_tensor.attention 2023-05-27 05:51:14 +05:30
Yuanqiang Liu 5223f990df
[Stablehlo] Enable Stablehlo backend with arith dialect (#2139) 2023-05-26 22:57:57 +08:00
Sean Silva 4216c7d622
update PyTorch version to 2.1.0.dev20230526 (#2175)
- torch version: 2.1.0.dev20230526
 - torch commit hash: 10b46f7c7f69f9bf705d2b6ea53efb9c59145685
 - torchvision version: 0.16.0.dev20230526

Co-authored-by: Roll PyTorch Action <torch-mlir@users.noreply.github.com>
2023-05-26 09:10:20 -05:00
powderluv 2f02ae1ebe
Delete another spurious pip (#2173) 2023-05-26 00:02:21 -07:00
powderluv 9b7909b599
Add ARM64 release builds (#2159)
Creates a build_linux_arm64 job that builds the release on an arm64 self-hosted runner.
Drop Python 3.10 support
Pass  TM_TORCH_VERSION to choose the Stable PyTorch version (since arm64 doesn't have nightly builds)

Borrows nightly / stable Pytorch switch from the WIP
https://github.com/llvm/torch-mlir/pull/2038
2023-05-25 20:39:19 -07:00
Zhekun Zhang 69e993b03f
[Torch Op] Add AtenChunkOp support (#2152)
* add chunkOp support

* update LTC xfail list

* address comments

* address comments

---------

Co-authored-by: zhekun.zhang <zhekun.zhang@bytedance.com>
2023-05-26 10:05:19 +08:00
powderluv f5e0287aaa
Remove spurious pip in Release builds (#2172)
(left over from a previous commit that was approved and landed in a branch on accident)
2023-05-25 18:59:21 -07:00
powderluv 0cdc03d8fe
only setup python for non-docker platforms (#2171)
Original PR was accidentally merged to a branch. Re-landing same PR to main now
2023-05-25 16:27:06 -07:00
Ramiro Leal-Cavazos dff3405d5a
Add alias analysis for cast-like ops to maximize-value-semantics (#2160)
When `use_tracing=True` is used to import a model into Torch-MLIR,
several casts get inserted in the IR to bridge the untyped inputs and
outputs with the typed body of the computation. These casts create
extra aliases of tensors that cause the current analysis in
`maximize-value-semantics` to fail.

In particular, the `maximize-value-semantics` analysis assumes that the
only valid alias right after an overwrite is the overwritten
alias. So, if there is a use of a casted version of the overwritten
alias after the overwrite, the analysis fails.

This commit improves the analysis by identifying all cast-like aliases
of the overwritten alias and allowing such aliases to be used after an
overwrite.

Because this issue only arises when using tracing, it cannot be
currently tested e2e, so only lit test is added.
2023-05-25 17:05:41 +00:00
Ashay Rane 9f65a8a961
CI: disable caching for release builds (#2168)
This patch adds a (default-true) input called `cache-enabled` to the
setup-build action, so that when the input is false, ccache is not setup
on the host machine.  This patch also sets the input to be false for the
release builds.
2023-05-25 11:01:46 -05:00
Sean Silva 56b8dd1b49
update PyTorch version to 2.1.0.dev20230525 (#2167)
- torch version: 2.1.0.dev20230525
 - torch commit hash: eb2ef134b4e834a9b8a8b6de86ddd7d2780ce0ac
 - torchvision version: 0.16.0.dev20230525

Co-authored-by: Roll PyTorch Action <torch-mlir@users.noreply.github.com>
2023-05-25 09:37:37 -05:00
Zhekun Zhang f0b7b63be0
[Stablehlo] Add aten.uniform lowering (#2101)
* add uniform stablehlo lowering

* add unit test

* new line

* rm redundant file

* Empty commit, trigger test

* fix include

* address comments

---------

Co-authored-by: zhekun.zhang <zhekun.zhang@bytedance.com>
2023-05-25 10:32:55 +08:00
powderluv b9b3af8003
[arm64] Fix release builds for ARM64 (#2157)
Tested on Ubuntu 23.04 on Ampere Altra instance.
2023-05-24 13:52:13 -07:00
Zhekun Zhang eb8f56aeb7
[Stablehlo] Add `AtenIndexTensor` StableHlo support (#2107)
* Add AtenIndexTensor StableHlo support

* clean up

* Empty commit, trigger test

* try to debug hanging test

* fix segfulat

* fix bad include

---------

Co-authored-by: zhekun.zhang <zhekun.zhang@bytedance.com>
2023-05-24 11:13:57 -07:00
Zhekun Zhang a426363b7d
[Torch Dialect] Add split.tensor support + recompose rules (#2102)
* add split.tensor support + recompose rules

* add e2e test

* address comments

* address comments

* erase op in recomposeOp

---------

Co-authored-by: zhekun.zhang <zhekun.zhang@bytedance.com>
2023-05-23 12:43:33 -07:00
Sean Silva 080fad7c07
update PyTorch version to 2.1.0.dev20230523 (#2148)
- torch version: 2.1.0.dev20230523
 - torch commit hash: 981d4c2578d10d8a96d173471802fc2812541fb1
 - torchvision version: 0.16.0.dev20230523

Co-authored-by: Roll PyTorch Action <torch-mlir@users.noreply.github.com>
2023-05-23 10:36:07 -05:00
Prateek Gupta 938a489e74 [TORCH-MLIR] Add ODS for aten.sign op.
This commit adds ODS for the aten.sign op.

Signed-Off-By: Prateek Gupta <prateek.gupta2@cerebras.net>
2023-05-23 11:06:42 +05:30
Zhekun Zhang 5b63138d55
[Torch Dialect] Enforce signless attribute for ConstantIntOp (#2078)
* fix torch_c.to_i64

* restore dialect.cpp

* Empty commit, trigger test

* Empty commit, trigger test

* fix uint case

* address comments

* update error msg

* clean up

* use i64 for ConstantIntOp

* use I64Attr

---------

Co-authored-by: zhekun.zhang <zhekun.zhang@bytedance.com>
2023-05-22 19:21:34 -05:00
Ramiro Leal-Cavazos 588bdc1344
Fix sign-compare warning (#2136) 2023-05-22 09:15:33 -07:00
Sean Silva b407b4f1f3
update PyTorch version to 2.1.0.dev20230522 (#2145)
- torch version: 2.1.0.dev20230522
 - torch commit hash: 871fc7bb76f05c3c487214404f687cf7a6a8e453
 - torchvision version: 0.16.0.dev20230522

Co-authored-by: Roll PyTorch Action <torch-mlir@users.noreply.github.com>
2023-05-22 08:58:09 -05:00
Sean Silva 7094dae4fe
update PyTorch version to 2.1.0.dev20230521 (#2142) 2023-05-21 06:50:52 -07:00
Ashay Rane 558f12f05c
CI: Use GitHub app token for creating PRs (#2137)
Since PRs created by the GitHub action bot cannot trigger workflows (and
thus build tests), this patch uses the token for a GitHub app that was
specifically created for the RollPyTorch action.
2023-05-19 23:18:03 -05:00
github-actions[bot] 96327f5997
update PyTorch version to 2.1.0.dev20230519 (#2134)
- torch version: 2.1.0.dev20230519
 - torch commit hash: 61239df555df02e8c60a2ad63363878a2a57c161
 - torchvision version: 0.16.0.dev20230519

Co-authored-by: Roll PyTorch Action <torch-mlir@users.noreply.github.com>
2023-05-19 12:11:24 -05:00
Zhekun Zhang aa97c8383e
[Torch Op] Add unbind.int support with ListUnpack (#2058)
* add unbind int

* reformat

* use unpack canonicalize

* address comments

* Empty commit, trigger test

* add ltc blacklist

* clean up

* address comments

* check permute list

* erase in recompose

---------

Co-authored-by: zhekun.zhang <zhekun.zhang@bytedance.com>
2023-05-18 19:07:58 -07:00
Zhekun Zhang 1333674905
[StableHlo] Support AtenEmptyMemoryFormatOp (#2092)
* add empty conversion

* clean up

* add tests

---------

Co-authored-by: zhekun.zhang <zhekun.zhang@bytedance.com>
2023-05-18 19:07:35 -07:00
TatWai Chong ed4ecb072f
[tosa] support lowering basic torch binary ops with mixed dtypes (#2122)
Lowering torch operations that allow different compatible data types
in its operands to tosa end up generating invalid tosa IR with mixed
data types. In tosa spec, certain operations (generally element-wise
operations) require all operands to have the same data type.

Add wrapper functions for those element-wise tosa ops to perform op
creation with type conversion if necessary.
2023-05-18 17:12:18 -07:00
Vivek Khandelwal 5698893ae4 build: manually update PyTorch version
Set PyTorch and TorchVision version to nightly release 2023-05-16.

Signed-Off By: Vivek Khandelwal <vivek@nod-labs.com>
2023-05-18 21:30:11 +05:30
Yuanqiang Liu 6f7d9e83df
[Stablehlo] add e2e test for aten.batch_norm (#2129) 2023-05-17 09:04:40 -07:00
Yuanqiang Liu e98f2ba04a
[Torch Dialect] require dtype exists when decompose to aten.where.self (#2094)
* [Torch Dialect] require dtype exists when decompose to aten.where.self

* update
2023-05-17 09:04:26 -07:00
gpetters94 0302cf1d92
Add TMTensor::Attention and lower ScaledDotProductAttentionOp to it (#2027) 2023-05-16 15:17:45 -04:00