8000 Merge branch 'upstream-main' into liangan1/flex_attention · pytorch/pytorch@fd14da6 · GitHub
[go: up one dir, main page]

Skip to content

Commit fd14da6

Browse files
committed
Merge branch 'upstream-main' into liangan1/flex_attention
2 parents 24dc060 + a944833 commit fd14da6

File tree

400 files changed

+14549
-4624
lines changed

Some content is hidden

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

400 files changed

+14549
-4624
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7e487c24e1c20c3f4606c2d8aca2778873b00b4c
1+
047bbc720fda70cd5742c76b3c9e01d504577d65

.ci/docker/common/install_rocm.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ install_ubuntu() {
1919
apt-get install -y libc++1
2020
apt-get install -y libc++abi1
2121

22+
# Make sure rocm packages from repo.radeon.com have highest priority
23+
cat << EOF > /etc/apt/preferences.d/rocm-pin-600
24+
Package: *
25+
Pin: release o=repo.radeon.com
26+
Pin-Priority: 600
27+
EOF
28+
2229
# Add amdgpu repository
2330
UBUNTU_VERSION_NAME=`cat /etc/os-release | grep UBUNTU_CODENAME | awk -F= '{print $2}'`
2431
echo "deb [arch=amd64] https://repo.radeon.com/amdgpu/${ROCM_VERSION}/ubuntu ${UBUNTU_VERSION_NAME} main" > /etc/apt/sources.list.d/amdgpu.list

.ci/docker/common/install_rocm_magma.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,14 @@ function do_install() {
1717
tmp_dir=$(mktemp -d)
1818
pushd ${tmp_dir}
1919
curl -OLs https://ossci-linux.s3.us-east-1.amazonaws.com/${magma_archive}
20-
tar -xvf "${magma_archive}"
21-
mkdir -p "${rocm_dir}/magma"
22-
mv include "${rocm_dir}/magma/include"
23-
mv lib "${rocm_dir}/magma/lib"
20+
if tar -xvf "${magma_archive}"
21+
then
22+
mkdir -p "${rocm_dir}/magma"
23+
mv include "${rocm_dir}/magma/include"
24+
mv lib "${rocm_dir}/magma/lib"
25+
else
26+
echo "${magma_archive} not found, skipping magma install"
27+
fi
2428
popd
2529
)
2630
}

.ci/docker/libtorch/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ ADD ./common/install_rocm_magma.sh install_rocm_magma.sh
8989
# gfortran and python needed for building magma from source for ROCm
9090
RUN apt-get update -y && \
9191
apt-get install gfortran -y && \
92-
apt-get install python -y && \
92+
apt-get install python3 python-is-python3 -y && \
9393
apt-get clean
9494

9595
RUN bash ./install_rocm_drm.sh && rm install_rocm_drm.sh

.ci/docker/libtorch/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ case ${GPU_ARCH_TYPE} in
3838
rocm)
3939
BASE_TARGET=rocm
4040
DOCKER_TAG=rocm${GPU_ARCH_VERSION}
41-
GPU_IMAGE=rocm/dev-ubuntu-20.04:${GPU_ARCH_VERSION}-complete
41+
GPU_IMAGE=rocm/dev-ubuntu-22.04:${GPU_ARCH_VERSION}-complete
4242
PYTORCH_ROCM_ARCH="gfx900;gfx906;gfx908;gfx90a;gfx942;gfx1030;gfx1100;gfx1101;gfx1102;gfx1200;gfx1201"
4343
DOCKER_GPU_BUILD_ARG="--build-arg PYTORCH_ROCM_ARCH=${PYTORCH_ROCM_ARCH} --build-arg ROCM_VERSION=${GPU_ARCH_VERSION}"
4444
;;

.ci/docker/requirements-docs.txt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
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#egg=pytorch_sphinx_theme
4+
-e git+https://github.com/pytorch/pytorch_sphinx_theme.git@c49afc2aff734d40813b0ca182bb49b611d7a30c#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 is probably
88
# something related to Docker setup. We can investigate this later
9+
910
sphinxcontrib.katex==0.8.6
1011
#Description: This is used to generate PyTorch docs
1112
#Pinned versions: 0.8.6
1213

14+
sphinxext-opengraph==0.9.1
15+
#Description: This is used to generate PyTorch docs
16+
#Pinned versions: 0.9.1
17+
1318
matplotlib==3.5.3
1419
#Description: This is used to generate PyTorch docs
1520
#Pinned versions: 3.5.3
@@ -46,5 +51,6 @@ myst-nb==0.17.2
4651
# The following are required to build torch.distributed.elastic.rendezvous.etcd* docs
4752
python-etcd==0.4.5
4853
sphinx-copybutton==0.5.0
49-
sphinx-panels==0.4.1
54+
sphinx-design==0.4.0
55+
sphinxcontrib-mermaid==1.0.0
5056
myst-parser==0.18.1

.ci/magma-rocm/Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
SHELL=/usr/bin/env bash
22

33
DOCKER_CMD ?= docker
4-
DESIRED_ROCM ?= 6.3
4+
DESIRED_ROCM ?= 6.4
55
DESIRED_ROCM_SHORT = $(subst .,,$(DESIRED_ROCM))
66
PACKAGE_NAME = magma-rocm
77
# inherit this from underlying docker image, do not pass this env var to docker
@@ -16,6 +16,7 @@ DOCKER_RUN = set -eou pipefail; ${DOCKER_CMD} run --rm -i \
1616
magma-rocm/build_magma.sh
1717

