openxla / stablehlo

Backward compatible ML compute opset inspired by HLO/MHLO
Apache License 2.0
357 stars 100 forks source link

fix StablehloConvertToSignless linkage #2387

Closed Connor-XY closed 3 weeks ago

Connor-XY commented 4 weeks ago

StablehloPasses needs to link StablehloLinalgTransforms since StablehloConvertToSignless needs RemoveSignTypeConverter from linalg/transforms/TypeConversion

google-cla[bot] commented 4 weeks ago

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

sdasgup3 commented 4 weeks ago

Thanks a lot for your contribution! Can you please tell us bit more about your setup where the linker fails?

The change SGTM. Can you please add the similar dependency linalg_passes to BUILD.bazel file here

Connor-XY commented 4 weeks ago

Thanks a lot for your contribution! Can you please tell us bit more about your setup where the linker fails?

I am trying to upgrade LLVM in onnx-mlir, where I found the linkage error here:

[ 80%] Linking CXX shared library ../../../../Release/lib/libStablehloPasses.so
CMakeFiles/obj.StablehloPasses.dir/StablehloConvertToSignless.cpp.o: In function `mlir::stablehlo::(anonymous namespace)::StablehloConvertToSignlessPass::runOnOperation()':
StablehloConvertToSignless.cpp:(.text._ZN4mlir9stablehlo12_GLOBAL__N_130StablehloConvertToSignlessPass14runOnOperationEv+0x118): undefined reference to `mlir::stablehlo::RemoveSignTypeConverter::RemoveSignTypeConverter()'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [third_party/stablehlo/stablehlo/transforms/CMakeFiles/StablehloPasses.dir/build.make:183: Release/lib/libStablehloPasses.so.19.0git] Error 1
make[1]: *** [CMakeFiles/Makefile2:8699: third_party/stablehlo/stablehlo/transforms/CMakeFiles/StablehloPasses.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

The change SGTM. Can you please add the similar dependency linalg_passes to BUILD.bazel file

It is already added there, though it is missing in the CMake file.

Connor-XY commented 3 weeks ago

@sdasgup3 Can you trigger the CI workflows please?