Skip to content

Instantly share code, notes, and snippets.

@AmosLewis
Created October 18, 2022 07:13
Show Gist options
  • Save AmosLewis/f92085b27191cdfba523b6da3c386c50 to your computer and use it in GitHub Desktop.
Save AmosLewis/f92085b27191cdfba523b6da3c386c50 to your computer and use it in GitHub Desktop.
[61/62] Running the torch-mlir regression tests
FAIL: TORCH_MLIR :: Conversion/TorchToTosa/basic.mlir (42 of 105)
******************** TEST 'TORCH_MLIR :: Conversion/TorchToTosa/basic.mlir' FAILED ********************
Script:
--
: 'RUN: at line 1'; /home/chi/src/ubuntu20/shark/torch-mlir/build/bin/torch-mlir-opt </home/chi/src/ubuntu20/shark/torch-mlir/test/Conversion/TorchToTosa/basic.mlir -convert-torch-to-tosa -split-input-file -verify-diagnostics | FileCheck /home/chi/src/ubuntu20/shark/torch-mlir/test/Conversion/TorchToTosa/basic.mlir
--
Exit Code: 1
Command Output (stderr):
--
/home/chi/src/ubuntu20/shark/torch-mlir/test/Conversion/TorchToTosa/basic.mlir:919:16: error: CHECK-SAME: expected string not found in input
// CHECK-SAME: %[[VAL_0:.*]]: tensor<1x1x5x5xi1>,
^
<stdin>:709:35: note: scanning from here
func.func @torch.aten.where.self(%arg0: !torch.vtensor<[1,1,5,5],i1>, %arg1: !torch.vtensor<[1,12,5,5],f32>, %arg2: !torch.vtensor<[],f32>) -> !torch.vtensor<[1,12,5,5],f32> {
^
<stdin>:713:29: note: possible intended match here
%3 = "tosa.select"(%0, %1, %2) : (tensor<1x1x5x5xi1>, tensor<1x12x5x5xf32>, tensor<f32>) -> tensor<1x12x5x5xf32>
^
Input file: <stdin>
Check file: /home/chi/src/ubuntu20/shark/torch-mlir/test/Conversion/TorchToTosa/basic.mlir
-dump-input=help explains the following input dump.
Input was:
<<<<<<
.
.
.
704: }
705:
706:
707: // -----
708: module {
709: func.func @torch.aten.where.self(%arg0: !torch.vtensor<[1,1,5,5],i1>, %arg1: !torch.vtensor<[1,12,5,5],f32>, %arg2: !torch.vtensor<[],f32>) -> !torch.vtensor<[1,12,5,5],f32> {
same:919'0 X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
710: %0 = torch_c.to_builtin_tensor %arg0 : !torch.vtensor<[1,1,5,5],i1> -> tensor<1x1x5x5xi1>
same:919'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
711: %1 = torch_c.to_builtin_tensor %arg1 : !torch.vtensor<[1,12,5,5],f32> -> tensor<1x12x5x5xf32>
same:919'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
712: %2 = torch_c.to_builtin_tensor %arg2 : !torch.vtensor<[],f32> -> tensor<f32>
same:919'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
713: %3 = "tosa.select"(%0, %1, %2) : (tensor<1x1x5x5xi1>, tensor<1x12x5x5xf32>, tensor<f32>) -> tensor<1x12x5x5xf32>
same:919'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
same:919'1 ? possible intended match
714: %4 = torch_c.from_builtin_tensor %3 : tensor<1x12x5x5xf32> -> !torch.vtensor<[1,12,5,5],f32>
same:919'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
715: return %4 : !torch.vtensor<[1,12,5,5],f32>
same:919'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
716: }
same:919'0 ~~~
717: }
same:919'0 ~~
718:
same:919'0 ~
>>>>>>
--
********************
********************
Failed Tests (1):
TORCH_MLIR :: Conversion/TorchToTosa/basic.mlir
Testing Time: 39.90s
Passed: 104
Failed: 1
FAILED: tools/torch-mlir/test/CMakeFiles/check-torch-mlir /home/chi/src/ubuntu20/shark/torch-mlir/build/tools/torch-mlir/test/CMakeFiles/check-torch-mlir
cd /home/chi/src/ubuntu20/shark/torch-mlir/build/tools/torch-mlir/test && /home/chi/src/ubuntu20/shark/torch-mlir/mlir_venv/bin/python3.10 /home/chi/src/ubuntu20/shark/torch-mlir/build/./bin/llvm-lit -sv /home/chi/src/ubuntu20/shark/torch-mlir/build/tools/torch-mlir/test
ninja: build stopped: subcommand failed.
(mlir_venv) nod% ls
build CMakeLists.txt e2e_testing include mlir_build_cmd.txt pytorch-requirements.txt requirements.txt tools whl-requirements.txt
build_tools dist examples lib mlir_venv pytorch-version.txt setup.py torch_mlir.egg-info
cmake-build-debug-torch-mlir docs externals LICENSE python README.md test utils
(mlir_venv) nod% torch-mlir-opt -pass-pipeline='torch-backend-to-tosa-backend-pipeline' /tmp/where.mlir | externals/llvm-project/mlir/utils/generate-test-checks.py
// NOTE: Assertions have been autogenerated by utils/generate-test-checks.py
// The script is designed to make adding checks to
// a test case fast, it is *not* designed to be authoritative
// about what constitutes a good test! The CHECK should be
// minimized and named to reflect the test intent.
// CHECK-LABEL: func.func @torch.aten.where.self(
// CHECK-SAME: %[[VAL_0:.*]]: tensor<1x1x5x5xi1>,
// CHECK-SAME: %[[VAL_1:.*]]: tensor<1x12x5x5xf32>,
// CHECK-SAME: %[[VAL_2:.*]]: tensor<f32>) -> tensor<1x12x5x5xf32> {
// CHECK: %[[VAL_3:.*]] = "tosa.select"(%[[VAL_0]], %[[VAL_1]], %[[VAL_2]]) : (tensor<1x1x5x5xi1>, tensor<1x12x5x5xf32>, tensor<f32>) -> tensor<1x12x5x5xf32>
// CHECK: return %[[VAL_3]] : tensor<1x12x5x5xf32>
// CHECK: }
(mlir_venv) nod%
@AmosLewis
Copy link
Author

(mlir_venv) nod% 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 \
  -DLLVM_TARGETS_TO_BUILD=host \
  externals/llvm-project/llvm

cmake --build build --target tools/torch-mlir/all

cmake --build build --target check-torch-mlir

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment