Skip to content

Instantly share code, notes, and snippets.

module {
func.func @torch_jit(%arg0: !torch.vtensor<[32,3,256,256],f32>) -> !torch.vtensor<[32,1,256,256],f32> attributes {torch.onnx_meta.ir_version = 8 : si64, torch.onnx_meta.opset_version = 17 : si64, torch.onnx_meta.producer_name = "pytorch", torch.onnx_meta.producer_version = "1.13.1"} {
%float1.250000e-01 = torch.constant.float 1.250000e-01
%float4.882810e-04 = torch.constant.float 4.8828125E-4
%float3.125000e-02 = torch.constant.float 3.125000e-02
%float1.953130e-03 = torch.constant.float 0.001953125
%float3.906250e-03 = torch.constant.float 3.906250e-03
%float9.765620e-04 = torch.constant.float 9.765625E-4
%float7.812500e-03 = torch.constant.float 7.812500e-03
%true = torch.constant.bool true
This file has been truncated, but you can view the full file.
module {
func.func @torch_jit(%arg0: !torch.vtensor<[1,3,320,320],f32>) -> (!torch.vtensor<[1,1,320,320],f32>, !torch.vtensor<[1,1,320,320],f32>, !torch.vtensor<[1,1,320,320],f32>, !torch.vtensor<[1,1,320,320],f32>, !torch.vtensor<[1,1,320,320],f32>, !torch.vtensor<[1,1,320,320],f32>, !torch.vtensor<[1,1,320,320],f32>) attributes {torch.onnx_meta.ir_version = 8 : si64, torch.onnx_meta.opset_version = 17 : si64, torch.onnx_meta.producer_name = "pytorch", torch.onnx_meta.producer_version = "1.13.1"} {
%0 = torch.vtensor.literal(dense_resource<__elided__> : tensor<64x3x3x3xf32>) : !torch.vtensor<[64,3,3,3],f32>
%1 = torch.vtensor.literal(dense_resource<__elided__> : tensor<64xf32>) : !torch.vtensor<[64],f32>
%2 = torch.vtensor.literal(dense_resource<__elided__> : tensor<32x64x3x3xf32>) : !torch.vtensor<[32,64,3,3],f32>
%3 = torch.vtensor.literal(dense_resource<__elided__> : tensor<32xf32>) : !torch.vtensor<[32],f32>
%4 = torch.vtensor.literal(dense_resource<__elided__> : tensor<32x32x3x3xf3
module {
func.func @torch_jit(%arg0: !torch.vtensor<[1,3,224,224],f32>) -> (!torch.vtensor<[1,21,224,224],f32>, !torch.vtensor<[1,21,224,224],f32>) attributes {torch.onnx_meta.ir_version = 8 : si64, torch.onnx_meta.opset_version = 17 : si64, torch.onnx_meta.producer_name = "pytorch", torch.onnx_meta.producer_version = "1.13.1"} {
%0 = torch.vtensor.literal(dense_resource<__elided__> : tensor<64x3x7x7xf32>) : !torch.vtensor<[64,3,7,7],f32>
%1 = torch.vtensor.literal(dense_resource<__elided__> : tensor<64xf32>) : !torch.vtensor<[64],f32>
%2 = torch.vtensor.literal(dense_resource<__elided__> : tensor<64x64x1x1xf32>) : !torch.vtensor<[64,64,1,1],f32>
%3 = torch.vtensor.literal(dense_resource<__elided__> : tensor<64xf32>) : !torch.vtensor<[64],f32>
%4 = torch.vtensor.literal(dense_resource<__elided__> : tensor<64x64x3x3xf32>) : !torch.vtensor<[64,64,3,3],f32>
%5 = torch.vtensor.literal(dense_resource<__elided__> : tensor<64xf32>) : !torch.vtensor<[64],f32>
%6 = torch.vtensor.literal(d
module {
func.func @torch_jit(%arg0: !torch.vtensor<[1,3,224,224],f32>) -> (!torch.vtensor<[1,21,224,224],f32>, !torch.vtensor<[1,21,224,224],f32>) attributes {torch.onnx_meta.ir_version = 8 : si64, torch.onnx_meta.opset_version = 17 : si64, torch.onnx_meta.producer_name = "pytorch", torch.onnx_meta.producer_version = "1.13.1"} {
%0 = torch.vtensor.literal(dense_resource<__elided__> : tensor<64x3x7x7xf32>) : !torch.vtensor<[64,3,7,7],f32>
%1 = torch.vtensor.literal(dense_resource<__elided__> : tensor<64xf32>) : !torch.vtensor<[64],f32>
%2 = torch.vtensor.literal(dense_resource<__elided__> : tensor<64x64x1x1xf32>) : !torch.vtensor<[64,64,1,1],f32>
%3 = torch.vtensor.literal(dense_resource<__elided__> : tensor<64xf32>) : !torch.vtensor<[64],f32>
%4 = torch.vtensor.literal(dense_resource<__elided__> : tensor<64x64x3x3xf32>) : !torch.vtensor<[64,64,3,3],f32>
%5 = torch.vtensor.literal(dense_resource<__elided__> : tensor<64xf32>) : !torch.vtensor<[64],f32>
%6 = torch.vtensor.literal(d
(mlir_venv) ➜ torch-mlir git:(reduceprod3) ✗ cmake -GNinja -Bbuild \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++ \
-DPython3_FIND_VIRTUALENV=ONLY \
-DLLVM_ENABLE_PROJECTS=mlir \
-DLLVM_EXTERNAL_PROJECTS="torch-mlir;torch-mlir-dialects" \
-DLLVM_EXTERNAL_TORCH_MLIR_SOURCE_DIR=`pwd` \
-DLLVM_EXTERNAL_TORCH_MLIR_DIALECTS_SOURCE_DIR=`pwd`/externals/llvm-external-projects/torch-mlir-dialects \
-DMLIR_ENABLE_BINDINGS_PYTHON=ON \
#loc = loc(unknown)
module attributes {torch.debug_module_name = "StdCorrectionModule"} {
func.func @forward(%arg0: !torch.vtensor<[?,?,?],f32> loc(unknown)) -> !torch.vtensor<[],f32> {
%int6 = torch.constant.int 6 loc(#loc)
%float2.000000e00 = torch.constant.float 2.000000e+00 loc(#loc)
%float1.000000e00 = torch.constant.float 1.000000e+00 loc(#loc)
%true = torch.constant.bool true loc(#loc)
%int2 = torch.constant.int 2 loc(#loc)
%int1 = torch.constant.int 1 loc(#loc)
%int0 = torch.constant.int 0 loc(#loc)
(mlir_venv) ➜ torch-mlir git:(reduceprodfix) gdb --arg python -m e2e_testing.main --config=onnx --filter StdCorrectionModule_basic -v
GNU gdb (Ubuntu 12.1-0ubuntu1~22.04) 12.1
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
#loc = loc(unknown)
module attributes {torch.debug_module_name = "BernoulliModule"} {
func.func @forward(%arg0: !torch.vtensor<[?,?,?],f64> loc(unknown)) -> (!torch.vtensor<[],f64>, !torch.vtensor<[],f64>) {
%true = torch.constant.bool true loc(#loc)
%false = torch.constant.bool false loc(#loc)
%int7 = torch.constant.int 7 loc(#loc)
%int2 = torch.constant.int 2 loc(#loc)
%int1 = torch.constant.int 1 loc(#loc)
%none = torch.constant.none loc(#loc)
%float0.000000e00 = torch.constant.float 0.000000e+00 loc(#loc4)
(mlir_venv) ➜ torch-mlir git:(reduceprodfix) ✗ gdb --arg python -m e2e_testing.main --config=onnx --filter BernoulliModule_basic -v
GNU gdb (Ubuntu 12.1-0ubuntu1~22.04) 12.1
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
module {
func.func @test_reduce_prod_default_axes_keepdims_random(%arg0: !torch.vtensor<[3,2,2],f32>) -> !torch.vtensor<[1,1,1],f32> attributes {torch.onnx_meta.ir_version = 8 : si64, torch.onnx_meta.opset_version = 18 : si64, torch.onnx_meta.producer_name = "backend-test", torch.onnx_meta.producer_version = ""} {
%int0 = torch.constant.int 0
%int0_0 = torch.constant.int 0
%int1 = torch.constant.int 1
%int2 = torch.constant.int 2
%0 = torch.aten.dim %arg0 : !torch.vtensor<[3,2,2],f32> -> !torch.int
%1 = torch.aten.lt.int %int0_0, %int0 : !torch.int, !torch.int -> !torch.bool
%2 = torch.aten.Int.bool %1 : !torch.bool -> !torch.int
%3 = torch.aten.mul.int %2, %0 : !torch.int, !torch.int -> !torch.int