Skip to content

Commit 43994c1

Browse files
Update on "Add beginnings of torch::stable::accelerator"
Adds - `torch::stable::accelerator::DeviceGuard`: `std::unique_ptr` to `DeviceGuardOpauqe` mostly copied from the below (but made generic) https://github.com/pytorch/pytorch/blob/50eac811a68e63e96ad56c11c983bfe298a0bb8a/torch/csrc/inductor/aoti_runtime/utils_cuda.h#L30-L46 - constructor `DeviceGuard(DeviceIndex)` (**this matches aoti but defers from the actual c10 DeviceGuard constructor that takes in device**) - `set_index(DeviceIndex)` - `torch::stable::accelerator::Stream`: `std::shared_ptr` to `StreamOpaque` - constructor `Stream(StreamHandle stream)` (similar to torch::stable::Tensor) - `id() -> StreamId` - `getCurrentStream(DeviceIndex device_index) -> stable::accelerator::Stream` [ghstack-poisoned]
2 parents e28e5f6 + a4e23f7 commit 43994c1

File tree

998 files changed

+75129
-20874
lines changed

Some content is hidden

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

998 files changed

+75129
-20874
lines changed

.ci/aarch64_linux/build_aarch64_wheel.py

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -438,9 +438,7 @@ def build_torchvision(
438438
)
439439
build_vars += f"BUILD_VERSION={version}.dev{build_date}"
440440
elif build_version is not None:
441-
build_vars += (
442-
f"BUILD_VERSION={build_version} PYTORCH_VERSION={branch[1:].split('-')[0]}"
443-
)
441+
build_vars += f"BUILD_VERSION={build_version} PYTORCH_VERSION={branch[1:].split('-', maxsplit=1)[0]}"
444442
if host.using_docker():
445443
build_vars += " CMAKE_SHARED_LINKER_FLAGS=-Wl,-z,max-page-size=0x10000"
446444

@@ -495,9 +493,7 @@ def build_torchdata(
495493
)
496494
build_vars += f"BUILD_VERSION={version}.dev{build_date}"
497495
elif build_version is not None:
498-
build_vars += (
499-
f"BUILD_VERSION={build_version} PYTORCH_VERSION={branch[1:].split('-')[0]}"
500-
)
496+
build_vars += f"BUILD_VERSION={build_version} PYTORCH_VERSION={branch[1:].split('-', maxsplit=1)[0]}"
501497
if host.using_docker():
502498
build_vars += " CMAKE_SHARED_LINKER_FLAGS=-Wl,-z,max-page-size=0x10000"
503499

@@ -553,9 +549,7 @@ def build_torchtext(
553549
)
554550
build_vars += f"BUILD_VERSION={version}.dev{build_date}"
555551
elif build_version is not None:
556-
build_vars += (
557-
f"BUILD_VERSION={build_version} PYTORCH_VERSION={branch[1:].split('-')[0]}"
558-
)
552+
build_vars += f"BUILD_VERSION={build_version} PYTORCH_VERSION={branch[1:].split('-', maxsplit=1)[0]}"
559553
if host.using_docker():
560554
build_vars += " CMAKE_SHARED_LINKER_FLAGS=-Wl,-z,max-page-size=0x10000"
561555

@@ -613,9 +607,7 @@ def build_torchaudio(
613607
)
614608
build_vars += f"BUILD_VERSION={version}.dev{build_date}"
615609
elif build_version is not None:
616-
build_vars += (
617-
f"BUILD_VERSION={build_version} PYTORCH_VERSION={branch[1:].split('-')[0]}"
618-
)
610+
build_vars += f"BUILD_VERSION={build_version} PYTORCH_VERSION={branch[1:].split('-', maxsplit=1)[0]}"
619611
if host.using_docker():
620612
build_vars += " CMAKE_SHARED_LINKER_FLAGS=-Wl,-z,max-page-size=0x10000"
621613

.ci/docker/build.sh

