Skip to content

Instantly share code, notes, and snippets.

@AmosLewis
Last active August 14, 2024 17:15
Show Gist options
  • Save AmosLewis/dd31ab37517977b1c499d06495b4adc2 to your computer and use it in GitHub Desktop.
Save AmosLewis/dd31ab37517977b1c499d06495b4adc2 to your computer and use it in GitHub Desktop.
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
git submodule update --init --progressgit submodule update --init --progress
git add -u
git commit --amend --no-edit
git reset --hard HEAD~1
git push origin as_stride --force
pip3 install clang-format
git clang-format HEAD~1
torch-mlir-opt -convert-torch-to-tosa /tmp/index.mlir | externals/llvm-project/mlir/utils/generate-test-checks.py
--convert-torch-to-linalg
--torch-backend-to-linalg-on-tensors-backend-pipeline
torch-mlir-opt --convert-torch-onnx-to-torch --torch-decompose-complex-ops --cse --canonicalize --convert-torch-to-linalg reshape.default.onnx.mlir --debug
torch-mlir-opt -convert-torch-to-tosa /tmp/index.mlir -mlir-print-ir-after-all -mlir-disable-threading --mlir-print-ir-before-all --debug
torch-mlir-opt --mlir-elide-elementsattrs-if-larger=4 non_elided.mlir > elided.mlir
grep -r "AveragePool" Inception_v4_vaiq_int8.default.torch-onnx.mlir
@AmosLewis
Copy link
Author

run iree_tests

 pytest SHARK-TestSuite/iree_tests/onnx/ \
  -rpfE \
  --numprocesses 24 \
  --timeout=30 \
  --durations=20 \
  --no-skip-tests-missing-files \
  --config-files=/proj/gdba/shark/chi/src/iree/build_tools/pkgci/external_test_suite/onnx_cpu_llvm_sync.json \
  --report-log=/proj/gdba/shark/chi/src/iree_log.txt

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