torch-mlir/python/torch_mlir
Ze Zhang abb9282524 Add canonicalize pattern for aten.mul.int and aten.floordiv.int (#3680)
This PR add `floordiv` to the `PY_BUILTIN_TO_TORCH_OP`. For
`aten.mul.int` and `aten.floordiv.int` ops, we add new Canonicalization
Patterns as follow:

```
%1 = torch.aten.mul.int %input, %const-5
%2 = torch.aten.mul.int %1, %const-6
```

Will be replaced by

`torch.aten.mul.int %input, %const-30`


And 

```
%1 = torch.aten.mul.int %input, %const-5
%2 = torch.aten.floordiv.int %1, %const-5
```
Will directly return `%input`


This PR also relaxes the `float` type constraint in TorchToTosa for the
`AtenRsubScalarOp` conversion.



To test:

`cmake --build build --target check-torch-mlir-all`
2024-11-21 12:58:10 +08:00
..
_mlir_libs [ci] Upgrade to new runners and disable unsupported jobs. (#2818) 2024-01-27 18:35:45 -08:00
dialects Upstream the ONNX importer. (#2636) 2023-12-12 19:02:51 -08:00
extras Add canonicalize pattern for aten.mul.int and aten.floordiv.int (#3680) 2024-11-21 12:58:10 +08:00
tools/import_onnx Bump Onnx Version to 1.16.1 (#3515) 2024-07-01 22:15:45 +05:30
compiler_utils.py [NFC] Expose both raw Torch dialect and Torch dialect in backend form with Dynamo/FX (#3541) 2024-07-14 10:33:47 -07:00
fx.py [FxImporter] small fixes for fx importer compatibility issues between different pytorch versions (#3577) 2024-08-01 10:52:41 +08:00