Commit Graph

1756 Commits (95361747c2c350886d192261667bfc57d870971d)
 

Author SHA1 Message Date
Ashay Rane 4e4a571104
[TOSA] Add LeakyReLU conversion pass (#1790)
* feat(TorchToTOSA): LeakyReLU legalization

* test(LeakyReLU): Add LIT test and enable e2e test

Co-authored-by: Philipp Braun <philipp.braun@amd.com>
2023-01-10 21:42:07 -08:00
Ashay Rane 0faba6d2fc
build: update llvm tag to de3f0f7f (#1789)
Credit to @vivekkhandelwal1 for finding the necessary changes.

Summary of changes:

 - Switch Tosa_IntArrayAttr[N], Tosa_IntArrayAttrUpto[N] to DenseI64ArrayAttr.

 - Replace kNoIterationLimit with kNoLimit. (https://reviews.llvm.org/D140525)

 - Add dependency on MhloPasses when MHLO is enabled

 - Specify result type when using mhlo::DotOp
2023-01-10 17:07:19 -06:00
Raghavan Raman 0979df6589
Fix unsqueeze in Torch to Tosa conversion (#1780) 2023-01-10 11:09:58 -08:00
Gleb Kazantaev c8b867b876
Added support for aten::norm.ScalarOpt_dim (#1774)
* Added support for aten::norm.ScalarOpt_dim

* Disable NormalizeModule_basic for linalg
2023-01-10 13:08:25 -05:00
Ashay Rane a897c49803
CI: miscellaneous fixes for Release builds (#1781)
- Use v3 of actions/checkout, since the version we use (v2) uses
   Node.js 12, which is deprecated by GitHub.

 - Source the PowerShell venv sctipt (instead of the bash sript) since
   the calling script is a PowerShell script.  Without this, the build
   doesn't use venv at all.

 - Make the build dependencies in whl-requirements.txt (used by
   setup.py) match those in requirements.txt.  To that end, this patch
   creates a build-requirements.txt that is referenced by
   requirements.txt and whl-requirements.txt.
2023-01-06 20:41:43 -06:00
Gleb Kazantaev 8f01072099
Fix OptionalCType class name (#1779)
* Fix OptionalCType class name

* Rmove LTC xfail tests
2023-01-06 17:03:24 -05:00
Roll PyTorch Action 1f2946a5a7 update PyTorch version to 2.0.0.dev20230106 2023-01-06 14:41:18 +00:00
Roll PyTorch Action 98cb12e3e5 update PyTorch version to 2.0.0.dev20230105 2023-01-05 14:28:36 +00:00
Roll PyTorch Action 5351db0e99 update PyTorch version to 2.0.0.dev20230104 2023-01-04 16:38:47 +00:00
Ashay Rane 6e0b5b9ba7 build: match windows CI and Release build steps
After a recent LLVM tag update, the Windows Release build failed even
though pre- and post-merge Windows CI builds passed.  This patch makes
the Windows Release build use the same flags as the Window CI build to
try and address the Release build failures in the future.
2023-01-04 14:29:17 +05:30
Jiahao Li 8dc5d985eb
Add e2e support for aten logical or/and/xor/not ops (#1761) 2023-01-03 18:11:25 -08:00
Ramiro Leal-Cavazos d44bdd2728
Add `hasDtype` checks everywhere dtypes are used in decompositions (#1750)
There are several decompositions that assume the operands of the op
have dtypes available; however, the only time dtypes are guaranteed to
be present is when the graph has reached the backend contract. In
general, every pass that happens before reaching the backend contract
should not assume dtypes are available and should use `hasDtype` to
check first.

This commit adds `hasDtype` checks to every decomposition that uses
dtypes.
2023-01-03 14:19:18 -08:00
Ramiro Leal-Cavazos 273664ded6
[custom op] Replace `tanh` dtype function with `expm1` (#1769)
This commit replaces the `tanh` dtype function, which was being used
to test the implementation of dtype functions in
a710237437, with a dtype function for
`expm1`. The dtype function for `expm1` is identical to the `tanh`
one, so the same level of testing is maintained.

Currently, there are ops getting dtype information from the
`RefineTypes` pass and ops getting dtype information from the
`TorchDtypeRefinementPipeline`. Since each pass can only propagete
dtype information for the ops it knows how to handle, some models with
many ops handled in both passes require the two dtype propagation
passes to execute many times, reaching the iteration limit set in the
`LowerToBackendContractPass`. To temporarily avoid this issue while
the migration to `TorchDtypeRefinementPipeline` is finished, this
commit switches `tanh` to `expm1`, since the latter is used a lot less
in large models.
2023-01-03 14:18:26 -08:00
Srirammaswamy a88e3766e8
Add E2E support for LeakyRelu and LeakyReluBackward ops (#1733)
Co-authored-by: srirammaswamy <srirammaswamy@gmail.com>
2023-01-03 08:30:16 -08:00
Roll PyTorch Action 324ccccc2d update PyTorch version to 2.0.0.dev20230103 2023-01-03 14:27:40 +00:00
Roll PyTorch Action 818f5dc3ad update PyTorch version to 2.0.0.dev20230102 2023-01-02 14:26:23 +00:00
powderluv 3d50d3d9fe
Revert "rebase llvm: 5f24f893cac7aaea292c70f8aa83b021499114be (#1760)" (#1765)
This reverts commit fa356cce50.
2023-01-01 10:56:06 -08:00
Roll PyTorch Action cfad718a86 update PyTorch version to 2.0.0.dev20230101 2023-01-01 14:27:33 +00:00
Roll PyTorch Action 9e71d271f6 update PyTorch version to 2.0.0.dev20221231 2023-01-01 09:33:45 +00:00
powderluv b2dbbba5e6
xfail ElementwisePreluModule_basic in dynamo (#1763) 2022-12-31 13:54:25 -08:00
Xiafei Qiu fa356cce50
rebase llvm: 5f24f893cac7aaea292c70f8aa83b021499114be (#1760) 2022-12-31 00:07:54 +08:00
Roll PyTorch Action 867fade9c5 update PyTorch version to 2.0.0.dev20221230 2022-12-30 14:36:33 +00:00
powderluv 4dbdc179b7
Bump to Python 3.8 (#1756) 2022-12-29 19:04:54 -08:00
Ashay Rane ac780529b4
Revert e2e support for aten logical or/and/xor/not ops (#1757)
This reverts commit eaab9be207, since it
is causing the post-merge CI tests to fail, causing subsequent PRs to be
blocked.  Specifically, the tests
`ElementwiseAtenLogicalAndOpPromoteBroadcastModule_basic` and
`ElementwiseAtenLogicalXorOpPromoteBroadcastModule_basic` fail because
the oracle does not match the computed result.  This patch reverts the
commit to make the post-merge builds green again.
2022-12-29 21:01:06 -06:00
Roll PyTorch Action f0998f92df update PyTorch version to 2.0.0.dev20221229 2022-12-29 14:39:28 +00:00
Roll PyTorch Action 49274dc3db update PyTorch version to 2.0.0.dev20221228 2022-12-28 15:03:28 +00:00
Shivam Gupta 2f45959f0d
Prelu lowering to linalg (#1712)
Prelu lowering to linalg
2022-12-28 08:51:33 +05:30
Roll PyTorch Action ff9523d2b6 update PyTorch version to 2.0.0.dev20221227 2022-12-27 14:29:41 +00:00
Roll PyTorch Action 6bd6a79e23 update PyTorch version to 2.0.0.dev20221226 2022-12-26 14:34:40 +00:00
Jiahao Li eaab9be207
Add e2e support for aten logical or/and/xor/not ops (#1752) 2022-12-26 10:23:38 +08:00
Roll PyTorch Action 86d25e310b update PyTorch version to 2.0.0.dev20221225 2022-12-25 14:19:22 +00:00
Roll PyTorch Action 7362f80558 update PyTorch version to 2.0.0.dev20221224 2022-12-24 14:54:07 +00:00
Roll PyTorch Action bcfb1d10b1 update PyTorch version to 2.0.0.dev20221223 2022-12-23 14:35:08 +00:00
Ramiro Leal-Cavazos 3260a1ea6e
Allow passing traced `torch.nn.Module`s into `torch_mlir.compile` (#1743)
This commit adds support for passing to `torch_mlir.compile` the
result of running `torch.jit.trace` on a model by relaxing the
condition that checks if the model is already in JIT IR to allow any
`torch.jit.ScriptModule`.

Fixes https://github.com/llvm/torch-mlir/issues/1739
2022-12-22 08:39:55 -08:00
Roll PyTorch Action 52669cbbd5 update PyTorch version to 2.0.0.dev20221222 2022-12-22 14:36:49 +00:00
Jiahao Li 49071f86e6
[MHLO] Evaluate RuntimeAssertOp at compile time (#1732) 2022-12-22 17:12:52 +08:00
Vivek Khandelwal ddbcf569e0 [Bazel] Fix Bazel build
Signed-Off By: Vivek Khandelwal<vivek@nod-labs.com>
2022-12-22 12:22:33 +05:30
Tanyo Kwok 297fd3aa47
Revert "reimplement linear lowering torchToMhlo (#1524)" (#1744)
This reverts commit 50b524546f.
2022-12-21 21:24:07 -08:00
Jiahao Li 60a139271d
Add aten.std.correction op and its decomposition (#1731) 2022-12-21 21:02:40 -08:00
zzp_miracle 50b524546f
reimplement linear lowering torchToMhlo (#1524) 2022-12-22 10:15:16 +08:00
Jiahao Li 15b249777b
[Torch][MHLO] Decompose aten.copy op. Lower aten.rsqrt & sigmoid to mhlo. (#1734) 2022-12-22 10:13:59 +08:00
Chi_Liu 9dc09ac8c5
[TOSA] Add aten.gather support for tosa (#1680) 2022-12-21 11:04:07 -08:00
Chi_Liu b2cefc0b64
[TOSA] Add aten.masked_fill.Tensor/Scalar support (#1735) 2022-12-21 08:56:07 -08:00
Roll PyTorch Action 810473cc03 update PyTorch version to 2.0.0.dev20221221 2022-12-21 16:24:41 +00:00
pranavmulticore 0f6008c802
Added GeluBackward: MHLO support (#1725) 2022-12-21 20:09:43 +08:00
Jae Hoon (Antonio) Kim 1d695239ff
Unrevert #1724 (#1737)
* Unrevert #1724

* Update pytorch requirements.txt
2022-12-20 11:17:21 -05:00
Abhishek Varma 66d7a412cb [RefineTypes] Fix knowledge dtype for `aten.embedding` op
-- The dtype of the result of `aten.embedding` should match that of
   the `weight` operand's (operand[0]) instead of hardcoding to f32.
-- This commit aims to provide a fix for the same.

Signed-off-by: Abhishek Varma <abhishek@nod-labs.com>
2022-12-20 19:56:12 +05:30
Tanyo Kwok 577e38da58
build: update llvm tag to 7ccbb4df (#1736)
Summary of changes:

 - LLVM now includes <optional> instead of "llvm/ADT/Optional.h" in most
   (although not all) places
   (https://reviews.llvm.org/rG541ef3d61e9341cd38420c0dbca9250c4d0ea04c).
   This patch replaces the affected instances of `llvm::Optional` with
   `std::optional`.

 - In the usages of llvm::Optional that remain, llvm::Optional::value()
   is deprecated, so this patch replaces them with a dereference.
2022-12-20 18:17:27 +08:00
Ashay Rane f6b6069a34
ci: post comment on RollPyTorch tracker issue upon build failure (#1730)
Now that the RollPyTorch tracker issue exists, we can automate the job
of notifying folks of failures instead of having to do it manually.
This patch adds a step to the workflow to post such a message.
2022-12-18 13:45:30 -06:00
Roll PyTorch Action 335cfe9134 update PyTorch version to 2.0.0.dev20221217 2022-12-17 14:40:50 +00:00