Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
324 commits
Select commit Hold shift + click to select a range
bc529d1
Update
shoumikhin Aug 14, 2026
711fb94
Update
shoumikhin Aug 14, 2026
f0cf7c5
Update
shoumikhin Aug 14, 2026
4bfde8e
Update
shoumikhin Aug 14, 2026
2f67cd2
Update
shoumikhin Aug 14, 2026
b53c53d
Update
shoumikhin Aug 14, 2026
7006689
Update
shoumikhin Aug 14, 2026
b74750f
Update
shoumikhin Aug 14, 2026
9537960
Update
shoumikhin Aug 14, 2026
e3f71d1
Update
shoumikhin Aug 14, 2026
2f7a439
Update
shoumikhin Aug 14, 2026
797d682
Update
shoumikhin Aug 14, 2026
64debc5
Update
shoumikhin Aug 14, 2026
a73735c
Update
shoumikhin Aug 14, 2026
8384f9a
Update
shoumikhin Aug 14, 2026
4bcd419
Update
shoumikhin Aug 15, 2026
55a13b9
Update
shoumikhin Aug 15, 2026
af15bef
Update
shoumikhin Aug 15, 2026
37b1833
Update
shoumikhin Aug 15, 2026
82b75d5
Update
shoumikhin Aug 15, 2026
93510b1
Update
shoumikhin Aug 15, 2026
707e35f
Update
shoumikhin Aug 15, 2026
80c9986
Update
shoumikhin Aug 15, 2026
6ac281e
Update
shoumikhin Aug 15, 2026
b793003
Update
shoumikhin Aug 15, 2026
5670d38
Update
shoumikhin Aug 15, 2026
33cde66
Update
shoumikhin Aug 15, 2026
10ddbe9
Update
shoumikhin Aug 15, 2026
ee69fa7
Update
shoumikhin Aug 15, 2026
80cc50e
Update
shoumikhin Aug 15, 2026
d3e46fc
Update
shoumikhin Aug 15, 2026
07abf92
Update
shoumikhin Aug 15, 2026
fe636b9
Update
shoumikhin Aug 15, 2026
0d87b12
Update
shoumikhin Aug 15, 2026
09943f6
Update
shoumikhin Aug 15, 2026
e5bd7ab
Update
shoumikhin Aug 15, 2026
7f20553
Update
shoumikhin Aug 15, 2026
4c5ff69
Update
shoumikhin Aug 15, 2026
47ce7a2
Update
shoumikhin Aug 15, 2026
107d3c0
Update
shoumikhin Aug 15, 2026
856980e
Update
shoumikhin Aug 15, 2026
875ad71
Update
shoumikhin Aug 15, 2026
a2688bd
Update
shoumikhin Aug 15, 2026
f136d7f
Update
shoumikhin Aug 15, 2026
7b0dc3e
Update
shoumikhin Aug 15, 2026
ca429df
Update
shoumikhin Aug 15, 2026
209c0bd
Update
shoumikhin Aug 15, 2026
6a1d8e6
Update
shoumikhin Aug 15, 2026
f4849ab
Update
shoumikhin Aug 15, 2026
89d4c8c
Update
shoumikhin Aug 15, 2026
e7177db
Update
shoumikhin Aug 15, 2026
6bf1f2d
Update
shoumikhin Aug 15, 2026
d6c543c
Update
shoumikhin Aug 15, 2026
5a7ce2d
Update
shoumikhin Aug 15, 2026
c8fb112
Update
shoumikhin Aug 15, 2026
ca072ae
Update
shoumikhin Aug 15, 2026
8b07750
Update
shoumikhin Aug 15, 2026
a08fb9f
Update
shoumikhin Aug 15, 2026
4c049da
Update
shoumikhin Aug 15, 2026
a0cc20a
Update
shoumikhin Aug 15, 2026
faf9c0f
Update
shoumikhin Aug 15, 2026
207926a
Update
shoumikhin Aug 15, 2026
1edbb75
Update
shoumikhin Aug 15, 2026
8a2f27e
Update
shoumikhin Aug 15, 2026
90ad462
Update
shoumikhin Aug 16, 2026
deda54e
Update
shoumikhin Aug 16, 2026
69f23e9
Update
shoumikhin Aug 16, 2026
79e264b
Update
shoumikhin Aug 16, 2026
dcda51d
Update
shoumikhin Aug 16, 2026
4ad455a
Update
shoumikhin Aug 16, 2026
64a8c6f
Update
shoumikhin Aug 16, 2026
e7e3d16
Update
shoumikhin Aug 16, 2026
2f93e19
Update
shoumikhin Aug 16, 2026
6311d11
Update
shoumikhin Aug 16, 2026
b2e20c0
Update
shoumikhin Aug 16, 2026
4c410cd
Update
shoumikhin Aug 16, 2026
9336d31
Update
shoumikhin Aug 16, 2026
95c838f
Update
shoumikhin Aug 16, 2026
ff5e447
Update
shoumikhin Aug 16, 2026
c27bbce
Update
shoumikhin Aug 16, 2026
e38d2dc
Update
shoumikhin Aug 16, 2026
dba35de
Update
shoumikhin Aug 16, 2026
029785c
Update
shoumikhin Aug 16, 2026
7697369
Update
shoumikhin Aug 16, 2026
4553641
Update
shoumikhin Aug 16, 2026
57a0b50
Update
shoumikhin Aug 16, 2026
9ef0082
Update
shoumikhin Aug 16, 2026
c0cfda7
Update
shoumikhin Aug 16, 2026
b877122
Update
shoumikhin Aug 16, 2026
12a62ba
Update
shoumikhin Aug 16, 2026
208d4d7
Update
shoumikhin Aug 16, 2026
751b387
Update
shoumikhin Aug 16, 2026
71cc17d
Update
shoumikhin Aug 16, 2026
04c3e79
Update
shoumikhin Aug 16, 2026
53402ea
Update
shoumikhin Aug 16, 2026
8aae779
Update
shoumikhin Aug 16, 2026
1d62fbd
Update
shoumikhin Aug 16, 2026
013867d
Update
shoumikhin Aug 16, 2026
0926f33
Update
shoumikhin Aug 16, 2026
8153c90
Update
shoumikhin Aug 16, 2026
2ca2429
Update
shoumikhin Aug 16, 2026
e9d986d
Update
shoumikhin Aug 16, 2026
667c2a0
Update
shoumikhin Aug 16, 2026
997d129
Update
shoumikhin Aug 16, 2026
1cf432a
Update
shoumikhin Aug 17, 2026
97136c3
Update
shoumikhin Aug 17, 2026
c06e924
Update
shoumikhin Aug 17, 2026
19e2901
Update
shoumikhin Aug 17, 2026
0958811
Update
shoumikhin Aug 17, 2026
3b683b2
Update
shoumikhin Aug 17, 2026
6086b9b
Update
shoumikhin Aug 17, 2026
791f5cd
Update
shoumikhin Aug 17, 2026
2f483ba
Update
shoumikhin Aug 17, 2026
fafc231
Update
shoumikhin Aug 17, 2026
fad6f63
Update
shoumikhin Aug 17, 2026
e9e7192
Update
shoumikhin Aug 17, 2026
fd874ca
Update
shoumikhin Aug 17, 2026
1ddfe57
Update
shoumikhin Aug 17, 2026
a74be37
Update
shoumikhin Aug 17, 2026
1950b86
Update
shoumikhin Aug 17, 2026
64683d3
Update
shoumikhin Aug 17, 2026
17d9f0b
Update
shoumikhin Aug 17, 2026
527a6f5
Update
shoumikhin Aug 17, 2026
0aebe4e
Update
shoumikhin Aug 17, 2026
7483dd9
Update
shoumikhin Aug 17, 2026
58a6f64
Update
shoumikhin Aug 17, 2026
c169bcc
Update
shoumikhin Aug 17, 2026
b14202e
Update
shoumikhin Aug 17, 2026
5a6389e
Update
shoumikhin Aug 17, 2026
455cb2c
Update
shoumikhin Aug 17, 2026
6aea4ec
Update
shoumikhin Aug 17, 2026
1c02585
Update
shoumikhin Aug 17, 2026
a54c84f
Update
shoumikhin Aug 17, 2026
70a1c5f
Update
shoumikhin Aug 17, 2026
e9a410f
Update
shoumikhin Aug 17, 2026
e095c57
Update
shoumikhin Aug 17, 2026
e90c122
Update
shoumikhin Aug 17, 2026
4a41acb
Update
shoumikhin Aug 17, 2026
0830b54
Update
shoumikhin Aug 17, 2026
84edf54
Update
shoumikhin Aug 17, 2026
5d760b0
Update
shoumikhin Aug 17, 2026
3b068e6
Update
shoumikhin Aug 17, 2026
8d5164b
Update
shoumikhin Aug 17, 2026
58adddc
Update
shoumikhin Aug 17, 2026
0458d41
Update
shoumikhin Aug 17, 2026
e0d5be0
Update
shoumikhin Aug 17, 2026
55785f7
Update
shoumikhin Aug 17, 2026
6f962f9
Update
shoumikhin Aug 17, 2026
4017168
Update
shoumikhin Aug 17, 2026
76f35fd
Update
shoumikhin Aug 17, 2026
a87494b
Update
shoumikhin Aug 17, 2026
c5cc47b
Update
shoumikhin Aug 17, 2026
75c520f
Update
shoumikhin Aug 17, 2026
76ed9f8
Update
shoumikhin Aug 17, 2026
b87d66a
Update
shoumikhin Aug 17, 2026
a7a7958
Update
shoumikhin Aug 17, 2026
d2e7fe8
Update
shoumikhin Aug 17, 2026
de531bf
Update
shoumikhin Aug 17, 2026
9c0e747
Update
shoumikhin Aug 17, 2026
efc3e3b
Update
shoumikhin Aug 17, 2026
56ca0d2
Update
shoumikhin Aug 17, 2026
dbf799a
Update
shoumikhin Aug 17, 2026
b7e7e9c
Update
shoumikhin Aug 17, 2026
cad10ee
Update
shoumikhin Aug 17, 2026
55a00ff
Update
shoumikhin Aug 18, 2026
ce4b0ef
Update
shoumikhin Aug 18, 2026
e04d0e0
Update
shoumikhin Aug 18, 2026
5440c27
Update
shoumikhin Aug 18, 2026
1573e0b
Update
shoumikhin Aug 18, 2026
aa1bb51
Update
shoumikhin Aug 18, 2026
48c5e9b
Update
shoumikhin Aug 18, 2026
b19544b
Update
shoumikhin Aug 18, 2026
038e36c
Update
shoumikhin Aug 18, 2026
bb43581
Update
shoumikhin Aug 18, 2026
ac6a665
Update
shoumikhin Aug 18, 2026
c71ced0
Update
shoumikhin Aug 18, 2026
65e3621
Update
shoumikhin Aug 18, 2026
cc4d013
Update
shoumikhin Aug 18, 2026
2af0c80
Update
shoumikhin Aug 18, 2026
dc5cb10
Update
shoumikhin Aug 18, 2026
d6ec909
Update
shoumikhin Aug 18, 2026
d2ddb04
Update
shoumikhin Aug 18, 2026
39e3a30
Update
shoumikhin Aug 18, 2026
a75e7f2
Update
shoumikhin Aug 18, 2026
1b58553
Update
shoumikhin Aug 19, 2026
1f90586
Update
shoumikhin Aug 19, 2026
50c329a
Update
shoumikhin Aug 19, 2026
e62a93d
Update
shoumikhin Aug 19, 2026
34a39b0
Update
shoumikhin Aug 19, 2026
2b886e2
Update
shoumikhin Aug 19, 2026
2dd1a16
Update
shoumikhin Aug 19, 2026
2e8f1b5
Update
shoumikhin Aug 19, 2026
636d433
Update
shoumikhin Aug 19, 2026
12e101b
Update
shoumikhin Aug 19, 2026
537d0e7
Update
shoumikhin Aug 19, 2026
97cc7c9
Update
shoumikhin Aug 19, 2026
cacb83f
Update
shoumikhin Aug 19, 2026
b7b109a
Update
shoumikhin Aug 19, 2026
4af3062
Update
shoumikhin Aug 19, 2026
601ea70
Update
shoumikhin Aug 19, 2026
762afb5
Update
shoumikhin Aug 19, 2026
37058f6
Update
shoumikhin Aug 19, 2026
fdc827d
Update
shoumikhin Aug 19, 2026
fb42f27
Update
shoumikhin Aug 19, 2026
688310d
Update
shoumikhin Aug 19, 2026
c686c3f
Update
shoumikhin Aug 19, 2026
b30dad3
Update
shoumikhin Aug 19, 2026
5ca10de
Update
shoumikhin Aug 19, 2026
6b4ab76
Update
shoumikhin Aug 19, 2026
d663a16
Update
shoumikhin Aug 19, 2026
946557b
Update
shoumikhin Aug 19, 2026
9502898
Update
shoumikhin Aug 19, 2026
154a20a
Update
shoumikhin Aug 19, 2026
7439020
Update
shoumikhin Aug 19, 2026
bbb264d
Update
shoumikhin Aug 19, 2026
04696ce
Update
shoumikhin Aug 19, 2026
72778d3
Update
shoumikhin Aug 19, 2026
1d06139
Update
shoumikhin Aug 19, 2026
2e09096
Update
shoumikhin Aug 19, 2026
ae991df
Update
shoumikhin Aug 19, 2026
f6ec683
Update
shoumikhin Aug 19, 2026
d8b5901
Update
shoumikhin Aug 19, 2026
5b6fe07
Update
shoumikhin Aug 19, 2026
053b207
Update
shoumikhin Aug 19, 2026
6df56df
Update
shoumikhin Aug 19, 2026
8fedf97
Update
shoumikhin Aug 19, 2026
0e2f70e
Update
shoumikhin Aug 19, 2026
d64c0d0
Update
shoumikhin Aug 19, 2026
c213052
Update
shoumikhin Aug 19, 2026
61824d2
Update
shoumikhin Aug 20, 2026
4b4e231
Update
shoumikhin Aug 20, 2026
78efab9
Update
shoumikhin Aug 20, 2026
30bc80c
Update
shoumikhin Aug 20, 2026
f736168
Update
shoumikhin Aug 20, 2026
ed9732b
Update
shoumikhin Aug 20, 2026
e847aaf
Update
shoumikhin Aug 20, 2026
3a2908b
Update
shoumikhin Aug 20, 2026
31b5943
Update
shoumikhin Aug 20, 2026
9756431
Update
shoumikhin Aug 20, 2026
c5f5746
Update
shoumikhin Aug 20, 2026
b886d96
Update
shoumikhin Aug 20, 2026
fd63222
Update
shoumikhin Aug 20, 2026
b6c3c8a
Update
shoumikhin Aug 20, 2026
1aa2410
Update
shoumikhin Aug 20, 2026
9f02f69
Update
shoumikhin Aug 20, 2026
36db138
Update
shoumikhin Aug 20, 2026
7e72e28
Update
shoumikhin Aug 20, 2026
1149045
Update
shoumikhin Aug 20, 2026
90b0004
Update
shoumikhin Aug 20, 2026
9e062cf
Update
shoumikhin Aug 20, 2026
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
74 changes: 74 additions & 0 deletions .ci/scripts/wheel/pre_build_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,80 @@ if [[ "$(uname -m)" == "aarch64" ]]; then
echo "the file $file has been modified for atomic to use full path"
fi