1818
.PHONY: all
19+
all: magma-rocm64
1920
all: magma-rocm63
2021
all: magma-rocm624
2122

@@ -24,6 +25,11 @@ clean:
2425
$(RM) -r magma-*
2526
$(RM) -r output
2627

28+
.PHONY: magma-rocm64
29+
magma-rocm64: DESIRED_ROCM := 6.4
30+
magma-rocm64:
31+
$(DOCKER_RUN)
32+
2733
.PHONY: magma-rocm63
2834
magma-rocm63: DESIRED_ROCM := 6.3
2935
magma-rocm63:

.ci/pytorch/macos-test.sh

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -221,25 +221,27 @@ test_torchbench_smoketest() {
221221
TEST_REPORTS_DIR=$(pwd)/test/test-reports
222222
mkdir -p "$TEST_REPORTS_DIR"
223223

224-
local backend=eager
225224
local dtype=notset
226225
local device=mps
227-
228-
touch "$TEST_REPORTS_DIR/inductor_${backend}_torchbench_${dtype}_training_${device}_performance.csv"
229-
touch "$TEST_REPORTS_DIR/inductor_${backend}_torchbench_${dtype}_inference_${device}_performance.csv"
230-
231-
echo "Setup complete, launching torchbench training performance run"
232-
for model in hf_T5 llama BERT_pytorch dcgan hf_GPT2 yolov3 resnet152; do
233-
PYTHONPATH="$(pwd)"/torchbench python benchmarks/dynamo/torchbench.py \
234-
--performance --only "$model" --backend "$backend" --training --devices "$device" \
235-
--output "$TEST_REPORTS_DIR/inductor_${backend}_torchbench_${dtype}_training_${device}_performance.csv"
236-
done
237-
238-
echo "Launching torchbench inference performance run"
239-
for model in hf_T5 llama BERT_pytorch dcgan hf_GPT2 yolov3 resnet152; do
240-
PYTHONPATH="$(pwd)"/torchbench python benchmarks/dynamo/torchbench.py \
241-
--performance --only "$model" --backend "$backend" --inference --devices "$device" \
242-
--output "$TEST_REPORTS_DIR/inductor_${backend}_torchbench_${dtype}_inference_${device}_performance.csv"
226+
local models=(hf_T5 llama BERT_pytorch dcgan hf_GPT2 yolov3 resnet152)
227+
228+
for backend in eager inductor; do
229+
touch "$TEST_REPORTS_DIR/inductor_${backend}_torchbench_${dtype}_training_${device}_performance.csv"
230+
touch "$TEST_REPORTS_DIR/inductor_${backend}_torchbench_${dtype}_inference_${device}_performance.csv"
231+
232+
echo "Launching torchbench training performance run for backend ${backend}"
233+
for model in "${models[@]}"; do
234+
PYTHONPATH="$(pwd)"/torchbench python benchmarks/dynamo/torchbench.py \
235+
--performance --only "$model" --backend "$backend" --training --devices "$device" \
236+
--output "$TEST_REPORTS_DIR/inductor_${backend}_torchbench_${dtype}_training_${device}_performance.csv" || true
237+
done
238+
239+
echo "Launching torchbench inference performance run for backend ${backend}"
240+
for model in "${models[@]}"; do
241+
PYTHONPATH="$(pwd)"/torchbench python benchmarks/dynamo/torchbench.py \
242+
--performance --only "$model" --backend "$backend" --inference --devices "$device" \
243+
--output "$TEST_REPORTS_DIR/inductor_${backend}_torchbench_${dtype}_inference_${device}_performance.csv" || true
244+
done
243245
done
244246

245247
echo "Pytorch benchmark on mps device completed"

.ci/pytorch/python_doc_push_script.sh

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,12 +119,6 @@ popd
119119
git rm -rf "$install_path" || true
120120
mv "$pt_checkout/docs/build/html" "$install_path"
121121

122-
# Prevent Google from indexing $install_path/_modules. This folder contains
123-
# generated source files.
124-
# NB: the following only works on gnu sed. The sed shipped with mac os is different.
125-
# One can `brew install gnu-sed` on a mac and then use "gsed" instead of "sed".
126-
find "$install_path/_modules" -name "*.html" -print0 | xargs -0 sed -i '/<head>/a \ \ <meta name="robots" content="noindex">'
127-
128122
git add "$install_path" || true
129123
git status
130124
git config user.email "soumith+bot@pytorch.org"

.github/actionlint.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,14 @@ self-hosted-runner:
4545
- windows.g5.4xlarge.nvidia.gpu
4646
# Windows ARM64 runners
4747
- windows-11-arm64
48-
# Organization-wide AMD hosted runners
48+
# Organization-wide AMD-hosted runners
49+
# MI2xx runners
4950
- linux.rocm.gpu
5051
- linux.rocm.gpu.2
5152
- linux.rocm.gpu.4
53+
# MI300 runners
54+
- linux.rocm.gpu.mi300.2
55+
- linux.rocm.gpu.mi300.4
5256
- rocm-docker
5357
# Repo-specific Apple hosted runners
5458
- macos-m1-ultra

0 commit comments

Comments
 (0)
0