Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions build_tools/cmake/TorchMLIRPyTorch.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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}\"")

Expand Down
2 changes: 1 addition & 1 deletion pytorch-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
-f https://download.pytorch.org/whl/nightly/cpu/torch/
--pre
torch==2.9.0.dev20250820
torch==2.10.0.dev20251016
2 changes: 1 addition & 1 deletion torchvision-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
-f https://download.pytorch.org/whl/nightly/cpu/torchvision/
--pre
torchvision==0.24.0.dev20250820
torchvision==0.25.0.dev20251016
Loading