# A CPU row must say so, rather than relying on the builder having no CUDA toolkit installed. The build
# turns CUDA on when it detects one, so a builder that gains a toolkit would silently start producing a
# CPU wheel carrying the CUDA delegate. That already happened on Windows, where the image ships a toolkit
# on PATH and the resulting wheel failed to load its own extension.
#
# Stated as the inverse rule: anything that does not name a CUDA train this project supports is a CPU row.
# An allowlist of spellings was tried first and left a gap for every spelling nobody thought of, which is
# the same defect twice: testing only for empty let a row spelled "cpu" through, and listing "cpu" still
# leaves "cpu-aarch64", "rocm" and anything else the matrix generator emits.
#
# The supported trains come from install_utils.py, so both classifiers see the same list.
# A row that names CUDA and is not a supported train fails here rather than being
# rebadged as CPU. The wheel matrix comes from a different repository than this list, so
# when they drift the alternative is publishing a CPU wheel under a CUDA-named index with
# no error anywhere: setup.py cannot catch it, because the CPU option this script writes
# is read first and returns early.
CUDA_ROW=0
if [[ -n "${CU_VERSION:-${DESIRED_CUDA:-}}" ]]; then
ROW_VALUE="${CU_VERSION:-${DESIRED_CUDA:-}}"
# Windows builders run MSYS bash in a conda environment that has python.exe
# and no python3, so either name alone breaks a platform. Mirrors
# run_python_script.sh. Resolving up front instead of testing the exit status
# keeps a missing interpreter a hard failure rather than a silent CPU build.
PYTHON_BIN=$(command -v python3 || command -v python)
row_classification=$("${PYTHON_BIN}" - "${ROW_VALUE}" <<'PY'
import re, sys
sys.path.insert(0, '.')
from install_utils import SUPPORTED_CUDA_VERSIONS
raw = sys.argv[1].strip().lower()
trains = {f'{major}{minor}' for major, minor in SUPPORTED_CUDA_VERSIONS}
# Decide by what the row NAMES, not by the digits it happens to contain. Reducing the whole
# value to digits classified rocm13.2 as CUDA and rebadged a row named plainly "cuda" as CPU.
match = re.fullmatch(r'cu(?:da)?[-_]?(.*)', raw)
if match is None:
print('cpu')
else:
digits = re.sub(r'[^0-9]', '', match.group(1))
print('cuda' if digits in trains else 'unsupported')
PY
)
if [[ "${row_classification}" == "cuda" ]]; then
CUDA_ROW=1
elif [[ "${row_classification}" == "unsupported" ]]; then
echo "row '${ROW_VALUE}' names a CUDA train this project does not support." >&2
echo "Add it to SUPPORTED_CUDA_VERSIONS in install_utils.py, and to" >&2
echo "_CUDA_RUNTIME_PACKAGES and _CUDA_LIBRARY_DIRECTORIES in setup.py, or" >&2
echo "stop building this row. Building it as CPU would publish a CPU wheel" >&2
echo "under a CUDA-named index." >&2
exit 1
fi
fi

