From 727aee74a1514a3e3fe42856d9078dfececa1d78 Mon Sep 17 00:00:00 2001 From: Jacob Szwejbka Date: Wed, 15 Jul 2026 10:22:40 -0700 Subject: [PATCH] Bump PyTorch pin to 2.13 --- .ci/docker/ci_commit_pins/pytorch.txt | 2 +- .ci/docker/common/install_pytorch.sh | 18 +++- .ci/scripts/setup-windows.ps1 | 4 + .ci/scripts/test_model_e2e_windows.ps1 | 19 ++++- .ci/scripts/utils.sh | 4 +- .github/workflows/mlx.yml | 4 +- backends/aoti/common_shims.cpp | 5 ++ backends/aoti/common_shims.h | 3 + backends/aoti/common_shims_slim.cpp | 8 ++ backends/aoti/common_shims_slim.h | 3 + backends/aoti/tests/test_common_shims.cpp | 20 +++++ .../aoti/tests/test_common_shims_slim.cpp | 66 +++++++++++++++ backends/cuda/cuda_backend.py | 22 ++++- backends/cuda/runtime/aoti_cuda_shims.lib | Bin 12504 -> 12738 bytes backends/cuda/tests/test_cuda_export.py | 41 ++++++++++ examples/models/dinov2/CMakeLists.txt | 4 +- examples/models/llama/install_requirements.sh | 13 ++- examples/models/parakeet/CMakeLists.txt | 4 +- examples/models/qwen3_5_moe/export.py | 8 ++ examples/models/sortformer/CMakeLists.txt | 4 +- .../models/voxtral_realtime/CMakeLists.txt | 4 +- extension/llm/export/nvfp4.py | 8 +- install_requirements.py | 77 ++++++++++-------- requirements-examples.txt | 2 +- .../c10/c10/util/BFloat16-math.h | 2 +- .../portable_type/c10/c10/util/complex_math.h | 2 +- .../c10/torch/headeronly/util/Half.h | 2 +- third-party/ao | 2 +- torch_pin.py | 2 +- 29 files changed, 294 insertions(+), 59 deletions(-) diff --git a/.ci/docker/ci_commit_pins/pytorch.txt b/.ci/docker/ci_commit_pins/pytorch.txt index 242371cbebe..401a0594d98 100644 --- a/.ci/docker/ci_commit_pins/pytorch.txt +++ b/.ci/docker/ci_commit_pins/pytorch.txt @@ -1 +1 @@ -release/2.12 +release/2.13 diff --git a/.ci/docker/common/install_pytorch.sh b/.ci/docker/common/install_pytorch.sh index 3c80d093ab2..c55e3ac878d 100755 --- a/.ci/docker/common/install_pytorch.sh +++ b/.ci/docker/common/install_pytorch.sh @@ -16,6 +16,21 @@ install_domains() { pip_install --no-build-isolation --user "git+https://github.com/pytorch/vision.git@${TORCHVISION_VERSION}" } +configure_pytorch_compiler() { + local cxx_version + cxx_version=$(/usr/bin/c++ --version | head -n1) + if [[ "${cxx_version}" == *clang* ]]; then + local clang_major + clang_major=$(/usr/bin/c++ -dumpversion | cut -d. -f1) + if [[ "${clang_major}" =~ ^[0-9]+$ && "${clang_major}" -lt 16 ]] && + command -v gcc >/dev/null && + command -v g++ >/dev/null; then + export CC=gcc + export CXX=g++ + fi + fi +} + install_pytorch_and_domains() { git clone https://github.com/pytorch/pytorch.git @@ -33,6 +48,7 @@ install_pytorch_and_domains() { if [[ -n "${PYTORCH_BUILD_MAX_JOBS:-}" ]]; then export MAX_JOBS="${PYTORCH_BUILD_MAX_JOBS}" fi + configure_pytorch_compiler # Then build and install PyTorch conda_run python setup.py bdist_wheel pip_install "$(echo dist/*.whl)" @@ -40,7 +56,7 @@ install_pytorch_and_domains() { # Grab the pinned audio and vision commits from PyTorch TORCHAUDIO_VERSION=release/2.11 export TORCHAUDIO_VERSION - TORCHVISION_VERSION=release/0.27 + TORCHVISION_VERSION=release/0.28 export TORCHVISION_VERSION install_domains diff --git a/.ci/scripts/setup-windows.ps1 b/.ci/scripts/setup-windows.ps1 index 2cf28e0cdfe..a38d43bbfd8 100644 --- a/.ci/scripts/setup-windows.ps1 +++ b/.ci/scripts/setup-windows.ps1 @@ -14,6 +14,10 @@ conda activate et # Install test dependencies pip install -r .ci/docker/requirements-ci.txt +# PyTorch 2.13 headers use designated initializers in c10, which require C++20 +# with MSVC. +$env:CMAKE_ARGS = "$env:CMAKE_ARGS -DCMAKE_CXX_STANDARD=20" + # The Windows CI image ships CUDA toolkits on PATH, so install_executorch # (setup.py) auto-enables EXECUTORCH_BUILD_CUDA whenever the detected nvcc # version is in SUPPORTED_CUDA_VERSIONS. CPU-only jobs install CPU torch, so a diff --git a/.ci/scripts/test_model_e2e_windows.ps1 b/.ci/scripts/test_model_e2e_windows.ps1 index 73a78c92112..5a2d8eccf00 100644 --- a/.ci/scripts/test_model_e2e_windows.ps1 +++ b/.ci/scripts/test_model_e2e_windows.ps1 @@ -172,22 +172,35 @@ try { "-DCUDAToolkit_ROOT=$env:CUDA_HOME" ) } + $cmakeCommonArgs = @("-DCMAKE_CXX_STANDARD=20") Write-Host "::endgroup::" Write-Host "::group::Build ExecuTorch (CUDA)" $numCores = [Math]::Max([Environment]::ProcessorCount - 1, 1) + $cmakeOut = Join-Path -Path $executorchRoot -ChildPath "cmake-out" + $executorchCmakeDir = Join-Path -Path $cmakeOut -ChildPath "lib\cmake\ExecuTorch" + $executorchConfig = Join-Path -Path $executorchCmakeDir -ChildPath "executorch-config.cmake" # EXECUTORCH_BUILD_EXTENSION_IMAGE defaults OFF in the preset, so it must be # enabled explicitly here (matching the Makefile CUDA target used on Linux). # The dinov2 runner links the installed extension_image.lib; without this the # main install never builds it and dinov2_runner fails to link (LNK1181). - cmake --preset llm-release-cuda -DEXECUTORCH_BUILD_EXTENSION_IMAGE=ON @cmakeCudaArgs - cmake --build cmake-out --target install --config Release -j $numCores + cmake --preset llm-release-cuda -DEXECUTORCH_BUILD_EXTENSION_IMAGE=ON @cmakeCommonArgs @cmakeCudaArgs + cmake --build $cmakeOut --config Release -j $numCores + cmake --install $cmakeOut --config Release + if (-not (Test-Path -Path $executorchConfig -PathType Leaf)) { + throw "ExecuTorch CMake package config not found after install: $executorchConfig" + } Write-Host "::endgroup::" Write-Host "::group::Build $runnerTarget" + $cmakePackageArgs = @( + "-DCMAKE_FIND_ROOT_PATH=$cmakeOut", + "-DCMAKE_PREFIX_PATH=$cmakeOut;$executorchCmakeDir", + "-Dexecutorch_DIR=$executorchCmakeDir" + ) Push-Location (Join-Path -Path $executorchRoot -ChildPath "examples\models\$runnerPath") try { - cmake --preset $runnerPreset @cmakeCudaArgs + cmake --preset $runnerPreset @cmakeCommonArgs @cmakePackageArgs @cmakeCudaArgs cmake --build (Join-Path -Path $executorchRoot -ChildPath "cmake-out\examples\models\$runnerPath") --target $runnerTarget --config Release -j $numCores } finally { diff --git a/.ci/scripts/utils.sh b/.ci/scripts/utils.sh index b312d0ede83..234e162e48e 100644 --- a/.ci/scripts/utils.sh +++ b/.ci/scripts/utils.sh @@ -107,7 +107,7 @@ install_pytorch_and_domains() { local torch_release=$(cat version.txt) # Download key must match the upload key below (basename of dist/*.whl, # which always carries setup.py's resolved +gitHASH). Branch-ref pins - # like `release/2.12` would otherwise produce `+gitrelease` here and + # like `release/2.13` would otherwise produce `+gitrelease` here and # never hit the cache. local torch_short_hash=$(git rev-parse --short=7 HEAD) local torch_wheel_path="cached_artifacts/pytorch/executorch/pytorch_wheels/${system_name}/${python_version}" @@ -178,7 +178,7 @@ install_pytorch_and_domains() { # Grab the pinned audio and vision commits from PyTorch TORCHAUDIO_VERSION=release/2.11 export TORCHAUDIO_VERSION - TORCHVISION_VERSION=release/0.27 + TORCHVISION_VERSION=release/0.28 export TORCHVISION_VERSION install_domains diff --git a/.github/workflows/mlx.yml b/.github/workflows/mlx.yml index 40ebabbcf28..0de68134c4e 100644 --- a/.github/workflows/mlx.yml +++ b/.github/workflows/mlx.yml @@ -158,10 +158,10 @@ jobs: --prompt-len 4 \ --max-new-tokens 5 2>&1) echo "$OUTPUT" - if echo "$OUTPUT" | grep -q "Generated token ids: \[167, 94, 253, 88, 227\]"; then + if echo "$OUTPUT" | grep -q "Generated token ids: \[167, 180, 167, 180, 167\]"; then echo "Success: Qwen 3.5 MoE MLX export + inference completed with expected output" else - echo "Failed: unexpected output (expected [167, 94, 253, 88, 227])" + echo "Failed: unexpected output (expected [167, 180, 167, 180, 167])" exit 1 fi echo "::endgroup::" diff --git a/backends/aoti/common_shims.cpp b/backends/aoti/common_shims.cpp index 49d445e955d..f3a34a09987 100644 --- a/backends/aoti/common_shims.cpp +++ b/backends/aoti/common_shims.cpp @@ -154,6 +154,11 @@ AOTITorchError aoti_torch_get_dim(Tensor* tensor, int64_t* ret_dim) { return Error::Ok; } +AOTITorchError aoti_torch_get_numel(Tensor* tensor, int64_t* ret_numel) { + *ret_numel = static_cast(tensor->numel()); + return Error::Ok; +} + // Device and layout utility functions int32_t aoti_torch_device_type_cpu() { // Let's say cpu is 0 for ET as well diff --git a/backends/aoti/common_shims.h b/backends/aoti/common_shims.h index 869aece5a3b..d057279e22a 100644 --- a/backends/aoti/common_shims.h +++ b/backends/aoti/common_shims.h @@ -59,6 +59,9 @@ aoti_torch_get_device_index(Tensor* tensor, int32_t* ret_device_index); AOTI_SHIM_EXPORT AOTITorchError aoti_torch_get_dim(Tensor* tensor, int64_t* ret_dim); +AOTI_SHIM_EXPORT AOTITorchError +aoti_torch_get_numel(Tensor* tensor, int64_t* ret_numel); + // Utility functions for device and layout information AOTI_SHIM_EXPORT int32_t aoti_torch_device_type_cpu(); AOTI_SHIM_EXPORT int32_t aoti_torch_layout_strided(); diff --git a/backends/aoti/common_shims_slim.cpp b/backends/aoti/common_shims_slim.cpp index f4b50400778..c8c7408aa62 100644 --- a/backends/aoti/common_shims_slim.cpp +++ b/backends/aoti/common_shims_slim.cpp @@ -60,6 +60,14 @@ AOTITorchError aoti_torch_get_dim(Tensor* tensor, int64_t* ret_dim) { return Error::Ok; } +AOTITorchError aoti_torch_get_numel(Tensor* tensor, int64_t* ret_numel) { + if (tensor == nullptr || ret_numel == nullptr) { + return Error::InvalidArgument; + } + *ret_numel = static_cast(tensor->numel()); + return Error::Ok; +} + int32_t aoti_torch_layout_strided() { // Slimtensor only support strided layout, the return value will always be 0, // a.k.a at::Layout::Strided; diff --git a/backends/aoti/common_shims_slim.h b/backends/aoti/common_shims_slim.h index 3ec867bcf6e..c5a5cab9413 100644 --- a/backends/aoti/common_shims_slim.h +++ b/backends/aoti/common_shims_slim.h @@ -48,6 +48,9 @@ aoti_torch_get_dtype(Tensor* tensor, int32_t* ret_dtype); AOTI_SHIM_EXPORT AOTITorchError aoti_torch_get_dim(Tensor* tensor, int64_t* ret_dim); +AOTI_SHIM_EXPORT AOTITorchError +aoti_torch_get_numel(Tensor* tensor, int64_t* ret_numel); + AOTI_SHIM_EXPORT int32_t aoti_torch_layout_strided(); // ============================================================ diff --git a/backends/aoti/tests/test_common_shims.cpp b/backends/aoti/tests/test_common_shims.cpp index 0fd1b057f99..b2dc2c01dc2 100644 --- a/backends/aoti/tests/test_common_shims.cpp +++ b/backends/aoti/tests/test_common_shims.cpp @@ -241,6 +241,21 @@ TEST_F(CommonShimsTest, ScalarTensor) { error = aoti_torch_get_sizes(tensor_0d, &sizes_ptr2); EXPECT_EQ(error, Error::Ok); EXPECT_EQ(sizes_ptr, sizes_ptr2); + + int64_t numel = -1; + error = aoti_torch_get_numel(tensor_0d, &numel); + EXPECT_EQ(error, Error::Ok); + EXPECT_EQ(numel, 1); +} + +TEST_F(CommonShimsTest, GetNumel) { + auto tensor = create_tracked_tensor({2, 3, 4}); + + int64_t numel = -1; + AOTITorchError error = aoti_torch_get_numel(tensor, &numel); + + EXPECT_EQ(error, Error::Ok); + EXPECT_EQ(numel, 24); } // Test large tensor dimensions @@ -266,6 +281,11 @@ TEST_F(CommonShimsTest, LargeTensorDimensions) { EXPECT_EQ(strides_ptr[1], 120000); EXPECT_EQ(strides_ptr[2], 400); EXPECT_EQ(strides_ptr[3], 1); + + int64_t numel = -1; + error = aoti_torch_get_numel(tensor, &numel); + EXPECT_EQ(error, Error::Ok); + EXPECT_EQ(numel, 2400000000); } // Test that cleanup_tensor_metadata clears the cache diff --git a/backends/aoti/tests/test_common_shims_slim.cpp b/backends/aoti/tests/test_common_shims_slim.cpp index 94319c6f94d..2dd8475a4d8 100644 --- a/backends/aoti/tests/test_common_shims_slim.cpp +++ b/backends/aoti/tests/test_common_shims_slim.cpp @@ -289,6 +289,50 @@ void runGetDimTest(slim_c10::DeviceType device_type) { } } +void runGetNumelTest(slim_c10::DeviceType device_type) { + slim_c10::Device device(device_type, 0); + + // Test 0D tensor (scalar) + { + std::vector sizes = {}; + std::vector strides = {}; + + Tensor* tensor = new Tensor(slim::empty_strided( + slim::makeArrayRef(sizes), + slim::makeArrayRef(strides), + slim_c10::ScalarType::Float, + device)); + + int64_t ret_numel = -1; + AOTITorchError error = aoti_torch_get_numel(tensor, &ret_numel); + + EXPECT_EQ(error, Error::Ok); + EXPECT_EQ(ret_numel, 1); + + delete tensor; + } + + // Test 3D tensor + { + std::vector sizes = {2, 3, 4}; + std::vector strides = calculateContiguousStrides(sizes); + + Tensor* tensor = new Tensor(slim::empty_strided( + slim::makeArrayRef(sizes), + slim::makeArrayRef(strides), + slim_c10::ScalarType::Float, + device)); + + int64_t ret_numel = -1; + AOTITorchError error = aoti_torch_get_numel(tensor, &ret_numel); + + EXPECT_EQ(error, Error::Ok); + EXPECT_EQ(ret_numel, 24); + + delete tensor; + } +} + // ============================================================================ // Storage & Device Property Tests // ============================================================================ @@ -400,6 +444,10 @@ TEST_F(CommonShimsSlimTest, GetDim_CPU) { runGetDimTest(slim_c10::DeviceType::CPU); } +TEST_F(CommonShimsSlimTest, GetNumel_CPU) { + runGetNumelTest(slim_c10::DeviceType::CPU); +} + TEST_F(CommonShimsSlimTest, GetStorageOffset_CPU) { runGetStorageOffsetTest(slim_c10::DeviceType::CPU); } @@ -456,6 +504,13 @@ TEST_F(CommonShimsSlimTest, GetDim_CUDA) { runGetDimTest(slim_c10::DeviceType::CUDA); } +TEST_F(CommonShimsSlimTest, GetNumel_CUDA) { + if (!isCudaAvailable()) { + GTEST_SKIP() << "CUDA not available"; + } + runGetNumelTest(slim_c10::DeviceType::CUDA); +} + TEST_F(CommonShimsSlimTest, GetStorageOffset_CUDA) { if (!isCudaAvailable()) { GTEST_SKIP() << "CUDA not available"; @@ -495,6 +550,7 @@ TEST_F(CommonShimsSlimTest, NullTensorArgument) { int64_t* strides = nullptr; int32_t dtype = -1; int64_t dim = -1; + int64_t numel = -1; EXPECT_EQ( aoti_torch_get_data_ptr(nullptr, &data_ptr), Error::InvalidArgument); @@ -502,6 +558,7 @@ TEST_F(CommonShimsSlimTest, NullTensorArgument) { EXPECT_EQ(aoti_torch_get_strides(nullptr, &strides), Error::InvalidArgument); EXPECT_EQ(aoti_torch_get_dtype(nullptr, &dtype), Error::InvalidArgument); EXPECT_EQ(aoti_torch_get_dim(nullptr, &dim), Error::InvalidArgument); + EXPECT_EQ(aoti_torch_get_numel(nullptr, &numel), Error::InvalidArgument); } TEST_F(CommonShimsSlimTest, NullReturnPointer) { @@ -512,6 +569,7 @@ TEST_F(CommonShimsSlimTest, NullReturnPointer) { EXPECT_EQ(aoti_torch_get_strides(tensor, nullptr), Error::InvalidArgument); EXPECT_EQ(aoti_torch_get_dtype(tensor, nullptr), Error::InvalidArgument); EXPECT_EQ(aoti_torch_get_dim(tensor, nullptr), Error::InvalidArgument); + EXPECT_EQ(aoti_torch_get_numel(tensor, nullptr), Error::InvalidArgument); } // ============================================================================ @@ -534,6 +592,7 @@ TEST_F(CommonShimsSlimTest, ScalarTensor) { int64_t* ret_sizes = nullptr; int64_t* ret_strides = nullptr; int64_t ret_dim = -1; + int64_t ret_numel = -1; EXPECT_EQ(aoti_torch_get_sizes(tensor, &ret_sizes), Error::Ok); EXPECT_NE(ret_sizes, nullptr); @@ -543,6 +602,9 @@ TEST_F(CommonShimsSlimTest, ScalarTensor) { EXPECT_EQ(aoti_torch_get_dim(tensor, &ret_dim), Error::Ok); EXPECT_EQ(ret_dim, 0); + + EXPECT_EQ(aoti_torch_get_numel(tensor, &ret_numel), Error::Ok); + EXPECT_EQ(ret_numel, 1); } TEST_F(CommonShimsSlimTest, LargeTensor) { @@ -559,6 +621,7 @@ TEST_F(CommonShimsSlimTest, LargeTensor) { int64_t* ret_sizes = nullptr; int64_t* ret_strides = nullptr; + int64_t ret_numel = -1; EXPECT_EQ(aoti_torch_get_sizes(tensor, &ret_sizes), Error::Ok); EXPECT_EQ(ret_sizes[0], 100); @@ -569,6 +632,9 @@ TEST_F(CommonShimsSlimTest, LargeTensor) { EXPECT_EQ(ret_strides[0], 60000); // 200 * 300 EXPECT_EQ(ret_strides[1], 300); // 300 EXPECT_EQ(ret_strides[2], 1); + + EXPECT_EQ(aoti_torch_get_numel(tensor, &ret_numel), Error::Ok); + EXPECT_EQ(ret_numel, 6000000); } TEST_F(CommonShimsSlimTest, ConsistentPointerReturn) { diff --git a/backends/cuda/cuda_backend.py b/backends/cuda/cuda_backend.py index ef746830bed..bf28077c62c 100644 --- a/backends/cuda/cuda_backend.py +++ b/backends/cuda/cuda_backend.py @@ -263,6 +263,13 @@ def _move_to_device_resize_kv(ep, location): return ep +def _on_off_compile_spec_value(spec: CompileSpec) -> bool: + value = spec.value.decode("utf-8").upper() + if value not in ["ON", "OFF"]: + raise ValueError(f"Invalid {spec.key}: {value}. Expected 'ON' or 'OFF'.") + return value == "ON" + + @final @experimental( "This API and all of cuda backend related functionality are experimental." @@ -496,12 +503,25 @@ def get_aoti_compile_options( # Parse compile_specs to check for platform platform = "linux" + emulate_precision_casts = True + max_autotune = True + autotune_at_compile_time = None shim_library_path = None for spec in compile_specs: if spec.key == "platform": platform = spec.value.decode("utf-8") - if spec.key == "shim_library_path": + elif spec.key == "emulate_precision_casts": + emulate_precision_casts = _on_off_compile_spec_value(spec) + elif spec.key == "max_autotune": + max_autotune = _on_off_compile_spec_value(spec) + elif spec.key == "autotune_at_compile_time": + autotune_at_compile_time = _on_off_compile_spec_value(spec) + elif spec.key == "shim_library_path": shim_library_path = spec.value.decode("utf-8") + options["emulate_precision_casts"] = emulate_precision_casts + options["max_autotune"] = max_autotune + if autotune_at_compile_time is not None: + options["triton.autotune_at_compile_time"] = autotune_at_compile_time # Add platform-specific options if platform == "windows": diff --git a/backends/cuda/runtime/aoti_cuda_shims.lib b/backends/cuda/runtime/aoti_cuda_shims.lib index 63c8d79bd7a3b38a968fc5a30ed454078781cfdc..8bb03cc1c1ee54d3643d7d91456c5d6c4e216ee2 100644 GIT binary patch delta 2302 zcmai#O-NKx6vzKF7@8;~LvPagdh`AL<~jI55LOa0ghZ5-gp8V67NsH+xDa$DA{5Hq zM6_@jE+id@XjSc66)q&iW+CE2Tu8WZA=0_;R&Mmn!0+Dk&N=U#ckVfF-p~H81M`;_ z%&IA!ex_Xhu8pSI($u8u*~`sYORe`+1Go=3cY%f`z%>r|#}xVwV3DVth>a+MGk_$s zsql6K63>>xO?ruUszeK6Y%4r{c1SS>!LrP5e))j$c(i5>gMZ5q=l9Wi2 zrZ|%1up+S!NHV08Or?4NixTZbf+~~5$w?BiE5dXNlIVmYazuK`v?6*ydLlfl2$8SF z9PLDULt#)-iMeJ`iN+j=;#=F{dGWorPJcX9=pA|SeCQeaM+;AS3!~!$!@VcU%!1#^ zG_B=-)6&$nT_@1g0F1kUF+Z@Q19@U32FwJ3%?!}(1-3jSyMYqP+Xm1_*Lf4@@&S_p z;E?WJC;6DtM)QT_bX8&D&NxF)< z)?gE_d{x@X7^{(1!z{X;S;ky^=SF8$q^bMnV&%U?*3|a$FPnkmbTWZKK~IN}-!vppI}4XZ{@S zPOwuaa y@sfWm?=x2AXL>aY`4VK!YurQ4n>n%XzQDOqpXk#@Uv0Ud;?&QlumvyLs{a6MS=pQb delta 1637 zcmZvaO-LI-6vzJwqNzlXWQj3mH@lnf?;>qbKQ`OxnYY3qNM(H*fa6oi{(8|DHeacV_#| z*2Df7zO8}VLxW;I*9qV;(6a&bo&bGLz#_#l*9D;lz=>Z8!ajhLUlHhMK$BG(i6D87 zQ4!?U08a2ikl&(@g2)lTiMs@`J)lW9jYND$5cN|$5vEv9Bp}Ex15GGtmMAQ6 z%H{EgQW!C5&tvj7ZHv;)qSN;uhpN0zm`;?)=H+q1R zUclK$6Kc`A2{b~$RUGhzft5UPrUR?QN)V_Rz*-Ktp!Wu?ozmQG1G}_$iT3T&`(^@Y zOVXY+#ZZzX9{Ww#hG+{Z-YG#5HL&_9>wh6ig}y_&%v*H&b(R=Bld9^iw&? zlhN3R^q8uZ`VMrBRWnM5_yOBl<=l^B8mncM, int> = 0> inline T rsqrt(T a) { - return 1.0 / std::sqrt(float(a)); + return 1.0f / std::sqrt(float(a)); } template < typename T, diff --git a/runtime/core/portable_type/c10/c10/util/complex_math.h b/runtime/core/portable_type/c10/c10/util/complex_math.h index d369df50592..2b9bbea6c71 100644 --- a/runtime/core/portable_type/c10/c10/util/complex_math.h +++ b/runtime/core/portable_type/c10/c10/util/complex_math.h @@ -327,7 +327,7 @@ C10_HOST_DEVICE inline c10::complex atanh(const c10::complex& x) { template C10_HOST_DEVICE inline c10::complex log1p(const c10::complex& z) { #if defined(__APPLE__) || defined(__MACOSX) || defined(__CUDACC__) || \ - defined(__HIPCC__) + defined(__HIPCC__) || defined(__SYCL_DEVICE_ONLY__) // For Mac, the new implementation yielded a high relative error. Falling back // to the old version for now. // See https://github.com/numpy/numpy/pull/22611#issuecomment-1667945354 diff --git a/runtime/core/portable_type/c10/torch/headeronly/util/Half.h b/runtime/core/portable_type/c10/torch/headeronly/util/Half.h index a9c0b166ba2..e5aa622656c 100644 --- a/runtime/core/portable_type/c10/torch/headeronly/util/Half.h +++ b/runtime/core/portable_type/c10/torch/headeronly/util/Half.h @@ -236,7 +236,7 @@ C10_HOST_DEVICE inline float fp16_ieee_to_fp32_value(uint16_t h) { /* * - Choose either results of conversion of input as a normalized number, or * as a denormalized number, depending on the input exponent. The variable - * two_w contains input exponent in bits 27-31, therefore if its smaller than + * two_w contains input exponent in bits 27-31, therefore if it's smaller than * 2**27, the input is either a denormal number, or zero. * - Combine the result of conversion of exponent and mantissa with the sign * of the input number. diff --git a/third-party/ao b/third-party/ao index 02105d46c61..4aa81011346 160000 --- a/third-party/ao +++ b/third-party/ao @@ -1 +1 @@ -Subproject commit 02105d46c61dc80a8c9d39d5836e827ba3af8439 +Subproject commit 4aa810113463571cabb7342d1a00a1f3de9c54f2 diff --git a/torch_pin.py b/torch_pin.py index 0c5cd50fe6d..ca593b1ef05 100644 --- a/torch_pin.py +++ b/torch_pin.py @@ -1,2 +1,2 @@ -TORCH_VERSION = "2.12.0" +TORCH_VERSION = "2.13.0" # NIGHTLY_VERSION = "dev20260318" Temporarily pinning to stable release candidate. Revert https://github.com/pytorch/executorch/pull/18287