From c12bef50fa958b44c0750a053e3fd3f263790960 Mon Sep 17 00:00:00 2001 From: "A bot of @njzjz" Date: Wed, 4 Nov 2026 02:01:50 +0800 Subject: [PATCH 1/3] ci: use PyTorch 2.15 for Python 3.11+ CPU tests Keep the PyTorch 2.11 pin for Python 3.10 and preserve the macOS Intel fallback and GPU test pin. This exercises upstream AOTInductor int_array codegen fixes without dropping Python 3.10 coverage. Agent: ChatGPT Model: GPT-6 --- pyproject.toml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 774cd08fa5..5b8dbd4393 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -187,7 +187,12 @@ pin_tensorflow_gpu = [ pin_pytorch_cpu = [ # https://github.com/pytorch/pytorch/issues/114602 # macos x86 has been deprecated - "torch==2.11.0; platform_machine!='x86_64' or platform_system != 'Darwin'", + # Python 3.10 is not supported by torch 2.15; keep its older pin. + # torch 2.15 includes the AOTInductor C++ int_array declaration fixes: + # https://github.com/pytorch/pytorch/pull/178147 + # https://github.com/pytorch/pytorch/pull/193621 + "torch==2.11.0; python_version<'3.11' and (platform_machine!='x86_64' or platform_system != 'Darwin')", + "torch==2.15.0; python_version>='3.11' and (platform_machine!='x86_64' or platform_system != 'Darwin')", "torch; platform_machine=='x86_64' and platform_system == 'Darwin'", ] pin_pytorch_gpu = [ From 8cfe231ac19af792c8fc87e02da22d35483be693 Mon Sep 17 00:00:00 2001 From: "A bot of @njzjz" Date: Wed, 4 Nov 2026 02:43:49 +0800 Subject: [PATCH 2/3] fix(ci): use supported PyTorch 2.13 CPU pin Use the supported 2.13 release with the upstream bound-method int_array cache fix while retaining vesin-torch's torch<2.15 compatibility. Preserve the Python 3.10 pin and macOS Intel fallback. Validation: real PT native build on Python 3.13.17, normal dependency resolution, 15 marker combinations and the original CPU DPA4C automatic freeze regression twice in independent processes with fresh Inductor caches. Both runs passed without skips. Full Ruff 0.16 and whitespace checks pass. Agent: ChatGPT Model: GPT-6 Astra Pro --- pyproject.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 5b8dbd4393..e295328dea 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -187,12 +187,12 @@ pin_tensorflow_gpu = [ pin_pytorch_cpu = [ # https://github.com/pytorch/pytorch/issues/114602 # macos x86 has been deprecated - # Python 3.10 is not supported by torch 2.15; keep its older pin. - # torch 2.15 includes the AOTInductor C++ int_array declaration fixes: + # Keep the established Python 3.10 pin; use 2.13 for newer CPU tests. + # torch 2.13 includes the AOTInductor int_array cache fix for bound methods: # https://github.com/pytorch/pytorch/pull/178147 - # https://github.com/pytorch/pytorch/pull/193621 + # vesin-torch 0.6.2 requires torch<2.15. "torch==2.11.0; python_version<'3.11' and (platform_machine!='x86_64' or platform_system != 'Darwin')", - "torch==2.15.0; python_version>='3.11' and (platform_machine!='x86_64' or platform_system != 'Darwin')", + "torch==2.13.0; python_version>='3.11' and (platform_machine!='x86_64' or platform_system != 'Darwin')", "torch; platform_machine=='x86_64' and platform_system == 'Darwin'", ] pin_pytorch_gpu = [ From cd035fc6ace18d973d7db3fc5cdf5231c275b100 Mon Sep 17 00:00:00 2001 From: "A bot of @njzjz" Date: Wed, 4 Nov 2026 03:02:46 +0800 Subject: [PATCH 3/3] fix(build): use C++20 for MSVC with PyTorch 2.13 Torch 2.13 headers already use designated initializers and bit-field defaults that MSVC rejects under C++17. Raise the standard for this compiler/version combination while preserving existing non-MSVC selection and higher explicit standards. Agent: ChatGPT Model: GPT-6 Astra Pro --- source/CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index 4ccc18542c..f28545c309 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -404,8 +404,10 @@ if(ENABLE_PYTORCH AND NOT DEEPMD_C_ROOT) else() set(DEEPMD_TORCH_HAS_CUDA FALSE) endif() - # PyTorch 2.14 raised the minimum C++ standard from C++17 to C++20. - if(NOT Torch_VERSION VERSION_LESS "2.14.0") + # PyTorch 2.14 requires C++20. MSVC also needs it for the designated + # initializers and bit-field defaults already present in PyTorch 2.13 headers. + if(NOT Torch_VERSION VERSION_LESS "2.14.0" + OR (MSVC AND NOT Torch_VERSION VERSION_LESS "2.13.0")) set_if_higher(CMAKE_CXX_STANDARD 20) elseif(NOT Torch_VERSION VERSION_LESS "2.1.0") set_if_higher(CMAKE_CXX_STANDARD 17)