if [[ ${CUDA_ROW} -eq 0 ]]; then
export CMAKE_ARGS="${CMAKE_ARGS:-} -DEXECUTORCH_BUILD_CUDA=OFF"
echo "CMAKE_ARGS=${CMAKE_ARGS}" >> "${GITHUB_ENV}"
echo "row '${CU_VERSION:-${DESIRED_CUDA:-}}' names no supported CUDA train, building CPU-only"
else
# A CUDA row must produce the CUDA libraries. Left at the default, the build only
# turns CUDA on if it happens to detect a toolkit, so a builder without one produced
# a wheel tagged for CUDA, carrying no CUDA library, while still declaring the CUDA
# runtime packages. That installs cleanly and then reports the backend as
# unregistered when a model runs. Asking for it explicitly stops the decision from
# depending on detection.
#
# It does not turn a missing toolkit into a configure failure. The CUDA directory
# requires the toolkit but gates its sources on a working compiler, so a builder that
# has toolkit files and no usable nvcc still configures and simply compiles none of
# them. That leniency is deliberate, for packaging jobs that cannot complete compiler
# identification, so the row itself has to verify the libraries it expected are present.
export CMAKE_ARGS="${CMAKE_ARGS:-} -DEXECUTORCH_BUILD_CUDA=ON"
echo "CMAKE_ARGS=${CMAKE_ARGS}" >> "${GITHUB_ENV}"
echo "row '${CU_VERSION:-${DESIRED_CUDA:-}}' is a CUDA row, requiring the CUDA build"
fi

