From b66eebd84de12c11d27257a06693b24ae2d1368c Mon Sep 17 00:00:00 2001 From: raayandhar Date: Wed, 15 Oct 2025 19:36:38 +0000 Subject: [PATCH 1/3] fix separate error about handling Signed-off-by: raayandhar --- build_tools/cmake/TorchMLIRPyTorch.cmake | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/build_tools/cmake/TorchMLIRPyTorch.cmake b/build_tools/cmake/TorchMLIRPyTorch.cmake index 53253c8c7e14..769114da5d90 100644 --- a/build_tools/cmake/TorchMLIRPyTorch.cmake +++ b/build_tools/cmake/TorchMLIRPyTorch.cmake @@ -70,10 +70,15 @@ function(TorchMLIRConfigurePyTorch) # Check ABI compatibility version execute_process( COMMAND ${Python3_EXECUTABLE} - -c "import torch; import sys; abi=torch._C._PYBIND11_BUILD_ABI; abi.startswith('_cxxabi10') or sys.exit(1); sys.stdout.write(str(abi[-2:]))" + -c "import torch; import os; print(os.path.join(os.path.dirname(torch.__file__), 'lib', 'libtorch_python.so'), end='')" RESULT_VARIABLE _result WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - OUTPUT_VARIABLE _cxx_abi_version) + OUTPUT_VARIABLE _libtorch_python_path) + execute_process( + COMMAND bash "-c" "strings ${_libtorch_python_path} | grep -E '^_cxxabi[0-9]{4}' | head -1 | grep -oE '..$'" + RESULT_VARIABLE _result + OUTPUT_VARIABLE _cxx_abi_version + OUTPUT_STRIP_TRAILING_WHITESPACE) if(_result) message(FATAL_ERROR "Failed to determine C++ ABI version") endif() From d7067d3e65341a73c1979699543319d3136c7dfe Mon Sep 17 00:00:00 2001 From: raayandhar Date: Wed, 15 Oct 2025 19:56:14 +0000 Subject: [PATCH 2/3] wrong search for cxx, fixed now Signed-off-by: raayandhar --- build_tools/cmake/TorchMLIRPyTorch.cmake | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/build_tools/cmake/TorchMLIRPyTorch.cmake b/build_tools/cmake/TorchMLIRPyTorch.cmake index 769114da5d90..ec71d571ba1c 100644 --- a/build_tools/cmake/TorchMLIRPyTorch.cmake +++ b/build_tools/cmake/TorchMLIRPyTorch.cmake @@ -74,13 +74,16 @@ function(TorchMLIRConfigurePyTorch) RESULT_VARIABLE _result WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} OUTPUT_VARIABLE _libtorch_python_path) + if(_result OR NOT EXISTS "${_libtorch_python_path}") + message(FATAL_ERROR "Failed to locate libtorch_python.so at ${_libtorch_python_path}") + endif() execute_process( - COMMAND bash "-c" "strings ${_libtorch_python_path} | grep -E '^_cxxabi[0-9]{4}' | head -1 | grep -oE '..$'" + COMMAND bash "-c" "strings '${_libtorch_python_path}' | grep -E '^CXXABI_1\\.3\\.[0-9]+$' | sort -V | tail -1 | grep -oE '[0-9]+$'" RESULT_VARIABLE _result OUTPUT_VARIABLE _cxx_abi_version OUTPUT_STRIP_TRAILING_WHITESPACE) - if(_result) - message(FATAL_ERROR "Failed to determine C++ ABI version") + if(_result OR NOT _cxx_abi_version) + message(FATAL_ERROR "Failed to determine C++ ABI version from ${_libtorch_python_path}") endif() message(STATUS "PyTorch C++ ABI version: \"${_cxx_abi_version}\"") From ccf8efafbdcbfad546c7bfbc7d6a308e07efb511 Mon Sep 17 00:00:00 2001 From: raayandhar Date: Thu, 16 Oct 2025 21:58:35 +0000 Subject: [PATCH 3/3] try updating nightly to 2.10? Signed-off-by: raayandhar --- pytorch-requirements.txt | 2 +- torchvision-requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pytorch-requirements.txt b/pytorch-requirements.txt index 87cbf28f5a98..ac81781a6b2b 100644 --- a/pytorch-requirements.txt +++ b/pytorch-requirements.txt @@ -1,3 +1,3 @@ -f https://download.pytorch.org/whl/nightly/cpu/torch/ --pre -torch==2.9.0.dev20250820 +torch==2.10.0.dev20251016 diff --git a/torchvision-requirements.txt b/torchvision-requirements.txt index 68c96010c96f..546bfb138e43 100644 --- a/torchvision-requirements.txt +++ b/torchvision-requirements.txt @@ -1,3 +1,3 @@ -f https://download.pytorch.org/whl/nightly/cpu/torchvision/ --pre -torchvision==0.24.0.dev20250820 +torchvision==0.25.0.dev20251016