Lines changed: 4 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -144,16 +144,6 @@ case "$tag" in
144144
TRITON=yes
145145
INDUCTOR_BENCHMARKS=yes
146146
;;
147-
pytorch-linux-jammy-cuda12.6-cudnn9-py3-gcc9)
148-
CUDA_VERSION=12.6.3
149-
ANACONDA_PYTHON_VERSION=3.10
150-
GCC_VERSION=9
151-
VISION=yes
152-
KATEX=yes
153-
UCX_COMMIT=${_UCX_COMMIT}
154-
UCC_COMMIT=${_UCC_COMMIT}
155-
TRITON=yes
156-
;;
157147
pytorch-linux-jammy-cuda12.8-cudnn9-py3.12-gcc11-vllm)
158148
CUDA_VERSION=12.8.1
159149
ANACONDA_PYTHON_VERSION=3.12
@@ -164,39 +154,6 @@ case "$tag" in
164154
UCC_COMMIT=${_UCC_COMMIT}
165155
TRITON=yes
166156
;;
167-
pytorch-linux-jammy-cuda12.6-cudnn9-py3-gcc9-inductor-benchmarks)
168-
CUDA_VERSION=12.6
169-
ANACONDA_PYTHON_VERSION=3.10
170-
GCC_VERSION=9
171-
VISION=yes
172-
KATEX=yes
173-
UCX_COMMIT=${_UCX_COMMIT}
174-
UCC_COMMIT=${_UCC_COMMIT}
175-
TRITON=yes
176-
INDUCTOR_BENCHMARKS=yes
177-
;;
178-
pytorch-linux-jammy-cuda12.6-cudnn9-py3.12-gcc9-inductor-benchmarks)
179-
CUDA_VERSION=12.6
180-
ANACONDA_PYTHON_VERSION=3.12
181-
GCC_VERSION=9
182-
VISION=yes
183-
KATEX=yes
184-
UCX_COMMIT=${_UCX_COMMIT}
185-
UCC_COMMIT=${_UCC_COMMIT}
186-
TRITON=yes
187-
INDUCTOR_BENCHMARKS=yes
188-
;;
189-
pytorch-linux-jammy-cuda12.6-cudnn9-py3.13-gcc9-inductor-benchmarks)
190-
CUDA_VERSION=12.6
191-
ANACONDA_PYTHON_VERSION=3.13
192-
GCC_VERSION=9
193-
VISION=yes
194-
KATEX=yes
195-
UCX_COMMIT=${_UCX_COMMIT}
196-
UCC_COMMIT=${_UCC_COMMIT}
197-
TRITON=yes
198-
INDUCTOR_BENCHMARKS=yes
199-
;;
200157
pytorch-linux-jammy-cuda12.8-cudnn9-py3-gcc9)
201158
CUDA_VERSION=12.8.1
202159
ANACONDA_PYTHON_VERSION=3.10
@@ -219,19 +176,7 @@ case "$tag" in
219176
VISION=yes
220177
TRITON=yes
221178
;;
222-
pytorch-linux-jammy-py3.11-clang12)
223-
ANACONDA_PYTHON_VERSION=3.11
224-
CLANG_VERSION=12
225-
VISION=yes
226-
TRITON=yes
227-
;;
228-
pytorch-linux-jammy-py3.9-gcc9)
229-
ANACONDA_PYTHON_VERSION=3.9
230-
GCC_VERSION=9
231-
VISION=yes
232-
TRITON=yes
233-
;;
234-
pytorch-linux-jammy-rocm-n-py3 | pytorch-linux-noble-rocm-n-py3)
179+
pytorch-linux-jammy-rocm-n-py3 | pytorch-linux-jammy-rocm-n-py3-benchmarks | pytorch-linux-noble-rocm-n-py3)
235180
if [[ $tag =~ "jammy" ]]; then
236181
ANACONDA_PYTHON_VERSION=3.10
237182
else
@@ -245,7 +190,9 @@ case "$tag" in
245190
KATEX=yes
246191
UCX_COMMIT=${_UCX_COMMIT}
247192
UCC_COMMIT=${_UCC_COMMIT}
248-
INDUCTOR_BENCHMARKS=yes
193+
if [[ $tag =~ "benchmarks" ]]; then
194+
INDUCTOR_BENCHMARKS=yes
195+
fi
249196
;;
250197
pytorch-linux-noble-rocm-alpha-py3)
251198
ANACONDA_PYTHON_VERSION=3.12
@@ -257,7 +204,6 @@ case "$tag" in
257204
KATEX=yes
258205
UCX_COMMIT=${_UCX_COMMIT}
259206
UCC_COMMIT=${_UCC_COMMIT}
260-
INDUCTOR_BENCHMARKS=yes
261207
PYTORCH_ROCM_ARCH="gfx90a;gfx942;gfx950"
262208
;;
263209
pytorch-linux-jammy-xpu-2025.0-py3)

