diff --git a/build_tools/cmake/TorchMLIRPyTorch.cmake b/build_tools/cmake/TorchMLIRPyTorch.cmake index 53253c8c7e14..ec71d571ba1c 100644 --- a/build_tools/cmake/TorchMLIRPyTorch.cmake +++ b/build_tools/cmake/TorchMLIRPyTorch.cmake @@ -70,12 +70,20 @@ 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) - if(_result) - message(FATAL_ERROR "Failed to determine C++ ABI version") + 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_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 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}\"") 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