Repository navigation
[ROCm] enable test_api (test_libtorch) cpp unit tests - #106712
hongxiayang wants to merge 1 commit into
Conversation
|
@pytorchbot label ciflow/trunk |
|
@pytorchbot label "topic: not user facing" |
|
test_api tests are enabled and running in the ci. For example, from the log: |
| echo "Testing libtorch" | ||
| ln -sf "$TORCH_LIB_DIR"/libbackend_with_compiler.so "$TORCH_BIN_DIR" | ||
| ln -sf "$TORCH_LIB_DIR"/libjitbackend_test.so "$TORCH_BIN_DIR" | ||
| ln -sf "$TORCH_LIB_DIR"/libcaffe2_nvrtc.so "$TORCH_BIN_DIR" |
There was a problem hiding this comment.
Makes me wonder how that library was being installed for CUDA builds
|
rocm5.6 tests are successful. |
|
@pytorchbot merge -f "Unrelated CI failures" |
Merge startedYour change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
On ROCm, test_api, test_jit and test_cpp_rpc fail `--help` with "libaotriton_v2.so.0.14.1: cannot open shared object file". test.sh symlinks libtorch* into torch/bin, so the test binary loads libtorch_hip.so through that symlink, glibc sets its $ORIGIN to torch/bin, and its own dependencies in torch/lib (AOTriton, and before that libcaffe2_nvrtc.so, which pytorch#106712 patched with one more symlink) are not found. The symlinks were added in pytorch#62797 because the installed test binaries had no RUNPATH; pytorch#136627 gave them $ORIGIN/../lib, so they are no longer needed. This removes them for test_libtorch, the distributed C++ tests and test_rpc. test_aot_compilation and test_vulkan keep theirs: test_mobile_nnc, aot_model_compiler_test and the vulkan tests never got that RUNPATH. Test Plan: With the torch/bin and torch/lib from this PR's mi350 wheel and CI's LD_LIBRARY_PATH: with the symlinks, `test_api --help` exits 127 with the CI error; without them, test_api, test_jit, test_lazy, test_cpp_rpc and the c10d store and process-group tests start, pytest-cpp collects 1024 and 588 tests from test_api and test_jit, and FunctionalTest.Conv1d (the libcaffe2_nvrtc.so case) passes on gfx950: ``` torch/bin/test_api --gtest_filter='FunctionalTest.Conv1d*' python -m pytest torch/bin/test_api --collect-only -q ``` This change was developed with the assistance of an AI assistant (Claude).
This is part of effort to enable missed cpp tests for ROCm platform.
In this change,
cc @jeffdaily @sunway513 @jithunnair-amd @pruthvistony @ROCmSupport @dllehr-amd @jataylo