Commit Graph

2296 Commits (b20daf5710f96dee080f7b9a6e26cec064e13c83)
 

Author SHA1 Message Date
Stella Laurenzo b20daf5710
update PyTorch version to 2.2.0.dev20231110 (#2566)
torch version: 2.2.0.dev20231110
torch commit hash: edbf22fa03bafd1d2849ba41db75a2bea172dbcc
torchvision version: 0.17.0.dev20231110

Co-authored-by: Roll PyTorch Action <torch-mlir@users.noreply.github.com>
2023-11-10 06:23:58 -08:00
James Newling 98ee7fe548 Update E2E links 2023-11-09 13:55:37 -06:00
Ramiro Leal-Cavazos d082310bd8 Move Wiki to `docs/`
Currently the docs are split into two places, the `docs/` directory
and the Github Wiki of Torch-MLIR. This commit moves the wiki docs to
`docs/` to consolidate everything into one place. This has the added
benefit that users will get all the documentation when they clone the
repository.

Note: there are 4 files in the wiki, but only one is truly needed
- Torch-ops-E2E-implementation.md: only file needed
- Coding-Style.md: the contents of this file are already in
Torch-ops-E2E-implementation.md
- Weekly-LLVM-Update.md: this is outdated. We no longer have a weekly
schedule for llvm updates
- Home.md: Contains links to talks and resources that are already
present in the documentation in `docs/` or in
Torch-ops-E2E-implementation.md

Co-authored-by: Yi Zhang <cathyzhyi@google.com>
Co-authored-by: Ashay Rane <ashay@users.noreply.github.com>
Co-authored-by: Sean Silva <silvasean@google.com>
Co-authored-by: Daniel Ellis <1346302+dellis23@users.noreply.github.com>
Co-authored-by: Vivek Khandelwal <vivekkhandelwal1424@gmail.com>
2023-11-09 13:55:37 -06:00
Stella Laurenzo a7b5dfb389
update PyTorch version to 2.2.0.dev20231109 (#2564)
torch version: 2.2.0.dev20231109
torch commit hash: 2c3ba6926e38dba05bda34f0af9c092a40cff5b7
torchvision version: 0.17.0.dev20231109

Co-authored-by: Roll PyTorch Action <torch-mlir@users.noreply.github.com>
2023-11-09 06:21:48 -08:00
Yuanqiang Liu 60effcee89
[Dtype Function] fix aten.div.Tensor_mode's dtype function (#2555) 2023-11-09 09:46:53 +08:00
saienduri ad18219820
Fix for unused variable failure when trying to bump torch-mlir in IREE (#2560)
Due to blob being an unused variable, we are not able to bump torch-mlir
in iree. With this PR, we remove this unused variable.
2023-11-08 15:55:41 -08:00
Stella Laurenzo f3bfa81857
update PyTorch version to 2.2.0.dev20231106 (#2556)
torch version: 2.2.0.dev20231106
torch commit hash: a04dd794ad694baeb257c12329c3166c6a44ae50
torchvision version: 0.17.0.dev20231106

Co-authored-by: Roll PyTorch Action <torch-mlir@users.noreply.github.com>
2023-11-08 07:20:36 -08:00
James Newling b6e551c7b8
Decomposition of aten.pixel_shuffle with static input shape (#2550)
For static tests (that is when the shape is know) for example:

 ```
 @annotate_args([None, ([3, 18, 2, 2], torch.float32, True)])
 ```
 
The e2e passes. But only if the replacement op's return type is set as
undefined (optional shape and type must be explicitly made unset),
otherwise there's a error about the function return type.
 
 For dynamic cases, for example if the above is replaced with 
 
  ```
 @annotate_args([None, ([-1, -1, -1, -1], torch.float32, True)])
 ```

There is a failure to lower to linalg from torch ("view op explicitly
labelled as illegal"). This seems to be because the support for lowering
from torch to linalg with dynamic shapes is limited.
2023-11-08 08:52:44 -05:00
JianzheXiao a42d4c18ff
[Torch Dialect]Support aten.cosine_similarity (#2364)
As title, add support for aten.cosine_similarity, support broadcast
inputA/inputB to the same shape
2023-11-08 15:28:30 +08:00
James Newling 026cb314da
Specify path of e2e_test.sh after directory change (#2557)
Is there a way to disable some of CI for docs-only PR's?
2023-11-07 16:07:02 -08:00
Stella Laurenzo 4b9db995b5
update PyTorch version to 2.2.0.dev20231105 (#2554)
torch version: 2.2.0.dev20231105
torch commit hash: 2d7dd2e800dfd6332656074bfa208e4b25cfe907
torchvision version: 0.17.0.dev20231105

Co-authored-by: Roll PyTorch Action <torch-mlir@users.noreply.github.com>
2023-11-05 06:57:01 -08:00
Jiawei Wu d5ee8ee73a
[Torch Dialect] emit aten.reshape_as op and add decomposition pattern. (#2553) 2023-11-05 11:38:36 +08:00
Stella Laurenzo 71ca529a62
update PyTorch version to 2.2.0.dev20231104 (#2552)
torch version: 2.2.0.dev20231104
torch commit hash: a89fef71845d0dbc2c4c4a4c7878f51f4968ab90
torchvision version: 0.17.0.dev20231104

Co-authored-by: Roll PyTorch Action <torch-mlir@users.noreply.github.com>
2023-11-04 09:01:26 -07:00
Yuanqiang Liu 0378da0abd
[Torch Dialect] support aten.isinf (#2544)
Also fix linalg lowering from `UEQ` to `OEQ`.  
I will check other comparison's lowering later.
2023-11-04 22:26:01 +08:00
saienduri 88adf384cc
torch-mlir change for dense resource implementation (#2513)
Co-authored-by: Avinash Sharma <avinash@nod-labs.com>
2023-11-03 11:44:07 -07:00
Sambhav Jain 1b9fb1b51d
[Bazel] Mirror project reorganization (#2547)
Updates Bazel build to mirror project reorganization from
https://github.com/llvm/torch-mlir/pull/2542.

GHA:
https://github.com/sjain-stanford/torch-mlir/actions/runs/6744430250/job/18334262852
2023-11-03 08:45:51 -07:00
Stella Laurenzo 3caddd2dd9
update PyTorch version to 2.2.0.dev20231103 (#2549)
torch version: 2.2.0.dev20231103
torch commit hash: fd56aa0daeec624bcff822fef04fe9339770dc33
torchvision version: 0.17.0.dev20231103

Co-authored-by: Roll PyTorch Action <torch-mlir@users.noreply.github.com>
2023-11-03 08:25:58 -07:00
Stella Laurenzo 6961f0a247
Re-organize project structure to separate PyTorch dependencies from core project. (#2542)
This is a first step towards the structure we discussed here:
https://gist.github.com/stellaraccident/931b068aaf7fa56f34069426740ebf20

There are two primary goals:

1. Separate the core project (C++ dialects and conversions) from the
hard PyTorch dependencies. We move all such things into projects/pt1 as
a starting point since they are presently entangled with PT1-era APIs.
Additional work can be done to disentangle components from that
(specifically LTC is identified as likely ultimately living in a
`projects/ltc`).
2. Create space for native PyTorch2 Dynamo-based infra to be upstreamed
without needing to co-exist with the original TorchScript path.

Very little changes in this path with respect to build layering or
options. These can be updated in a followup without commingling
directory structure changes.

This also takes steps toward a couple of other layering enhancements:

* Removes the llvm-external-projects/torch-mlir-dialects sub-project,
collapsing it into the main tree.
* Audits and fixes up the core C++ build to account for issues found
while moving things. This is just an opportunistic pass through but
roughly ~halves the number of build actions for the project from the
high 4000's to the low 2000's.

It deviates from the discussed plan by having a `projects/` tree instead
of `compat/`. As I was thinking about it, this will better accommodate
the follow-on code movement.

Once things are roughly in place and the CI passing, followups will
focus on more in-situ fixes and cleanups.
2023-11-02 19:45:55 -07:00
Stella Laurenzo 536e45cb3b
update PyTorch version to 2.2.0.dev20231102 (#2545)
torch version: 2.2.0.dev20231102
torch commit hash: d2c3aa1fded6d1a0165eafe6e08816a85a1190d8
torchvision version: 0.17.0.dev20231102

Co-authored-by: Roll PyTorch Action <torch-mlir@users.noreply.github.com>
2023-11-02 08:39:55 -07:00
Zhekun(Josh) Zhang 88d4c475d3
[Torch] Fix mixP case for non value semantic ops (#2540)
NonValueSemantic Ops like Add_, div_, etc. expect result DType to be the
same as the first input. However, current implementation would result in
wrong result type for case like:

```python
a = torch.randn(3, 3).half() # float16
b = torch.randn(3, 3) # float32
a += b # i.e. torch.ops.aten.add_(a, b)
```
torch expects `a` to be float16, but dtype refinement would infer
float32 type, since it's replaced by `aten.add`.
2023-11-02 12:40:08 +08:00
Daniel Garvey 4901773f77
add uncovered cases in view lowering (#2524)
removes unecessary checks from empty strided
2023-11-01 21:56:44 -05:00
Yuanqiang Liu 365655ca29
[Torch Dialect] add canonicalize pattern for aten.floor with integer … (#2534)
…type
2023-11-02 09:51:31 +08:00
saienduri a2e694df40
add e2e support for torch.eye operations (aten.eye, aten.eye.m) (#2478) 2023-11-01 11:23:28 -07:00
Stella Laurenzo e12937c642
update PyTorch version to 2.2.0.dev20231101 (#2538)
torch version: 2.2.0.dev20231101
torch commit hash: e844d7ab047429425f117b1c566038713d2d7784
torchvision version: 0.17.0.dev20231101

Co-authored-by: Roll PyTorch Action <torch-mlir@users.noreply.github.com>
2023-11-01 08:17:40 -07:00
Daniel Garvey 1d41f7b6fe
Rework AtenEmptyStridedOp checks (#2537)
Now using Value instead of Ints. Trades compile failure for a runtime
assert
2023-10-31 22:56:54 -05:00
xiaolou86 4199feffed
Fix typos in comments (#2539)
Fix typos in comments
2023-10-31 20:10:47 -07:00
JianzheXiao e8706957c0
[Torch Dialect] Add Support for aten.unflatten.int (#2475)
As title, Add support for aten.unflatten.int, support dim to be negative
and one of the sizes' elements to be -1
2023-10-31 15:36:16 +08:00
Stella Laurenzo b88f9ec8f2
update PyTorch version to 2.2.0.dev20231027 (#2536)
torch version: 2.2.0.dev20231027
torch commit hash: 525a926aaa127e59c71ed66915055ac027dba507
torchvision version: 0.17.0.dev20231027

Co-authored-by: Roll PyTorch Action <torch-mlir@users.noreply.github.com>
2023-10-27 09:47:45 -07:00
Stella Laurenzo 2e5c624b58
update PyTorch version to 2.2.0.dev20231026 (#2535)
torch version: 2.2.0.dev20231026
torch commit hash: bf9fd89f63f213a5c449dd589ac96cf9c9218885
torchvision version: 0.17.0.dev20231026

Co-authored-by: Roll PyTorch Action <torch-mlir@users.noreply.github.com>
2023-10-26 09:45:36 -07:00
Yuanqiang Liu e7282487ea
[Torch Dialect] support aten.glu (#2531) 2023-10-26 10:36:18 +08:00
Stella Laurenzo b0f39ac966
update PyTorch version to 2.2.0.dev20231025 (#2532)
torch version: 2.2.0.dev20231025
torch commit hash: e6efc2915b4ac65c784fbcbbf42ad87b49214417
torchvision version: 0.17.0.dev20231025

Co-authored-by: Roll PyTorch Action <torch-mlir@users.noreply.github.com>
2023-10-25 10:11:06 -07:00
Stella Laurenzo e184e45398
update PyTorch version to 2.2.0.dev20231024 (#2530)
torch version: 2.2.0.dev20231024
torch commit hash: a422515e75cad4e785bbdbdff4f4e1c7c406bb24
torchvision version: 0.17.0.dev20231024

Co-authored-by: Roll PyTorch Action <torch-mlir@users.noreply.github.com>
2023-10-24 07:50:06 -07:00
Ze Zhang 7cb2db6279
Update dtype check in torch-to-tosa clamp op (#2529)
As titled.

---------

Co-authored-by: Ze Zhang <ze.zhang@getcruise.com>
2023-10-23 17:04:30 -07:00
Stella Laurenzo 6d74e8cccd
update PyTorch version to 2.2.0.dev20231023 (#2528)
torch version: 2.2.0.dev20231023
torch commit hash: 88eb6bbb1ab58d7cdb49349b64c02a04911be8f2
torchvision version: 0.17.0.dev20231023

Co-authored-by: Roll PyTorch Action <torch-mlir@users.noreply.github.com>
2023-10-23 09:32:21 -07:00
Stella Laurenzo 0f781ab4bf
update PyTorch version to 2.2.0.dev20231022 (#2526)
torch version: 2.2.0.dev20231022
torch commit hash: f468e74875f6b7f95b7b01ccf3b05c3917e2865d
torchvision version: 0.17.0.dev20231022

Co-authored-by: Roll PyTorch Action <torch-mlir@users.noreply.github.com>
2023-10-22 08:01:12 -07:00
Sarthak Gupta 7633619ed2
[torch] Implement stronger verifiers for non-value semantic ops (#2519)
Attempt to solve https://github.com/llvm/torch-mlir/issues/2490

Changes for Non Value Semantic Ops having the
`IsTrailingUnderscoreInplaceVariant` trait :
- AnyTorchTensorType -> Torch_NonValueTensorType
- AnyTorchOptionalTensorType -> AnyTorchOptionalNonValueTensorType
- AnyTorchListOfOptionalTensorType ->
AnyTorchListOfOptionalNonValueTensorType
- AnyTorchListOfTensorType -> AnyTorchListOfNonValueTensorType

Created three new tensor types for optional and list non value tensors.
2023-10-21 09:09:55 -07:00
Stella Laurenzo 0acbb264d4
update PyTorch version to 2.2.0.dev20231021 (#2525)
torch version: 2.2.0.dev20231021
torch commit hash: 147ac6b312c4c71e89013be592dc519c81fcac4e
torchvision version: 0.17.0.dev20231021

Co-authored-by: Roll PyTorch Action <torch-mlir@users.noreply.github.com>
2023-10-21 08:57:42 -07:00
Stella Laurenzo caa533cc5f
update PyTorch version to 2.2.0.dev20231020 (#2522)
torch version: 2.2.0.dev20231020
torch commit hash: 6ffe31abcae7d580c451cea195bd52258c72ac81
torchvision version: 0.17.0.dev20231020

Co-authored-by: Roll PyTorch Action <torch-mlir@users.noreply.github.com>
2023-10-20 09:01:22 -07:00
Vivek Khandelwal 5bc2009332
build: manually update PyTorch version (#2521) 2023-10-19 07:03:00 -07:00
Sambhav Jain 52abae1526
Bump LLVM to get bazel fixes (#2517)
The last llvm bump in https://github.com/llvm/torch-mlir/pull/2511
pointed to
b44b3494f6,
however the bazel build upstream was not clean at this point:

```
ERROR: /root/.cache/bazel/_bazel_root/b89349c08f7224396763d14fe35cba11/external/llvm-project/mlir/BUILD.bazel:5837:18: TdGenerate
external/llvm-project/mlir/include/mlir/Dialect/LLVMIR/NVVMOpsInterface.h.inc failed: (Exit 1): mlir-tblgen failed: error executing command ...
                                                                                                                                                    
external/llvm-project/mlir/include/mlir/Dialect/LLVMIR/NVVMOps.td:20:9: error: Could not find include file 'mlir/Dialect/LLVMIR/BasicPtxBuilderInterface.td'                                                                                                           
include "mlir/Dialect/LLVMIR/BasicPtxBuilderInterface.td"                                                                                                                                                                                                              
        ^                                                                                                                                                                                                                                                              
external/llvm-project/mlir/include/mlir/Dialect/LLVMIR/NVVMOps.td:20:9: error: Unexpected token at top level                                                                                                                                                           
include "mlir/Dialect/LLVMIR/BasicPtxBuilderInterface.td"                                                                                                                                                                                                              
        ^       
```

The bazel fixes followed in a subsequent commit at
28b27c1b10.
This PR bumps LLVM by a few more commits (to include the bazel fixes)
which helps restore Torch-MLIR's bazel build back to 🟢 .

GHA workflow to test bazel build:
https://github.com/sjain-stanford/torch-mlir/actions/runs/6555101471/job/17803082508
2023-10-17 22:00:26 -07:00
Ze Zhang 4279b750da
update AtenClampOp in torch-to-tosa to handle fp inputs (#2516)
As titled.

---------

Co-authored-by: Ze Zhang <ze.zhang@getcruise.com>
2023-10-17 14:49:47 -07:00
Chi_Liu 14a4da923b
Update llvm-project to b44b3494f60296db6aca38a14cab061d9b747a0a (#2511)
The main purpose is to bring in the new mesh dialect change.
https://github.com/llvm/llvm-project/pull/68007
2023-10-16 19:29:48 -07:00
Ze Zhang f2c53b8ca5
Add aten.isclose support and its torch-to-tosa lowering (#2512)
Add aten.isclose op
Add its torch-to-tosa lowering
Update the TorchToTosa/basic.mlir tests


To test e2e tosa lowering:
`python -m e2e_testing.main -v -c=tosa`

---------

Co-authored-by: Ze Zhang <ze.zhang@getcruise.com>
2023-10-16 09:44:53 -07:00
Ze Zhang e649e06b7b
Add aten.unflatten.int support and its torch-to-tosa lowering (#2509)
Add aten.unflatten.int op
Add its torch-to-tosa lowering
Update the TorchToTosa/basic.mlir tests

To test e2e tosa lowering:

`python -m e2e_testing.main -v -c=tosa`

---------

Co-authored-by: Ze Zhang <ze.zhang@getcruise.com>
2023-10-13 18:39:41 -07:00
Ramiro Leal-Cavazos 9b5a4afadd
Update README to include new meeting schedule (#2503) 2023-10-10 09:54:54 -07:00
Stella Laurenzo 26ea13ddf5
update PyTorch version to 2.2.0.dev20231006 (#2507)
torch version: 2.2.0.dev20231006
torch commit hash: 20217d1426d99d0caa70e1473d89e0c834b7f35e
torchvision version: 0.17.0.dev20231006

Co-authored-by: Roll PyTorch Action <torch-mlir@users.noreply.github.com>
2023-10-06 07:27:45 -07:00
Quinn Dawkins 6f81ad7293
[TorchToLinalg] Improve broadcast lowerings in strict symbolic modes (#2505)
With strict symbolic shapes, we can assume numpy-style dynamic
broadcasts never occur. This improves the lowering in the presence of
this assumption.
2023-10-05 15:15:26 -04:00
Stella Laurenzo 42b6c0a14a
update PyTorch version to 2.2.0.dev20231005 (#2506)
torch version: 2.2.0.dev20231005
torch commit hash: 439cba92777ff61b49d24096edfaf128fbd742ea
torchvision version: 0.17.0.dev20231005

Co-authored-by: Roll PyTorch Action <torch-mlir@users.noreply.github.com>
2023-10-05 09:45:53 -07:00
Quinn Dawkins ae72eec224
Improve aten.broadcast_to folder when in strict symbol mode (#2504)
Strict symbolic shapes allow us to assume numpy-style dynamic broadcasts
never occur. This allows us to strengthen the folder for broadcasts to
cases where the rank is the same and all shapes match (including dynamic
sentinel values).
2023-10-05 09:02:10 -04:00
Stella Laurenzo 14e6da8588
update PyTorch version to 2.2.0.dev20231004 (#2502)
torch version: 2.2.0.dev20231004
torch commit hash: 56af607c0437ed7321da4b96a4dbccdbd8b5a98b
torchvision version: 0.17.0.dev20231004

Co-authored-by: Roll PyTorch Action <torch-mlir@users.noreply.github.com>
2023-10-04 07:55:21 -07:00