.ci/docker/ci_commit_pins/triton.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
11ec6354315768a85da41032535e3b7b99c5f706
1+
f7888497a1eb9e98d4c07537f0d0bcfe180d1363

.ci/docker/common/install_cpython.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,9 @@ function do_cpython_build {
6666
ln -s pip3 ${prefix}/bin/pip
6767
fi
6868
# install setuptools since python 3.12 is required to use distutils
69-
${prefix}/bin/pip install wheel==0.45.1 setuptools==80.9.0
70-
local abi_tag=$(${prefix}/bin/python -c "from wheel.pep425tags import get_abbr_impl, get_impl_ver, get_abi_tag; print('{0}{1}-{2}'.format(get_abbr_impl(), get_impl_ver(), get_abi_tag()))")
69+
# packaging is needed to create symlink since wheel no longer provides needed information
70+
${prefix}/bin/pip install packaging==25.0 wheel==0.45.1 setuptools==80.9.0
71+
local abi_tag=$(${prefix}/bin/python -c "from packaging.tags import interpreter_name, interpreter_version; import sysconfig ; from sysconfig import get_config_var; print('{0}{1}-{0}{1}{2}'.format(interpreter_name(), interpreter_version(), 't' if sysconfig.get_config_var('Py_GIL_DISABLED') else ''))")
7172
ln -sf ${prefix} /opt/python/${abi_tag}
7273
}
7374

