| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
[lib/conversion] Create seed only if needed in convert-torch-convers… (#3926) …ion-to-mlprogram pass This PR changes convert-torch-conversion-to-mlprogram pass implementation by moving seed generation inside ConvertGetNextSeedOp pattern. Previously, global seed was being created by this pass, even when its only consumer torch_c.get_next_seed op is not present in the IR. This pass is part of Torch->Linalg conversion pipeline. Always creating global seed created an issue for the case when downstream compiler doesn't expect/support ml_program dialect in linalg on tensor IR format. However, when starting torch IR has torch_c.get_next_seed op, ml_program will still be present and will need to be handled by downstream compilers. | 1 年前 | |
[OnnxToTorch] Lower onnx.MeanVarianceNorm to torch dialect without expansion (#4219) This PR takes care of https://github.com/llvm/torch-mlir/issues/4218. - Lower onnx MeanVarianceNorm op to torch primitive ops. - Remove **function expansion** during import from onnx --------- Signed-off-by: Zahid Wakeel <zahid.wakeel@multicorewareinc.com> | 1 年前 | |
[Torch Dialect] Emit torch.aten.mul.float_int, add folder and conversion to Arith. (#3750) Folder is required to simplify the shape calculation of torch.aten.__interpolate.size_list_scale_list: https://github.com/llvm/torch-mlir/blob/5eab669c4ab0c3aab3dab5b95d0172ab0a8395b8/lib/Dialect/Torch/Transforms/AbstractInterpLibrary.cpp#L6900-L6907 (I've re-run build_tools/update_abstract_interp_lib.sh) --------- Co-authored-by: zjgarvey <47986913+zjgarvey@users.noreply.github.com> | 1 年前 | |
[LINALG] Fix: Incorrect linalg lowering for aten.convolution_transpose with negative effective padding (#4369) ### **The Bug** The torch-to-linalg lowering for aten.convolution (with transposed=true) incorrectly handles cases where the effective padding is negative. The logic for this is contained in createTransposedInputPadding. The original implementation had two critical flaws: **Incorrect Math**: The logic block for negative padding (if (anyDimensionPaddingIsNegative)) attempted to "pre-crop" the input tensor before un-striding. The math used to calculate these slice offsets and sizes was incorrect, resulting in tensor.extract_slice operations with out-of-bounds offsets and negative sizes, causing the compiler to fail. **Failed "Mixed-Mode**" **Logic**: The code was built on an "all-or-nothing" assumption. It failed to handle "mixed-mode" padding, where one spatial dimension required padding (positive offset) while another required cropping (negative offset). It would enter the negative padding path and apply cropping logic to all dimensions, leading to out-of-bounds errors when it tried to crop a dimension that should have been padded. ### **The Fix** This patch refactors the logic into two clean, robust paths: **All-Padding Path (else block):** Trigger: All spatial dimensions have an effective padding offset >= 0. Action: Retains the original, efficient "fast path." It uses a single tensor.insert_slice to perform both un-striding (with strides) and padding (with offsets) in one operation. **Safe Path (if (anyDimensionPaddingIsNegative) block):** Trigger: At least one spatial dimension has a negative effective padding offset. Action: This path is now a unified, robust 3-step process that correctly handles both all-crop and mixed-mode scenarios: Create "Super-Tensor": It computes a maxSizes tensor, which is the "union" of the padded and un-strided sizes (i.e., max(innerSize, outerSize) for each dimension). Pad & Un-stride: It performs a single tensor.insert_slice of the original input into this maxSizes tensor. This one operation correctly applies all positive padding (via insertSliceOffsets) and un-striding (via strideIndexValues). Crop: It performs a final tensor.extract_slice to crop the maxSizes tensor down to the final outerSizes. This correctly applies all negative padding (via extractSliceOffsets). This new logic resolves all known failure cases and is validated by the new TransposedConv{1,2,3}dNegativePadding test cases, which specifically target this functionality. --------- Co-authored-by: Hariprasad Ravishankar <hravisha@ah-hravisha-l.dhcp.mathworks.com> Co-authored-by: Hariprasad Ravishankar <hravisha@mathworks.com> | 9 个月前 | |
Bump llvm to f9031f00f2c9 (#3672) As title --------- Co-authored-by: Muhammad Abubakar <jane.doe@getcruise.com> | 2 年前 | |
[Stablehlo] Support aten.prod.dim_int (#4198) | 1 年前 | |
[MLIR][TORCH] Undo indices conversion to i32 for TMTensor ops (#4292) Signed-off-by: Vivek Khandelwal <vivekkhandelwal1424@gmail.com> Co-authored-by: Kunwar Grover | 1 年前 | |
[onnx] Lowering for onnx.shape to torch and tensor (#2648) Includes the lowering from the aten equivalent to tensor operations. | 2 年前 | |
[tosa] : Add e2e support for quantized matmul. (#4371) This PR enables e2e test for quantized torch.mm and it's other variants through the tosa path. torch IR for quantized matmul is shown in the following snippet: %2 = torch.aten._make_per_tensor_quantized_tensor %0, %float2.150000e-02, %int-25 : !torch.vtensor<[3,4],si8>, !torch.float, !torch.int -> !torch.vtensor<[3,4],!torch.qint8> %3 = torch.aten._make_per_tensor_quantized_tensor %1, %float1.760000e-02, %int18 : !torch.vtensor<[4,3],si8>, !torch.float, !torch.int -> !torch.vtensor<[4,3],!torch.qint8> %4 = torch.aten.mm %2, %3 : !torch.vtensor<[3,4],!torch.qint8>, !torch.vtensor<[4,3],!torch.qint8> -> !torch.vtensor<[3,3],!torch.qint32> %5 = torch.aten.int_repr %4 : !torch.vtensor<[3,3],!torch.qint32> -> !torch.vtensor<[3,3],si32> %6 = torch.aten._make_per_tensor_quantized_tensor %5, %float3.784000e-04, %int0 : !torch.vtensor<[3,3],si32>, !torch.float, !torch.int -> !torch.vtensor<[3,3],!torch.qint32> %7 = torch.aten.dequantize.tensor %6 : !torch.vtensor<[3,3],!torch.qint32> -> !torch.vtensor<[3,3],f32> 1. This change adds legalizations for _make_per_tensor_quantized_tensor, int_repr which are basically cast operations. The former op carries the zero-point/scale information for (de)quantizing values. 2. Legalization for dequantize.tensor is also added which is the usual dequantization op. 3. Legalization for matmul is fixed to infer the zero-point information from the source _make_per_tensor_quantized_tensor ops for the matmul operands. Scale doesn't need to be considered, as it will be taken care of correctly at the output via FuseQuantizedOps transform. | 9 个月前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 1 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 9 个月前 | ||
| 2 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 2 年前 | ||
| 9 个月前 |