Skip to content

Commit decc45f

Browse files
authored
Merge branch 'main' into patch-3
2 parents 8d96ef7 + 8476a99 commit decc45f

File tree

63 files changed

+342
-9409
lines changed

Some content is hidden

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

63 files changed

+342
-9409
lines changed

.ci/docker/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ IMAGE_NAME="$1"
1111
shift
1212

1313
export UBUNTU_VERSION="22.04"
14-
export CUDA_VERSION="12.4.1"
14+
export CUDA_VERSION="12.6.3"
1515

1616
export BASE_IMAGE="nvidia/cuda:${CUDA_VERSION}-devel-ubuntu${UBUNTU_VERSION}"
1717
echo "Building ${IMAGE_NAME} Docker image"

.ci/docker/requirements.txt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
# --extra-index-url https://download.pytorch.org/whl/cu117/index.html # Use this to run/publish tutorials against the latest binaries during the RC stage. Comment out after the release. Each release verify the correct cuda version.
22
# Refer to ./jenkins/build.sh for tutorial build instructions
33

4-
sphinx==5.0.0
4+
sphinx==5.3.0
55
sphinx-gallery==0.11.1
6-
sphinx_design
6+
sphinx-reredirects==0.1.4
7+
sphinx-design==0.4.0
78
docutils==0.16
89
sphinx-copybutton
910
sphinx_sitemap==2.6.0
@@ -34,7 +35,6 @@ ax-platform>=0.4.0
3435
nbformat>=5.9.2
3536
datasets
3637
transformers
37-
torchmultimodal-nightly # needs to be updated to stable as soon as it's avaialable
3838
onnx
3939
onnxscript>=0.2.2
4040
onnxruntime
@@ -63,7 +63,6 @@ gym-super-mario-bros==7.4.0
6363
pyopengl
6464
gymnasium[mujoco]==0.27.0
6565
timm
66-
iopath
6766
pygame==2.6.0
6867
pycocotools
6968
semilearn==0.3.2

.github/scripts/check_redirects.sh

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#!/bin/bash
2+
3+
if [ "$CURRENT_BRANCH" == "$BASE_BRANCH" ]; then
4+
echo "Running on $BASE_BRANCH branch. Skipping check."
5+
exit 0
6+
fi
7+
8+
9+
# Get list of deleted or renamed files in this branch compared to base
10+
DELETED_FILES=$(git diff --name-status $BASE_BRANCH $CURRENT_BRANCH --diff-filter=DR | awk '{print $2}' | grep -E '\.(rst|py|md)$' | grep -v 'redirects.py')
11+
# Check if any deleted or renamed files were found
12+
if [ -z "$DELETED_FILES" ]; then
13+
echo "No deleted or renamed files found. Skipping check."
14+
exit 0
15+
fi
16+
17+
echo "Deleted or renamed files:"
18+
echo "$DELETED_FILES"
19+
20+
# Check if redirects.py has been updated
21+
REDIRECTS_UPDATED=$(git diff --name-status $BASE_BRANCH $CURRENT_BRANCH --diff-filter=AM | grep 'redirects.py' && echo "yes" || echo "no")
22+
23+
if [ "$REDIRECTS_UPDATED" == "no" ]; then
24+
echo "ERROR: Files were deleted or renamed but redirects.py was not updated. Please update .github/scripts/redirects.py to redirect these files."
25+
exit 1
26+
fi
27+
28+
# Check if each deleted file has a redirect entry
29+
MISSING_REDIRECTS=0
30+
for FILE in $DELETED_FILES; do
31+
# Convert file path to URL path format (remove extension and adjust path)
32+
REDIRECT_PATH=$(echo $FILE | sed -E 's/(.+)_source\/(.+)\.(py|rst|md)$/\1\/\2.html/')
33+
34+
# Check if this path exists in redirects.py as a key. We don't check for values.
35+
if ! grep -q "\"$REDIRECT_PATH\":" redirects.py; then
36+
echo "ERROR: Missing redirect for deleted file: $FILE (should have entry for \"$REDIRECT_PATH\")"
37+
MISSING_REDIRECTS=1
38+
fi
39+
done
40+
41+
if [ $MISSING_REDIRECTS -eq 1 ]; then
42+
echo "ERROR: Please add redirects for all deleted/renamed files to redirects.py"
43+
exit 1
44+
fi
45+
46+
echo "All deleted/renamed files have proper redirects. Check passed!"

