Commit Graph

1963 Commits (c76a48308e17dc6a91c9b07f0adc96053e411c44)
 

Author SHA1 Message Date
rahul shrivastava b0f166bb9a Add Nll_loss2d
- Add both forward and backward op
- Add end-to-end xfailed testcases

Signed-off-by: rahul shrivastava <rahul.shrivastava@cerebras.net>
2023-04-24 23:47:26 +05:30
rahul shrivastava 85916dab33 Add ODS for aten.scatter.src
Signed-off-by: rahul shrivastava <rahul.shrivastava@cerebras.net>
2023-04-24 23:46:35 +05:30
Sambhav Jain a3a62a9951
[Bazel] Add `@llvm_zstd` to WORKSPACE (#2049)
This un-breaks Bazel CI since b31c5fa1fb.

Manually triggered GHA: 
- https://github.com/sjain-stanford/torch-mlir/actions/runs/4764744603 (failed)
- https://github.com/sjain-stanford/torch-mlir/actions/runs/4769130681 (with buildifier fix)
2023-04-24 10:02:33 -07:00
Roll PyTorch Action 0bf31ae614 update PyTorch version to 2.1.0.dev20230424 2023-04-24 13:20:17 +00:00
Roll PyTorch Action f7a1a076fa update PyTorch version to 2.1.0.dev20230423 2023-04-23 13:18:31 +00:00
Roll PyTorch Action 9c6e706f8d update PyTorch version to 2.1.0.dev20230422 2023-04-22 13:20:47 +00:00
Roll PyTorch Action 56182e434a update PyTorch version to 2.1.0.dev20230421 2023-04-21 13:22:53 +00:00
Ramiro Leal-Cavazos 96d662647f
Fix import of constant bool tensor parameters (#2047)
Bool tensors are represented in TorchScript as an array of
`int8_t`s. However, when importing them into Torch-MLIR, the importer
was assuming the array had `int32_t` elements, leading to the importer
reading into memory that was out of bounds. This commit fixes the
casting of the bool tensor.
2023-04-20 18:38:48 -07:00
Roll PyTorch Action 97fbb6334b update PyTorch version to 2.1.0.dev20230420 2023-04-20 13:23:29 +00:00
Ramiro Leal-Cavazos f85f5799e4
Fix creation of empty tensor in decomposition for randn ops (#2043)
The current decomposition for `aten.randn.generator` does not specify
the `dtype` argument of the empty tensors created to store the random
values. This leads to invalid IR when the output type of the `randn`
op is not the default PyTorch dtype.
2023-04-19 08:25:39 -07:00
Roll PyTorch Action dbbcc4aaff update PyTorch version to 2.1.0.dev20230419 2023-04-19 13:21:44 +00:00
Chi_Liu 8d25dd454f
[TOSA] Add torch.prim.NumToTensor.Scalar float support (#1802) 2023-04-18 13:36:57 -07:00
Yuanqiang Liu 4d98f76d4f
[Torch Dialect] fold aten.detach (#2021) 2023-04-18 08:59:14 -07:00
Vivek Khandelwal b0f8572111 build: update llvm tag to 3abae1c8
Summary of changes:
- Update tags
  llvm: 3abae1c88416858cf2e9a7ed9417bc52033933b4
  mhlo: 70ebc73a28767b772e09e0dd03cf3e47457435a2
- Replace uses of `getDynOperands` utility with
  `createDynamicDimensions`.

Signed-Off By: Vivek Khandelwal <vivek@nod-labs.com>
2023-04-18 21:03:39 +05:30
Roll PyTorch Action c27182ef9c update PyTorch version to 2.1.0.dev20230418 2023-04-18 13:56:01 +00:00
Vivek Khandelwal ed56e614b7 [MLIR][TORCH] Add E2E support for cross entropy lowering
Signed-Off By: Vivek Khandelwal<vivek@nod-labs.com>
2023-04-18 08:00:20 +05:30
Roll PyTorch Action 6973abbfaa update PyTorch version to 2.1.0.dev20230417 2023-04-17 13:21:13 +00:00
Roll PyTorch Action 7e4d2bc51d update PyTorch version to 2.1.0.dev20230416 2023-04-16 13:19:23 +00:00
Roll PyTorch Action 273e75bb8a update PyTorch version to 2.1.0.dev20230415 2023-04-15 13:19:13 +00:00
Vivek Khandelwal b31c5fa1fb build: update llvm tag to 225d255a
Summary of changes:
- Update tags
  llvm: 225d255a583ea3d50bbba49d949ca76be6a880bf
  mhlo: beb5d2b04c33c19d23e02bd3c5e50ddecba11664

Fixes https://github.com/llvm/torch-mlir/issues/1859.

Signed-Off By: Vivek Khandelwal <vivek@nod-labs.com>
2023-04-15 06:27:10 +05:30
powderluv 0a3ab07c8f
Set fetch-depth 0 for CI builds too (#2034) 2023-04-14 11:36:41 -07:00
Roll PyTorch Action 811f330283 update PyTorch version to 2.1.0.dev20230414 2023-04-14 17:10:36 +00:00
Chi_Liu f3d1eda09f
[TOSA] Add aten.abs support (#2032) 2023-04-14 08:43:39 -07:00
Chi_Liu ad36e61040
[TOSA] Add aten.le.tensor support (#2033) 2023-04-14 08:43:14 -07:00
Abhishek Varma 318fe13468 [MLIR][TORCH] Patch up Ops and their lowerings to deal with +ve `dim`
-- In Python we have the concept of negative dimension indexing.
-- We would want to normalize such dimensions to be +ve and within the
   expected range instead.
-- This commit takes care of a few remaining set of Ops and their
   lowerings by applying `toPositiveDim` and `isValidDim` to the
   extracted integer `dim` value.

Signed-off-by: Abhishek Varma <abhishek@nod-labs.com>
2023-04-14 13:12:56 +05:30
Zhekun Zhang 1bd5747ca3
[StableHlo] Fix transposed convolution conversion (#2026)
* fix conv bwd

* fix

* fix group case

* clean up

---------

Co-authored-by: zhekun.zhang <zhekun.zhang@bytedance.com>
2023-04-13 11:24:39 -07:00
Abhishek Varma a13d301356 [MLIR][TORCH] Add e2e support for aten.sort op
-- This commit adds e2e support for atend.sort op.
-- 1. Adds aten.sort op in torch dialect.
-- 2. Adds tm_tensor.sort op in TMTensor dialect.
-- 3. Adds lowering of aten.sort -> tm_tensor.sort.

Signed-off-by: Abhishek Varma <abhishek@nod-labs.com>
2023-04-13 12:59:43 +05:30
rahuls-cerebras c2c96c430a
Add Shape inference for CopyOp for lazy tensor core backend (#2006)
- Add Shape inference for CopyOp for LTC backend
2023-04-12 09:37:03 -04:00
Alexandre Rames 224ee27610
Fix a few missing dependencies. (#2014)
`TorchToTMTensor` depends on `TorchMLIRTorchUtils` for
`mlir::torch::torch_upstream::get_reduction_enum`.

`TorchMLIRTorchConversionPasses` depends on multiple libs for both tblgen'd
headers and definitions. Test with `ninja TorchMLIRTorchConversionPasses` from
a clean build.
2023-04-11 11:18:49 -07:00
Yuanqiang Liu 72c3326097
[Torch Dialect] support for aten.one_hot (#1852) 2023-04-11 01:02:28 -07:00
Yuanqiang Liu 3e83a86354
[Torch Dialect] fix isValidSubtype with dynamic dim (#2018) 2023-04-11 01:02:18 -07:00
Vivek Khandelwal 98747d09a8 [MLIR][TORCH] Add support for prims::view_of op
This op does nothing and just returns the input operand as the
result of the op.

Signed-Off By: Vivek Khandelwal <vivek@nod-labs.com>
2023-04-11 07:58:10 +05:30
Vivek Khandelwal 7ae354340d build: manually update PyTorch version
Set PyTorch and TorchVision version to nightly release 2023-04-09.

Signed-Off By: Vivek Khandelwal <vivek@nod-labs.com>
2023-04-10 17:13:53 +05:30
Chi_Liu 975815216f
[TOSA] Add todtype f32 to i64 (#2012) 2023-04-07 09:40:56 -07:00
Chi_Liu 4df1d8ae2f
[MLIR] Fold aten select and fill_ pattern (#2000) 2023-04-06 21:16:51 -07:00
Chi_Liu 8dcd0b2e76
[TOSA] Add support for sliceOp end < 0 (#2011) 2023-04-06 16:19:00 -07:00
powderluv 6cab740603
Set fetch-depth 0 (#2009)
This is to potentially workaround the index.lock issue in git when we checkout new depth 1 submodules of recently updated mhlo.
2023-04-06 14:29:59 -07:00
Abhishek Varma 5337944ddb [MLIR][TORCH] Add e2e support for aten.randint
-- This commit adds e2e support for aten.randint by decomposing it into
   an aten.randint.low by setting low=0.

Signed-off-by: Abhishek Varma <abhishek@nod-labs.com>
2023-04-07 00:13:56 +05:30
powderluv 0497f0b08d
Revert "CI: drop deletion of workspace and limit submodule fetch concurrency (#1921)" (#2007)
This reverts commit 07f5f042c7.
2023-04-06 10:36:30 -07:00
Vivek Khandelwal 2213ce0855 [TorchDynamo] Add aten.squeeze op to the decomposition list
Signed-Off By: Vivek Khandelwal <vivek@nod-labs.com>
2023-04-06 22:21:25 +05:30
Vivek Khandelwal e90ea3d7ab [MLIR][TORCH] Extend implementation of aten._index_put_impl op.
This commits adds the support for cases for index_put_op:
1.) where index is a 2-d tensor.
2.) where indices is a list of tensors and none, with exactly
2 non none tensors along the consecutive dimensions.

This commit also adds a utility to compute the broadcast shape
given the two input tensors.

Signed-Off By: Vivek Khandelwal <vivek@nod-labs.com>
2023-04-05 14:04:30 +05:30
Ashay Rane 07f5f042c7
CI: drop deletion of workspace and limit submodule fetch concurrency (#1921)
Despite using sudo to delete the workspace directory, we still
occasionally run into checkout errors.  This patch thus drops the
deletion of the workspace prior to checkout.  It also restricts the
number of parallel jobs in the submodule fetch step to just one, to try
and resolve the checkout issue ("index.lock: File exists.").
2023-04-04 12:58:52 -05:00
Alexandre Rames d24fa71368
Minor fixes for `ConvertTorchConversionToMLProgram`. (#1991)
* Only create the global seed variable if it does not exist already.
* Make the pass a module pass. A func pass may not modify its parent op.
2023-04-04 09:09:58 -07:00
Vivek Khandelwal e7d4771403
build: manually update PyTorch version (#1998)
Set PyTorch and TorchVision version to nightly release 2023-04-03.

Signed-Off By: Vivek Khandelwal <vivek@nod-labs.com>
2023-04-04 06:51:26 -07:00
Vivek Khandelwal 788efc3180 [MLIR][TORCH] Add support for non-unit stride for conv backward
This commit also adds the support for non-unit output padding in the
case of transposed convolution.

Signed-Off By: Vivek Khandelwal<vivek@nod-labs.com>
2023-04-04 17:53:27 +05:30
Vivek Khandelwal 5e9582b055 [MLIR][TORCH] Add e2e support aten.movedim.int op
Signed-Off By: Vivek Khandelwal<vivek@nod-labs.com>
2023-04-04 17:53:27 +05:30
powderluv f83c516b15
Update RollPyTorch.yml to use Pytorch 3.11 (#1999) 2023-04-03 23:53:26 -07:00
Yuanqiang Liu c86f46bd70
[test] rename TorchToMhlo to TorchToStablehlo (#1995) 2023-04-03 18:41:25 -07:00
Vivek Khandelwal 0426942fa2
build: manually update PyTorch version (#1994)
Set PyTorch and TorchVision version to nightly release 2023-04-02.

Signed-Off By: Vivek Khandelwal <vivek@nod-labs.com>
2023-04-02 10:30:35 -07:00
Vivek Khandelwal 3451dd32a7 build: manually update PyTorch version
Set PyTorch and TorchVision version to nightly release 2023-04-01.

Signed-Off By: Vivek Khandelwal <vivek@nod-labs.com>
2023-04-01 21:45:58 +05:30