# On Windows, enable symlinks and re-checkout the current revision to create
# the symlinked src/ directory. This is needed to build the wheel.
if [[ $UNAME_S == *"MINGW"* || $UNAME_S == *"MSYS"* ]]; then
Expand Down
14 changes: 4 additions & 10 deletions .ci/scripts/wheel/test_cpp_sdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -873,16 +873,10 @@ def test_every_shipped_header_compiles(work_dir: Path) -> None:
# tests a configuration no consumer of this package is ever in.
"-DC10_USING_CUSTOM_GENERATED_MACROS",
]
# A CUDA wheel's headers reference the CUDA runtime, which the wheel does not publish headers for and
# states as a requirement instead. A consumer of that component supplies a toolkit of its own, so this
# check does the same rather than treating the header as unbuildable. Taken from the toolkit itself, so
# it follows whichever toolkit the build used instead of a list of prefixes that goes stale.
nvcc = shutil.which("nvcc")
cuda_root = os.environ.get("CUDA_HOME") or (
str(Path(nvcc).parent.parent) if nvcc else ""
)
if cuda_root and (Path(cuda_root) / "include" / "cuda_runtime.h").is_file():
includes.append(f"-I{Path(cuda_root) / 'include'}")
# Deliberately no CUDA toolkit include directory. A CUDA wheel's own headers have to compile
# against nothing but the wheel, the same as every other header here. Adding the builder's toolkit
# would measure the build machine rather than the consumer, and a header that only compiles that way
# fails in the consumer's project instead of here.
# Headers a wheel-only consumer cannot compile and is not expected to. Each needs something outside the
# package: a platform that is not the one being built for, or a third-party library the wheel does not
# carry. They ship because a source build includes them, and holding them to this rule would report a
Expand Down
Loading
Loading