.github/workflows/check-redirects.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Check Redirects for Deleted or Renamed Files
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- '*/**/*.rst'
7+
- '*/**/*.py'
8+
- '*/**/*.md'
9+
10+
jobs:
11+
check-redirects:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
19+
- name: Run redirect check script
20+
run: |
21+
chmod +x ./.github/scripts/check_redirects.sh
22+
./.github/scripts/check_redirects.sh
23+
env:
24+
BASE_BRANCH: ${{ github.base_ref }}
25+
CURRENT_BRANCH: ${{ github.head_ref }}

.github/workflows/link_checkPR.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,12 @@ jobs:
4343
- name: Skip Message
4444
if: steps.skip-label.outputs.result == 'true'
4545
run: echo "Link check was skipped due to the presence of the 'skip-link-check' label."
46-
46+
47+
# Per tj-actions, a delete file is not a changed file so this ensures lint checking does not occur on deleted files
48+
- name: No Files to Check
49+
if: steps.skip-label.outputs.result == 'false' && steps.changed-files.outputs.any_changed == 'true'
50+
run: echo "No relevant files were changed in this PR that require link checking."
51+
4752
- name: Suggestions
4853
if: failure()
4954
run: |

.jenkins/build.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,12 @@ elif [[ "${JOB_TYPE}" == "manager" ]]; then
151151
# Step 7: push new HTML files and static files to gh-pages
152152
if [[ "$COMMIT_SOURCE" == "refs/heads/master" || "$COMMIT_SOURCE" == "refs/heads/main" ]]; then
153153
git clone https://github.com/pytorch/tutorials.git -b gh-pages gh-pages
154+
# Clean up directories that contain tutorials
155+
156+
for dir in beginner intermediate prototype recipes advanced distributed vision text audio; do
157+
rm -rf "gh-pages/$dir"
158+
done
159+
154160
cp -r docs/* gh-pages/
155161
pushd gh-pages
156162
# DANGER! DO NOT REMOVE THE `set +x` SETTING HERE!

.jenkins/validate_tutorials_built.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
"recipes_source/recipes/timer_quick_start",
4949
"recipes_source/recipes/amp_recipe",
5050
"recipes_source/recipes/Captum_Recipe",
51-
"intermediate_source/flask_rest_api_tutorial",
5251
"intermediate_source/text_to_speech_with_torchaudio",
5352
"intermediate_source/tensorboard_profiler_tutorial", # reenable after 2.0 release.
5453
"advanced_source/semi_structured_sparse", # reenable after 3303 is fixed.

.lycheeignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,5 @@ https://pytorch.org/tutorials/beginner/colab/n
1313
# Ignore local host link from intermediate_source/tensorboard_tutorial.rst
1414
http://localhost:6006
1515

16-
# Ignore local host link from recipes_source/deployment_with_flask.rst
17-
http://localhost:5000/predict
18-
1916
# Ignore local host link from advanced_source/cpp_frontend.rst
2017
https://www.uber.com/blog/deep-neuroevolution/

Makefile

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,6 @@ download:
7878
wget -nv -N https://download.pytorch.org/models/resnet18-5c106cde.pth -P $(DATADIR)
7979
cp $(DATADIR)/resnet18-5c106cde.pth prototype_source/data/resnet18_pretrained_float.pth
8080

81-
# Download vocab for beginner_source/flava_finetuning_tutorial.py
82-
wget -nv -N http://dl.fbaipublicfiles.com/pythia/data/vocab.tar.gz -P $(DATADIR)
83-
tar $(TAROPTS) -xzf $(DATADIR)/vocab.tar.gz -C ./beginner_source/data/
84-
8581
# Download PennFudanPed dataset for intermediate_source/torchvision_tutorial.py
8682
wget https://www.cis.upenn.edu/~jshi/ped_html/PennFudanPed.zip -P $(DATADIR)
8783
unzip -o $(DATADIR)/PennFudanPed.zip -d intermediate_source/data/

_static/img/bert.png

-242 KB
Binary file not shown.

0 commit comments

Comments
 (0)