CD Enable Python 3.13 on windows (#138095)

Adding CD windows. Part of: https://github.com/pytorch/pytorch/issues/130249
Builder PR landed with smoke test: https://github.com/pytorch/builder/pull/2035

Pull Request resolved: https://github.com/pytorch/pytorch/pull/138095
Approved by: https://github.com/Skylion007, https://github.com/malfet
This commit is contained in:
atalman
2024-11-12 12:28:10 +00:00
committed by PyTorch MergeBot
parent ff91fcc991
commit 51e8a13d00
4 changed files with 1361 additions and 3 deletions

View File

@ -371,15 +371,23 @@ def generate_wheels_matrix(
# TODO: Enable python 3.13 on rocm, aarch64, windows
if (
gpu_arch_type == "rocm"
or os not in ["linux", "linux-s390x", "linux-aarch64", "macos-arm64"]
or os
not in [
"linux",
"linux-s390x",
"linux-aarch64",
"macos-arm64",
"windows",
]
) and python_version in ["3.13", "3.13t"]:
continue
# TODO: Enable python 3.13t on xpu and cpu-s390x or MacOS
# TODO: Enable python 3.13t on xpu and cpu-s390x or MacOS or Windows
if (
gpu_arch_type in ["xpu", "cpu-s390x"]
or os == "macos-arm64"
or os == "linux-aarch64"
or os == "windows"
) and python_version == "3.13t":
continue

File diff suppressed because it is too large Load Diff

View File

@ -38,6 +38,7 @@ PyObject* Dim_init() {
#include "python_variable_simple.h"
#if IS_PYTHON_3_11_PLUS
#define Py_BUILD_CORE
#include "internal/pycore_opcode.h"
#undef Py_BUILD_CORE

View File

@ -1,6 +1,17 @@
#include <torch/csrc/utils/python_compat.h>
#if defined(_WIN32) && IS_PYTHON_3_11_PLUS
#define Py_BUILD_CORE
#define NEED_OPCODE_TABLES
#define NEED_OPCODE_TABLES // To get _PyOpcode_Deopt, _PyOpcode_Caches
#if IS_PYTHON_3_13_PLUS
#include <cpython/code.h> // To get PyUnstable_Code_GetFirstFree
#define NEED_OPCODE_METADATA
#include "internal/pycore_opcode_metadata.h"
#undef NEED_OPCODE_METADATA
#else
#include "internal/pycore_opcode.h"
#endif
#undef NEED_OPCODE_TABLES
#undef Py_BUILD_CORE
#endif