Skip to content

Commit f234ad9

Browse files
authored
Merge branch 'main' into dependabot/npm_and_yarn/examples/demo-apps/react-native/rnllama/remix-run/node-2.17.3
2 parents ddf3fd8 + 3779b02 commit f234ad9

3,407 files changed

Lines changed: 280427 additions & 64049 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.bandit.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Centralized Bandit configuration used by lintrunner.
2+
skips:
3+
- B101

.buckconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
[buildfile]
55
name = TARGETS
6+
name_v2 = TARGETS,BUCK
67

78
[repositories]
89
root = .

.ci/docker/build.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,15 @@ case "${IMAGE_NAME}" in
4040
LINTRUNNER=""
4141
GCC_VERSION=11
4242
;;
43+
executorch-ubuntu-22.04-gcc11-aarch64-android)
44+
LINTRUNNER=""
45+
GCC_VERSION=11
46+
ANDROID_NDK_VERSION=r28c
47+
;;
48+
executorch-ubuntu-22.04-gcc11-aarch64-arm-sdk)
49+
ARM_SDK=yes
50+
GCC_VERSION=11
51+
;;
4352
executorch-ubuntu-22.04-linter)
4453
LINTRUNNER=yes
4554
CLANG_VERSION=12
@@ -67,6 +76,13 @@ case "${IMAGE_NAME}" in
6776
# From https://developer.android.com/ndk/downloads
6877
ANDROID_NDK_VERSION=r28c
6978
;;
79+
executorch-ubuntu-22.04-cuda-windows)
80+
LINTRUNNER=""
81+
GCC_VERSION=11
82+
CUDA_WINDOWS_CROSS_COMPILE=yes
83+
CUDA_VERSION=12.8
84+
SKIP_PYTORCH=yes
85+
;;
7086
*)
7187
echo "Invalid image name ${IMAGE_NAME}"
7288
exit 1
@@ -101,6 +117,8 @@ docker build \
101117
--build-arg "MEDIATEK_SDK=${MEDIATEK_SDK:-}" \
102118
--build-arg "ANDROID_NDK_VERSION=${ANDROID_NDK_VERSION:-}" \
103119
--build-arg "SKIP_PYTORCH=${SKIP_PYTORCH:-}" \
120+
--build-arg "CUDA_WINDOWS_CROSS_COMPILE=${CUDA_WINDOWS_CROSS_COMPILE:-}" \
121+
--build-arg "CUDA_VERSION=${CUDA_VERSION:-}" \
104122
-f "${OS}"/Dockerfile \
105123
"$@" \
106124
.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
732b11313b2006b4d8649500eaf5567ec6ac1e49
1+
585799cf7039d376d2ac4848b5ef0b501f60679e
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7a79b41e29a790ebb4b530eb98a89381e2d7de29
1+
release/2.11

