| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
Add Windows build workflow in the CI. (#4041) 1. Adds a workflow to trigger windows build in the CI similar to the existing one for Linux to address the build CI request captured in https://github.com/llvm/torch-mlir/issues/3985 2. Only non-python based LIT unit tests are enabled in the workflow due to failures reported in https://github.com/llvm/torch-mlir/issues/4040 3. The CI is only run against torch-nightly since python based tests are disabled. My understanding is that without the python based tests there's no need to run against the stable version too. If that's not the case, will enable stable as well. Tested that both nightly and stable versions work fine: https://github.com/sahas3/torch-mlir/actions/runs/13477124004 | 1 年前 | |
Add ConstantArgument support to fx_import (#4244) This PR will fix the following issue: [fx_importer NotImplementedError: MultiheadAttention layer with NeedWeight = false](https://github.com/llvm/torch-mlir/issues/4158) The following error was raised before this fix: Python Error: NotImplementedError: OutputKind.USER_OUTPUT for <class 'torch.export.graph_signature.ConstantArgument'>: ConstantArgument(name='', value=None) This occurs for an exported MultiheadAttention layer with "NeedWeight = false" which means weights are not going to be returned by the layer. So, the second output attn_output_weights will be None in this case. | 1 年前 | |
[TORCH] Modified fx_importer to support hop_while_loop (#4338) This PR adds support for emitting graphs for Pytorch HOPs, beginning with torch._higher_order_ops.while_loop. The proposed change is to modify the import_program to call function _import_all_child_modules, which recursively imports the stateless graph for all the children modules. Since HOP operator graphs are stateless graphs with no mutation, it is correct to import them as stateless graphs, although the method import_stateless_graph is marked as "deprecated". --------- Signed-off-by: Keshav Vinayak Jha <keshavvinayakjha@gmail.com> | 9 个月前 | |
build: manually update PyTorch version (#4112) This commit sets the PyTorch and TorchVision versions to nightly release 2025-04-23. This commit also updates the fx_importer tests with the changes related to symbolic shape ids introduced in https://github.com/pytorch/pytorch/commit/f649ee73ce28fe8e021ec93f69db4eb8f14285f4. This commit disables some checks because of the mismatch in the resultant IR for PyTorch nightly and stable versions. Those checks will be enabled once they are on the same page. --------- Signed-off-by: Vivek Khandelwal <vivekkhandelwal1424@gmail.com> | 1 年前 | |
build: manually update PyTorch version (#4231) This commit sets the PyTorch and TorchVision versions to nightly release 2025-06-15. This commit also disables a check for the test test_broadcast_unit_dim_to_dynamic_with_unchanged_dim_dynamic in symbolic_shape_expr_test.py because it generates different outputs for the torch stable and nightly versions. The check can be re-enabled once the nightly changes become part of the stable torch version. --------- Signed-off-by: Vivek Khandelwal <vivekkhandelwal1424@gmail.com> | 1 年前 | |
Representing Symbolic Shape Expressions in Torch Dialect (#3372) Torch Dialect with symbolic shape expressions: ll module { func.func @main(%arg0: !torch.vtensor<[?,?,3],f32>, %arg1: !torch.vtensor<[?,?,3],f32>) -> !torch.vtensor<[?,?,3],f32> { %0 = torch.symbolic_int "s0" {min_val = 5, max_val = 10} : !torch.int %1 = torch.symbolic_int "s1" {min_val = 0, max_val = 100} : !torch.int %2 = torch.symbolic_int "s3" {min_val = 0, max_val = 50} : !torch.int torch.bind_symbolic_shape %arg0, [%0, %1], #affine_map<()[s0, s1] -> (s0, s1, 3)> : !torch.vtensor<[?,?,3],f32> torch.bind_symbolic_shape %arg1, [%0, %2], #affine_map<()[s0, s1] -> (s0, s1, 3)> : !torch.vtensor<[?,?,3],f32> %3 = torch.aten.tanh %arg0 : !torch.vtensor<[?,?,3],f32> -> !torch.vtensor<[?,?,3],f32> torch.bind_symbolic_shape %3, [%0, %1], #affine_map<()[s0, s1] -> (s0, s1, 3)> : !torch.vtensor<[?,?,3],f32> %4 = torch.aten.sigmoid %arg1 : !torch.vtensor<[?,?,3],f32> -> !torch.vtensor<[?,?,3],f32> torch.bind_symbolic_shape %4, [%0, %2], #affine_map<()[s0, s1] -> (s0, s1, 3)> : !torch.vtensor<[?,?,3],f32> %5 = torch.prim.ListConstruct %3, %3, %4 : (!torch.vtensor<[?,?,3],f32>, !torch.vtensor<[?,?,3],f32>, !torch.vtensor<[?,?,3],f32>) -> !torch.list<vtensor> %int1 = torch.constant.int 1 %6 = torch.aten.cat %5, %int1 : !torch.list<vtensor>, !torch.int -> !torch.vtensor<[?,?,3],f32> torch.bind_symbolic_shape %6, [%0, %1, %2], #affine_map<()[s0, s1, s2] -> (s0, s1 * 2 + s2, 3)> : !torch.vtensor<[?,?,3],f32> return %6 : !torch.vtensor<[?,?,3],f32> } } For reference, this is the TorchDynamo exported program with symbolic shape expressions that the above Torch dialect program is imported from: py ExportedProgram: class GraphModule(torch.nn.Module): def forward(self, x: "f32[s0, s1, 3]", y: "f32[s0, s3, 3]"): # File: /home/sambhav.jain/workspaces/cruise/src/3p/torch-mlir/test/python/fx_importer/symbolic_shape_expr_test.py:31 in forward, code: a = torch.tanh(x) tanh: "f32[s0, s1, 3]" = torch.ops.aten.tanh.default(x); x = None # File: /home/sambhav.jain/workspaces/cruise/src/3p/torch-mlir/test/python/fx_importer/symbolic_shape_expr_test.py:32 in forward, code: b = torch.sigmoid(y) sigmoid: "f32[s0, s3, 3]" = torch.ops.aten.sigmoid.default(y); y = None # File: /home/sambhav.jain/workspaces/cruise/src/3p/torch-mlir/test/python/fx_importer/symbolic_shape_expr_test.py:33 in forward, code: return torch.cat((a, a, b), dim=1) cat: "f32[s0, 2*s1 + s3, 3]" = torch.ops.aten.cat.default([tanh, tanh, sigmoid], 1); tanh = sigmoid = None return (cat,) Graph signature: ExportGraphSignature(input_specs=[InputSpec(kind=<InputKind.USER_INPUT: 1>, arg=TensorArgument(name='x'), target=None, persistent=None), InputSpec(kind=<InputKind.USER_INPUT: 1>, arg=TensorArgument(name='y'), target=None, persistent=None)], output_specs=[OutputSpec(kind=<OutputKind.USER_OUTPUT: 1>, arg=TensorArgument(name='cat'), target=None)]) Range constraints: {s0: ValueRanges(lower=5, upper=10, is_bool=False), s1: ValueRanges(lower=0, upper=100, is_bool=False), s3: ValueRanges(lower=0, upper=50, is_bool=False)} Huge credit to @stellaraccident for the inputs that helped evaluate the various design options and arrive at the representation of choice. - [x] Op definitions for symbolic_int and bind_symbolic_shape ops - [x] fx_importer updates to import range constraints + create symbolic_int ops - [x] fx_importer changes for AffineMapAttr building + adding bind_symbolic_shape ops - [x] custom printer/parser for inlined AffineMap expressions in mlir assembly - [x] Dialect lit test - [x] fx_importer python lit tests - [ ] Cleanup pass to remove these ops (can add in a follow-on) | 2 年前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 1 年前 | ||
| 1 年前 | ||
| 9 个月前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 2 年前 |