Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add shapelib and Torch ODS gen tests #1318

Merged
merged 1 commit into from
Aug 31, 2022
Merged

Commits on Aug 31, 2022

  1. Add shapelib and Torch ODS gen tests

    Also update the scripts to return 1 when there are changes. The
    tests can check and report if there are any changes.
    
    TEST:
    The passing tests look like:
    :::: Run shapelib update tests
    Shape Lib is up to date
    :::: Run torch_ods update tests
    Torch ODS is up to date
    
    Failing would like like:
    
    anush@sdp ~/github/torch-mlir % time ./build_tools/update_shape_lib.sh
    PYTHONPATH=/home/anush/github/torch-mlir/build/tools/torch-mlir/python_packages/torch_mlir python -m torch_mlir.dialects.torch.importer.jit_ir.build_tools.shape_lib_gen --pytorch_op_extensions= --torch_transforms_cpp_dir=/home/anush/github/torch-mlir/lib/Dialect/Torch
    /Transforms
    Generated files are not up to date (see diff below)
    >>> Please run ./build_tools/update_torch_ods.sh and ./build_tools/update_shape_lib.sh <<<
    diff --git a/lib/Dialect/Torch/Transforms/ShapeLibrary.cpp b/lib/Dialect/Torch/Transforms/ShapeLibrary.cpp
    index f7a8f69c..a780ee33 100644
    --- a/lib/Dialect/Torch/Transforms/ShapeLibrary.cpp
    +++ b/lib/Dialect/Torch/Transforms/ShapeLibrary.cpp
    @@ -14,6 +14,8 @
    
     #include "torch-mlir/Dialect/Torch/Transforms/Passes.h"
    
    +foo
    +
     using namespace mlir;
    
     StringRef mlir::torch::Torch::getShapeLibrary() {
    ./build_tools/update_shape_lib.sh  0.02s user 0.01s system 104% cpu 0.035 total
    
    I updated the CI to not hard fail when there is diff. If we pin Pytorch
    we can hard fail in the future
    powderluv committed Aug 31, 2022
    Configuration menu
    Copy the full SHA
    ad2b115 View commit details
    Browse the repository at this point in the history