.ci/docker/common/install_android.sh

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,14 @@ install_ndk() {
4040
rm -rf "${NDK_INSTALLATION_DIR}" && mkdir -p "${NDK_INSTALLATION_DIR}"
4141

4242
pushd /tmp
43-
# The NDK installation is cached on ossci-android S3 bucket
44-
curl -Os --retry 3 "https://ossci-android.s3.amazonaws.com/android-ndk-${ANDROID_NDK_VERSION}-linux.zip"
43+
ARCH=$(uname -m)
44+
if [ "${ARCH}" = "aarch64" ]; then
45+
# aarch64 NDK is not cached on S3, download from Google directly
46+
curl -Os --retry 3 "https://dl.google.com/android/repository/android-ndk-${ANDROID_NDK_VERSION}-linux.zip"
47+
else
48+
# The NDK installation is cached on ossci-android S3 bucket
49+
curl -Os --retry 3 "https://ossci-android.s3.amazonaws.com/android-ndk-${ANDROID_NDK_VERSION}-linux.zip"
50+
fi
4551
unzip -qo "android-ndk-${ANDROID_NDK_VERSION}-linux.zip"
4652

4753
# Print the content for manual verification
@@ -73,7 +79,10 @@ install_sdk() {
7379
yes | /opt/cmdline-tools/bin/sdkmanager --sdk_root="${SDK_INSTALLATION_DIR}" --install "build-tools;35.0.0"
7480
# And some more tools for future emulator tests
7581
yes | /opt/cmdline-tools/bin/sdkmanager --sdk_root="${SDK_INSTALLATION_DIR}" --install "platform-tools"
76-
yes | /opt/cmdline-tools/bin/sdkmanager --sdk_root="${SDK_INSTALLATION_DIR}" --install "tools"
82+
# The 'tools' package (emulator) is not available on aarch64
83+
if [ "$(uname -m)" != "aarch64" ]; then
84+
yes | /opt/cmdline-tools/bin/sdkmanager --sdk_root="${SDK_INSTALLATION_DIR}" --install "tools"
85+
fi
7786
}
7887

7988
install_prerequiresites

.ci/docker/common/install_cuda.sh

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#!/bin/bash
2+
# Copyright (c) Meta Platforms, Inc. and affiliates.
3+
# All rights reserved.
4+
#
5+
# This source code is licensed under the BSD-style license found in the
6+
# LICENSE file in the root directory of this source tree.
7+
8+
# Install Linux CUDA toolkit
9+
# This installs nvcc and other CUDA development tools needed for compiling CUDA code
10+
11+
set -ex
12+
13+
# CUDA version must be specified (e.g., 12.8)
14+
CUDA_VERSION="${CUDA_VERSION:?CUDA_VERSION must be set}"
15+
16+
# Convert version format (e.g., 12.8 -> 12-8 for package names)
17+
CUDA_VERSION_DASH=$(echo "${CUDA_VERSION}" | tr '.' '-')
18+
19+
# Add NVIDIA package repository
20+
apt-get update
21+
apt-get install -y --no-install-recommends \
22+
gnupg2 \
23+
ca-certificates \
24+
wget
25+
26+
# Download and install the CUDA keyring
27+
wget -q "https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb" -O /tmp/cuda-keyring.deb
28+
dpkg -i /tmp/cuda-keyring.deb
29+
rm /tmp/cuda-keyring.deb
30+
31+
apt-get update
32+
33+
# Install CUDA toolkit (nvcc and development libraries)
34+
# We install a minimal set of packages needed for compilation:
35+
# - cuda-nvcc: The CUDA compiler
36+
# - cuda-cudart-dev: CUDA runtime development files
37+
# - cuda-nvrtc-dev: CUDA runtime compilation library
38+
# - libcublas-dev: cuBLAS development files
39+
# - libcusparse-dev: cuSPARSE development files
40+
# - libcufft-dev: cuFFT development files
41+
apt-get install -y --no-install-recommends \
42+
"cuda-nvcc-${CUDA_VERSION_DASH}" \
43+
"cuda-cudart-dev-${CUDA_VERSION_DASH}" \
44+
"cuda-nvrtc-dev-${CUDA_VERSION_DASH}" \
45+
"libcublas-dev-${CUDA_VERSION_DASH}" \
46+
"libcusparse-dev-${CUDA_VERSION_DASH}" \
47+
"libcufft-dev-${CUDA_VERSION_DASH}"
48+
49+
# Clean up
50+
apt-get clean
51+
rm -rf /var/lib/apt/lists/*
52+
53+
# Verify installation
54+
/usr/local/cuda-${CUDA_VERSION}/bin/nvcc --version
55+
56+
echo "CUDA ${CUDA_VERSION} toolkit installation complete"
57+
echo "CUDA_HOME=/usr/local/cuda-${CUDA_VERSION}"
Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
#!/bin/bash
2+
# Copyright (c) Meta Platforms, Inc. and affiliates.
3+
# All rights reserved.
4+
#
5+
# This source code is licensed under the BSD-style license found in the
6+
# LICENSE file in the root directory of this source tree.
7+
8+
# Install mingw-w64 cross-compiler and Windows CUDA toolkit for cross-compilation
9+
10+
set -ex
11+
12+
INSTALL_DIR="${WINDOWS_CUDA_INSTALL_DIR:-/opt/cuda-windows}"
13+
14+
# Mapping of CUDA versions to their corresponding driver versions for Windows installers
15+
# Source: https://developer.nvidia.com/cuda-toolkit-archive
16+
declare -A CUDA_DRIVER_MAP=(
17+
["12.6"]="12.6.3:561.17"
18+
["12.8"]="12.8.1:572.61"
19+
["12.9"]="12.9.1:576.57"
20+
)
21+
22+
install_mingw() {
23+
echo "Installing mingw-w64 cross-compiler..."
24+
25+
apt-get update
26+
# Install the POSIX threads version of mingw-w64 which supports C++11 threading
27+
# primitives (std::mutex, std::condition_variable, std::shared_mutex).
28+
# The default win32 threads version does not support these.
29+
apt-get install -y --no-install-recommends \
30+
g++-mingw-w64-x86-64-posix \
31+
mingw-w64-tools \
32+
p7zip-full \
33+
wget
34+
35+
# Verify installation shows POSIX threads
36+
x86_64-w64-mingw32-g++ --version
37+
38+
# Cleanup
39+
apt-get clean
40+
rm -rf /var/lib/apt/lists/*
41+
42+
echo "mingw-w64 installation complete (POSIX threads version)"
43+
}
44+
45+
get_torch_cuda_version() {
46+
# Query PyTorch for its CUDA version using conda environment
47+
conda run -n "py_${PYTHON_VERSION}" python3 -c "import torch; print(torch.version.cuda)" 2>/dev/null || echo ""
48+
}
49+
50+
install_windows_cuda() {
51+
# Use CUDA_VERSION env var if set (from Docker build arg), otherwise query PyTorch
52+
if [ -n "${CUDA_VERSION:-}" ]; then
53+
echo "Using CUDA version from environment: ${CUDA_VERSION}"
54+
CUDA_MAJOR_MINOR=$(echo "${CUDA_VERSION}" | cut -d. -f1,2)
55+
else
56+
TORCH_CUDA_VERSION=$(get_torch_cuda_version)
57+
58+
if [ -z "${TORCH_CUDA_VERSION}" ] || [ "${TORCH_CUDA_VERSION}" = "None" ]; then
59+
echo "ERROR: Could not detect CUDA version from PyTorch."
60+
echo "Make sure PyTorch with CUDA support is installed or set CUDA_VERSION."
61+
exit 1
62+
fi
63+
64+
echo "Detected PyTorch CUDA version: ${TORCH_CUDA_VERSION}"
65+
CUDA_MAJOR_MINOR=$(echo "${TORCH_CUDA_VERSION}" | cut -d. -f1,2)
66+
fi
67+
68+
# Look up the full version and driver version
69+
if [ -z "${CUDA_DRIVER_MAP[${CUDA_MAJOR_MINOR}]}" ]; then
70+
echo "ERROR: CUDA version ${CUDA_MAJOR_MINOR} is not in the known version map."
71+
echo "Known versions: ${!CUDA_DRIVER_MAP[*]}"
72+
exit 1
73+
fi
74+
75+
CUDA_INFO="${CUDA_DRIVER_MAP[${CUDA_MAJOR_MINOR}]}"
76+
CUDA_VERSION=$(echo "${CUDA_INFO}" | cut -d: -f1)
77+
CUDA_DRIVER_VERSION=$(echo "${CUDA_INFO}" | cut -d: -f2)
78+
79+
echo "Using CUDA ${CUDA_VERSION} with driver ${CUDA_DRIVER_VERSION}"
80+
81+
echo "Installing Windows CUDA toolkit ${CUDA_VERSION}..."
82+
83+
mkdir -p "${INSTALL_DIR}"
84+
cd "${INSTALL_DIR}"
85+
86+
CUDA_INSTALLER="cuda_${CUDA_VERSION}_${CUDA_DRIVER_VERSION}_windows.exe"
87+
CUDA_URL="https://developer.download.nvidia.com/compute/cuda/${CUDA_VERSION}/local_installers/${CUDA_INSTALLER}"
88+
89+
# Check if already downloaded and extracted
90+
if [ -d "${INSTALL_DIR}/extracted/cuda_cudart" ]; then
91+
echo "Windows CUDA toolkit already installed, skipping download..."
92+
return 0
93+
fi
94+
95+
echo "Downloading CUDA installer from ${CUDA_URL}..."
96+
wget -q "${CUDA_URL}" -O "${CUDA_INSTALLER}"
97+
98+
echo "Extracting CUDA toolkit..."
99+
7z x "${CUDA_INSTALLER}" -o"extracted" -y
100+
101+
# Fix permissions so ci-user can access the files
102+
chmod -R a+rX "${INSTALL_DIR}"
103+
104+
# Clean up installer to save space
105+
rm -f "${CUDA_INSTALLER}"
106+
107+
echo "Windows CUDA toolkit installation complete"
108+
echo "WINDOWS_CUDA_HOME=${INSTALL_DIR}/extracted/cuda_cudart/cudart"
109+
}
110+
111+
# Parse command line arguments
112+
INSTALL_MINGW=false
113+
INSTALL_CUDA=false
114+
115+
while [[ $# -gt 0 ]]; do
116+
case $1 in
117+
--mingw)
118+
INSTALL_MINGW=true
119+
shift
120+
;;
121+
--cuda)
122+
INSTALL_CUDA=true
123+
shift
124+
;;
125+
--all)
126+
INSTALL_MINGW=true
127+
INSTALL_CUDA=true
128+
shift
129+
;;
130+
*)
131+
echo "Unknown option: $1"
132+
echo "Usage: $0 [--mingw] [--cuda] [--all]"
133+
exit 1
134+
;;
135+
esac
136+
done
137+
138+
# Default to installing everything if no options specified
139+
if [ "${INSTALL_MINGW}" = false ] && [ "${INSTALL_CUDA}" = false ]; then
140+
INSTALL_MINGW=true
141+
INSTALL_CUDA=true
142+
fi
143+
144+
if [ "${INSTALL_MINGW}" = true ]; then
145+
install_mingw
146+
fi
147+
148+
if [ "${INSTALL_CUDA}" = true ]; then
149+
install_windows_cuda
150+
fi
151+
152+
echo "Installation complete"

.ci/docker/common/install_pytorch.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ install_pytorch_and_domains() {
3232
pip_install "$(echo dist/*.whl)"
3333

3434
# Grab the pinned audio and vision commits from PyTorch
35-
TORCHAUDIO_VERSION=$(cat .github/ci_commit_pins/audio.txt)
35+
TORCHAUDIO_VERSION=release/2.11
3636
export TORCHAUDIO_VERSION
37-
TORCHVISION_VERSION=$(cat .github/ci_commit_pins/vision.txt)
37+
TORCHVISION_VERSION=release/0.26
3838
export TORCHVISION_VERSION
3939

4040
install_domains

.ci/docker/common/install_zephyr.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#!/bin/bash
33
# Copyright (c) Meta Platforms, Inc. and affiliates.
44
# All rights reserved.
5+
# Copyright 2026 Arm Limited and/or its affiliates.
56
#
67
# This source code is licensed under the BSD-style license found in the
78
# LICENSE file in the root directory of this source tree.
@@ -82,6 +83,13 @@ install_prerequiresites() {
8283
rm -f kitware-archive.sh
8384
pip_install --no-cache-dir west
8485
pip_install pyelftools
86+
87+
# Zephyr SDK
88+
wget https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.17.4/zephyr-sdk-0.17.4_linux-x86_64.tar.xz
89+
tar -xf zephyr-sdk-0.17.4_linux-x86_64.tar.xz
90+
rm -f zephyr-sdk-0.17.4_linux-x86_64.tar.xz*
91+
# Save setup to later and this get symlinked in to another folder in the test in trunk.yml
92+
#./zephyr-sdk-0.17.4/setup.sh -c -t arm-zephyr-eabi
8593
}
8694

8795
install_prerequiresites

0 commit comments

Comments
 (0)