Skip to content

Bump PyTorch pin to 20250706 #12253

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion .ci/docker/ci_commit_pins/pytorch.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
9b498d3bb28b8e3411ce464dd2755c5b96d92c8f
7cda4017ddda554752e89069ae205be5e8388f59
2 changes: 1 addition & 1 deletion .ci/scripts/check_c10_sync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ pushd pytorch
git checkout "$pytorch_pin"
popd
"$(dirname "${BASH_SOURCE[0]}")"/compare_dirs.sh runtime/core/portable_type/c10/c10 pytorch/c10
"$(dirname "${BASH_SOURCE[0]}")"/compare_dirs.sh runtime/core/portable_type/c10/torch/standalone pytorch/torch/standalone
"$(dirname "${BASH_SOURCE[0]}")"/compare_dirs.sh runtime/core/portable_type/c10/torch/headeronly pytorch/torch/headeronly
6 changes: 3 additions & 3 deletions install_requirements.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def python_is_compatible():
#
# NOTE: If you're changing, make the corresponding change in .ci/docker/ci_commit_pins/pytorch.txt
# by picking the hash from the same date in https://hud.pytorch.org/hud/pytorch/pytorch/nightly/
NIGHTLY_VERSION = "dev20250625"
NIGHTLY_VERSION = "dev20250706"


def install_requirements(use_pytorch_nightly):
Expand All @@ -89,7 +89,7 @@ def install_requirements(use_pytorch_nightly):
# Setting use_pytorch_nightly to false to test the pinned PyTorch commit. Note
# that we don't need to set any version number there because they have already
# been installed on CI before this step, so pip won't reinstall them
f"torch==2.8.0.{NIGHTLY_VERSION}" if use_pytorch_nightly else "torch",
f"torch==2.9.0.{NIGHTLY_VERSION}" if use_pytorch_nightly else "torch",
]

# Install the requirements for core ExecuTorch package.
Expand Down Expand Up @@ -151,7 +151,7 @@ def install_optional_example_requirements(use_pytorch_nightly):
print("Installing torch domain libraries")
DOMAIN_LIBRARIES = [
(
f"torchvision==0.23.0.{NIGHTLY_VERSION}"
f"torchvision==0.24.0.{NIGHTLY_VERSION}"
if use_pytorch_nightly
else "torchvision"
),
Expand Down
2 changes: 1 addition & 1 deletion runtime/core/portable_type/c10/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ would cause all headers in that directory to be includeable with
`runtime/core/portable_type/complex.h`, which would shadow the C99
`complex.h` standard header.

`torch/standalone` has been added as an extra "even more bottom of
`torch/headeronly` has been added as an extra "even more bottom of
stack" directory in PyTorch, so we have to add it to our sync
here. The extra "stutter" c10 directory causing `c10/torch/standlone`
is unfortunately awkward; perhaps we can rename the top-level
Expand Down
2 changes: 1 addition & 1 deletion runtime/core/portable_type/c10/c10/macros/Export.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <c10/macros/cmake_macros.h>
#endif // C10_USING_CUSTOM_GENERATED_MACROS

#include <torch/standalone/macros/Export.h>
#include <torch/headeronly/macros/Export.h>

// This one is being used by libtorch.so
#ifdef CAFFE2_BUILD_MAIN_LIB
Expand Down
16 changes: 15 additions & 1 deletion runtime/core/portable_type/c10/c10/macros/Macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,21 @@ constexpr uint32_t CUDA_THREADS_PER_BLOCK_FALLBACK = 256;
#endif

#if defined(USE_ROCM)
#define C10_WARP_SIZE warpSize // = 64 or 32 (Defined in hip_runtime.h)
// C10_WARP_SIZE is only allowed for device code.
// Host code _must_ use at::cuda::warp_size()
// HIP header used to define warpSize as a constexpr that was either 32 or 64
// depending on the target device, and then always set it to 64 for host code.
// Host pass of HIP compiler needs C10_WARP_SIZE defined to _something_ so we
// set it to something unreasonable to trigger obvious host code errors.
#if defined(__HIP_DEVICE_COMPILE__)
#if defined(__GFX9__)
static constexpr int C10_WARP_SIZE = 64;
#else // __GFX9__
static constexpr int C10_WARP_SIZE = 32;
#endif // __GFX9__
#else
static constexpr int C10_WARP_SIZE = 1;
#endif // __HIP_DEVICE_COMPILE__
#else
#define C10_WARP_SIZE 32
#endif
Expand Down
2 changes: 1 addition & 1 deletion runtime/core/portable_type/c10/c10/targets.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def define_common_targets():
"@EXECUTORCH_CLIENTS",
],
exported_deps = [
"//executorch/runtime/core/portable_type/c10/torch/standalone:torch_standalone_headers",
"//executorch/runtime/core/portable_type/c10/torch/headeronly:torch_headeronly",
] + select({
"DEFAULT": [],
# Half-inl.h depends on vec_half.h from ATen, but only when building for x86.
Expand Down
2 changes: 1 addition & 1 deletion runtime/core/portable_type/c10/c10/util/irange.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ struct integer_iterator {
using pointer = I*;
using reference = I&;

explicit constexpr integer_iterator(I value) : value(value) {}
explicit constexpr integer_iterator(I val) : value(val) {}

constexpr I operator*() const {
return value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def define_common_targets():
"""

runtime.cxx_library(
name = "torch_standalone_headers",
name = "torch_headeronly",
exported_headers = glob(["**/*.h"]),
header_namespace = "torch/standalone",
header_namespace = "torch/headeronly",
)
2 changes: 1 addition & 1 deletion scripts/build_apple_frameworks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ sed -i '' '1i\
' \
"$HEADERS_ABSOLUTE_PATH/executorch/runtime/core/portable_type/c10/c10/macros/Macros.h" \
"$HEADERS_ABSOLUTE_PATH/executorch/runtime/core/portable_type/c10/c10/macros/Export.h" \
"$HEADERS_ABSOLUTE_PATH/executorch/runtime/core/portable_type/c10/torch/standalone/macros/Export.h"
"$HEADERS_ABSOLUTE_PATH/executorch/runtime/core/portable_type/c10/torch/headeronly/macros/Export.h"

cp -r $HEADERS_ABSOLUTE_PATH/executorch/runtime/core/portable_type/c10/c10 "$HEADERS_ABSOLUTE_PATH/"
cp -r $HEADERS_ABSOLUTE_PATH/executorch/runtime/core/portable_type/c10/torch "$HEADERS_ABSOLUTE_PATH/"
Expand Down
Loading