.ci/docker/common/install_cuda.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ function install_nvshmem {
6868
# download, unpack, install
6969
wget -q "${url}"
7070
tar xf "${filename}.tar.gz"
71-
cp -a "libnvshmem/include/"* /usr/local/include/
72-
cp -a "libnvshmem/lib/"* /usr/local/lib/
71+
cp -a "libnvshmem/include/"* /usr/local/cuda/include/
72+
cp -a "libnvshmem/lib/"* /usr/local/cuda/lib64/
7373

7474
# cleanup
7575
cd ..

.ci/docker/common/install_inductor_benchmark_deps.sh

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,37 @@ function install_timm() {
1515
commit=$(get_pinned_commit timm)
1616

1717
pip_install "git+https://github.com/huggingface/pytorch-image-models@${commit}"
18-
# Clean up
19-
conda_run pip uninstall -y torch torchvision triton
18+
}
19+
20+
function install_torchbench() {
21+
local commit
22+
commit=$(get_pinned_commit torchbench)
23+
git clone https://github.com/pytorch/benchmark torchbench
24+
pushd torchbench
25+
git checkout "$commit"
26+
27+
python install.py --continue_on_fail
28+
29+
# TODO (huydhn): transformers-4.44.2 added by https://github.com/pytorch/benchmark/pull/2488
30+
# is regressing speedup metric. This needs to be investigated further
31+
pip install transformers==4.38.1
32+
33+
echo "Print all dependencies after TorchBench is installed"
34+
python -mpip freeze
35+
popd
36+
37+
chown -R jenkins torchbench
2038
}
2139

2240
# Pango is needed for weasyprint which is needed for doctr
2341
conda_install pango
42+
43+
# Stable packages are ok here, just to satisfy TorchBench check
44+
pip_install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu128
45+
46+
install_torchbench
2447
install_huggingface
2548
install_timm
49+
50+
# Clean up
51+
conda_run pip uninstall -y torch torchvision torchaudio triton

.ci/docker/common/install_xpu.sh

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,27 @@ function install_ubuntu() {
3434

3535
# The xpu-smi packages
3636
apt-get install -y flex bison xpu-smi
37-
# Compute and Media Runtimes
38-
apt-get install -y \
39-
intel-opencl-icd intel-level-zero-gpu level-zero \
40-
intel-media-va-driver-non-free libmfx1 libmfxgen1 libvpl2 \
41-
libegl-mesa0 libegl1-mesa libegl1-mesa-dev libgbm1 libgl1-mesa-dev libgl1-mesa-dri \
42-
libglapi-mesa libgles2-mesa-dev libglx-mesa0 libigdgmm12 libxatracker2 mesa-va-drivers \
43-
mesa-vdpau-drivers mesa-vulkan-drivers va-driver-all vainfo hwinfo clinfo
44-
if [[ "${XPU_DRIVER_TYPE,,}" == "rolling" ]]; then
45-
apt-get install -y intel-ocloc
37+
38+
if [[ "${XPU_DRIVER_TYPE,,}" == "lts" ]]; then
39+
# Compute and Media Runtimes
40+
apt-get install -y \
41+
intel-opencl-icd intel-level-zero-gpu level-zero \
42+
intel-media-va-driver-non-free libmfx1 libmfxgen1 libvpl2 \
43+
libegl-mesa0 libegl1-mesa libegl1-mesa-dev libgbm1 libgl1-mesa-dev libgl1-mesa-dri \
44+
libglapi-mesa libgles2-mesa-dev libglx-mesa0 libigdgmm12 libxatracker2 mesa-va-drivers \
45+
mesa-vdpau-drivers mesa-vulkan-drivers va-driver-all vainfo hwinfo clinfo
46+
# Development Packages
47+
apt-get install -y libigc-dev intel-igc-cm libigdfcl-dev libigfxcmrt-dev level-zero-dev
48+
else # rolling driver
49+
apt-get install -y \
50+
intel-opencl-icd libze-intel-gpu1 libze1 \
51+
intel-media-va-driver-non-free libmfx-gen1 libvpl2 \
52+
libegl-mesa0 libegl1-mesa libegl1-mesa-dev libgbm1 libgl1-mesa-dev libgl1-mesa-dri \
53+
libglapi-mesa libglx-mesa0 libigdgmm12 libxatracker2 mesa-va-drivers \
54+
mesa-vdpau-drivers mesa-vulkan-drivers va-driver-all vainfo hwinfo clinfo intel-ocloc
55+
apt-get install -y libigc-dev intel-igc-cm libigdfcl-dev libigfxcmrt-dev libze-dev
4656
fi
47-
# Development Packages
48-
apt-get install -y libigc-dev intel-igc-cm libigdfcl-dev libigfxcmrt-dev level-zero-dev
57+
4958
# Install Intel Support Packages
5059
apt-get install -y ${XPU_PACKAGES}
5160

@@ -130,11 +139,11 @@ function install_sles() {
130139

131140
}
132141

133-
# Default use GPU driver LTS releases
134-
XPU_DRIVER_VERSION="/lts/2350"
135-
if [[ "${XPU_DRIVER_TYPE,,}" == "rolling" ]]; then
136-
# Use GPU driver rolling releases
137-
XPU_DRIVER_VERSION=""
142+
# Default use GPU driver rolling releases
143+
XPU_DRIVER_VERSION=""
144+
if [[ "${XPU_DRIVER_TYPE,,}" == "lts" ]]; then
145+
# Use GPU driver LTS releases
146+
XPU_DRIVER_VERSION="/lts/2350"
138147
fi
139148

140149
# Default use Intel® oneAPI Deep Learning Essentials 2025.0

.ci/docker/requirements-ci.txt

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,12 @@ lark==0.12.0
6363
#Pinned versions: 0.12.0
6464
#test that import:
6565

66-
librosa>=0.6.2 ; python_version < "3.11"
67-
librosa==0.10.2 ; python_version == "3.12"
66+
librosa>=0.6.2 ; python_version < "3.11" and platform_machine != "s390x"
67+
librosa==0.10.2 ; python_version == "3.12" and platform_machine != "s390x"
6868
#Description: A python package for music and audio analysis
6969
#Pinned versions: >=0.6.2
7070
#test that import: test_spectral_ops.py
71+
#librosa depends on numba; disable it for s390x while numba is disabled too
7172

7273
#mkl #this breaks linux-bionic-rocm4.5-py3.7
7374
#Description: Intel oneAPI Math Kernel Library
@@ -110,14 +111,15 @@ ninja==1.11.1.3
110111
#Pinned versions: 1.11.1.3
111112
#test that import: run_test.py, test_cpp_extensions_aot.py,test_determination.py
112113

113-
numba==0.49.0 ; python_version < "3.9"
114-
numba==0.55.2 ; python_version == "3.9"
115-
numba==0.55.2 ; python_version == "3.10"
116-
numba==0.60.0 ; python_version == "3.12"
114+
numba==0.49.0 ; python_version < "3.9" and platform_machine != "s390x"
115+
numba==0.55.2 ; python_version == "3.9" and platform_machine != "s390x"
116+
numba==0.55.2 ; python_version == "3.10" and platform_machine != "s390x"
117+
numba==0.60.0 ; python_version == "3.12" and platform_machine != "s390x"
117118
#Description: Just-In-Time Compiler for Numerical Functions
118119
#Pinned versions: 0.54.1, 0.49.0, <=0.49.1
119120
#test that import: test_numba_integration.py
120121
#For numba issue see https://github.com/pytorch/pytorch/issues/51511
122+
#Need release > 0.61.2 for s390x due to https://github.com/numba/numba/pull/10073
121123

122124
#numpy
123125
#Description: Provides N-dimensional arrays and linear algebra
@@ -307,7 +309,7 @@ pytest-cpp==2.3.0
307309
#Pinned versions: 2.3.0
308310
#test that import:
309311

310-
z3-solver==4.15.1.0
312+
z3-solver==4.15.1.0 ; platform_machine != "s390x"
311313
#Description: The Z3 Theorem Prover Project
312314
#Pinned versions:
313315
#test that import:
@@ -361,7 +363,6 @@ pwlf==2.2.1
361363
#Pinned versions: 2.2.1
362364
#test that import: test_sac_estimator.py
363365

364-
365366
# To build PyTorch itself
366367
pyyaml
367368
pyzstd

.ci/docker/requirements-docs.txt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
sphinx==5.3.0
22
#Description: This is used to generate PyTorch docs
33
#Pinned versions: 5.3.0
4-
-e git+https://github.com/pytorch/pytorch_sphinx_theme.git@pytorch_sphinx_theme2#egg=pytorch_sphinx_theme2
4+
-e git+https://github.com/pytorch/pytorch_sphinx_theme.git@722b7e6f9ca512fcc526ad07d62b3d28c50bb6cd#egg=pytorch_sphinx_theme2
55

66
# TODO: sphinxcontrib.katex 0.9.0 adds a local KaTeX server to speed up pre-rendering
77
# but it doesn't seem to work and hangs around idly. The initial thought that it is probably
@@ -50,13 +50,12 @@ IPython==8.12.0
5050
#Pinned versions: 8.12.0
5151

5252
myst-nb==0.17.2
53-
#Description: This is used to generate PyTorch functorch docs
54-
#Pinned versions: 0.13.2
53+
#Description: This is used to generate PyTorch functorch and torch.compile docs.
54+
#Pinned versions: 0.17.2
5555

5656
# The following are required to build torch.distributed.elastic.rendezvous.etcd* docs
5757
python-etcd==0.4.5
5858
sphinx-copybutton==0.5.0
5959
sphinx-design==0.4.0
6060
sphinxcontrib-mermaid==1.0.0
6161
myst-parser==0.18.1
62-
myst-nb

0 commit comments

Comments
 (0)