| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
Fix clang warning about printf format (#3814) Compiling with clang 16.0 on macOS I have warnings about incorrect printf format (see below). Values to be printed are int64_t, but they are printed with %zu and %ld, which are not portable way to print this type. <...>/torch-mlir/test/CAPI/torch.c:52:3: warning: format specifies type 'size_t' (aka 'unsigned long') but the argument has type 'int64_t' (aka 'long long') [-Wformat] 52 | DEFINE_CHECK(NonValueTensor) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ <...>/torch-mlir/test/CAPI/torch.c:37:13: note: expanded from macro 'DEFINE_CHECK' 36 | fprintf(stderr, #TTT "Type %s rank: %zu\n", testName, \ | ~~~ 37 | torchMlirTorch##TTT##TypeGetRank(TTT##Type)); \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ <scratch space>:78:1: note: expanded from here 78 | torchMlirTorchNonValueTensorTypeGetRank | ^ <...>/torch-mlir/test/CAPI/torch.c:52:3: warning: format specifies type 'long' but the argument has type 'int64_t' (aka 'long long') [-Wformat] 52 | DEFINE_CHECK(NonValueTensor) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ <...>/torch-mlir/test/CAPI/torch.c:42:15: note: expanded from macro 'DEFINE_CHECK' 41 | fprintf(stderr, #TTT "Type %s pos %d size: %ld\n", testName, i, \ | ~~~ 42 | TTT##Sizes[i]); \ | ^~~~~~~~~~~~~ <scratch space>:85:1: note: expanded from here 85 | NonValueTensorSizes | ^ <...>/torch-mlir/test/CAPI/torch.c:53:3: warning: format specifies type 'size_t' (aka 'unsigned long') but the argument has type 'int64_t' (aka 'long long') [-Wformat] 53 | DEFINE_CHECK(ValueTensor) | ^~~~~~~~~~~~~~~~~~~~~~~~~ <...>/torch-mlir/test/CAPI/torch.c:37:13: note: expanded from macro 'DEFINE_CHECK' 36 | fprintf(stderr, #TTT "Type %s rank: %zu\n", testName, \ | ~~~ 37 | torchMlirTorch##TTT##TypeGetRank(TTT##Type)); \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ <scratch space>:112:1: note: expanded from here 112 | torchMlirTorchValueTensorTypeGetRank | ^ <...>/torch-mlir/test/CAPI/torch.c:53:3: warning: format specifies type 'long' but the argument has type 'int64_t' (aka 'long long') [-Wformat] 53 | DEFINE_CHECK(ValueTensor) | ^~~~~~~~~~~~~~~~~~~~~~~~~ <...>/torch-mlir/test/CAPI/torch.c:42:15: note: expanded from macro 'DEFINE_CHECK' 41 | fprintf(stderr, #TTT "Type %s pos %d size: %ld\n", testName, i, \ | ~~~ 42 | TTT##Sizes[i]); \ | ^~~~~~~~~~~~~ <scratch space>:119:1: note: expanded from here 119 | ValueTensorSizes | ^ 4 warnings generated. | 1 年前 | |
[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. | 8 个月前 | |
[Torch] Canonicalize pool ops with single int tuple params. (#4250) Fixes https://github.com/llvm/torch-mlir/issues/3885 by repeating the single int to match with expected spatial dims. | 8 个月前 | |
Integrate LLVM at eda3e96b401a9b86132e39432e41e2000d1ab382 (#4208) Update LLVM to https://github.com/llvm/llvm-project/commit/eda3e96b401a9b86132e39432e41e2000d1ab382. The ToMemrefOp is replaced with ToBufferOp, as per the changes made here: https://github.com/llvm/llvm-project/commit/8f91b108df21bee8ee64e88ffa7bdee230389800. Also, getBackwardSlice now has a return value of type LogicalResult. Changes made here: https://github.com/llvm/llvm-project/commit/6a8dde04a07287f837bbabeb93e23e47af366d3d. This commit also adds the folder for tril_indices and triu_indices op for the case when the row and col values are 0. --------- Signed-off-by: Vivek Khandelwal <vivekkhandelwal1424@gmail.com> | 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> | 8 个月前 | |
[NFC reformat] Run pre-commit on all files and format misc. This is part 1 of ~3, formatting all miscellaneous text files and CPP files matched by a first run of pre-commit. These tend to be low change-traffic and are likely not disruptive. Subsequent patches will format Python files and remaining CPP files. | 2 年前 | |
asan: Preload asan runtime into python interpreter (#4046) Same as https://github.com/llvm/llvm-project/pull/123303 upstream | 1 年前 | |
asan: Preload asan runtime into python interpreter (#4046) Same as https://github.com/llvm/llvm-project/pull/123303 upstream | 1 年前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 1 年前 | ||
| 8 个月前 | ||
| 8 个月前 | ||
| 1 年前 | ||
| 8 个月前 | ||
| 2 年前 | ||
| 1 年前 | ||
| 1 年前 |