Add shapelib and Torch ODS gen tests (#1318)

pull/1329/head
powderluv 2022-08-31 15:01:59 -07:00 committed by GitHub
parent e52e886845
commit 928c815ce2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 32 additions and 0 deletions

View File

@ -193,6 +193,20 @@ function test_in_tree() {
cd /main_checkout/torch-mlir/
export PYTHONPATH="/main_checkout/torch-mlir/build/tools/torch-mlir/python_packages/torch_mlir"
echo ":::: Run shapelib update tests"
if ! ./build_tools/update_shape_lib.sh; then
echo Shape Lib is out of date with the installed PyTorch version
else
echo Shape Lib is up to date
fi
echo ":::: Run torch_ods update tests"
if ! ./build_tools/update_torch_ods.sh; then
echo Torch ODS is out of date with the installed PyTorch version
else
echo Torch ODS is up to date
fi
echo ":::: Run refbackend e2e integration tests"
python -m e2e_testing.main --config=refbackend -v

View File

@ -30,3 +30,12 @@ PYTHONPATH="${pypath}" python \
-m torch_mlir.dialects.torch.importer.jit_ir.build_tools.shape_lib_gen \
--pytorch_op_extensions=${ext_module:-""} \
--torch_transforms_cpp_dir="${torch_transforms_cpp_dir}"
if ! git diff --quiet ./lib/Dialect/Torch/Transforms/ShapeLibrary.cpp &> /dev/null; then
echo "#######################################################"
echo "Generated files are not up to date (see diff below)"
echo ">>> Please verify you are running the latest PyTorch nightly or source build and if required push these changes up for review <<<"
echo "#######################################################"
git diff --color=always ./lib/Dialect/Torch/Transforms/ShapeLibrary.cpp
exit 1
fi

View File

@ -32,3 +32,12 @@ PYTHONPATH="${pypath}" python \
--torch_ir_include_dir="${torch_ir_include_dir}" \
--pytorch_op_extensions="${ext_module}" \
--debug_registry_dump="${torch_ir_include_dir}/JITOperatorRegistryDump.txt"
if ! git diff --quiet ./include/torch-mlir/Dialect/Torch/IR/GeneratedTorchOps.td &> /dev/null; then
echo "#######################################################"
echo "Generated files are not up to date (see diff below)"
echo ">>> Please verify you are running the latest PyTorch nightly or source build and if required push these changes up for review <<<"
echo "#######################################################"
git diff --color=always ./include/torch-mlir/Dialect/Torch/IR/GeneratedTorchOps.td
exit 1
fi