Skip to content

Commit e8e94d3

Browse files
authored
Merge branch 'main' into dl/fx/openvino_quantizer
2 parents 75d3549 + 548ea1c commit e8e94d3

File tree

93 files changed

+3554
-1730
lines changed

Some content is hidden

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

93 files changed

+3554
-1730
lines changed

.ci/docker/requirements.txt

+4-4
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ tqdm==4.66.1
1414
numpy==1.24.4
1515
matplotlib
1616
librosa
17-
torch==2.5
17+
torch==2.6
1818
torchvision
1919
torchdata
2020
networkx
@@ -28,8 +28,8 @@ tensorboard
2828
jinja2==3.1.3
2929
pytorch-lightning
3030
torchx
31-
torchrl==0.5.0
32-
tensordict==0.5.0
31+
torchrl==0.7.2
32+
tensordict==0.7.2
3333
ax-platform>=0.4.0
3434
nbformat>=5.9.2
3535
datasets
@@ -70,4 +70,4 @@ semilearn==0.3.2
7070
torchao==0.5.0
7171
segment_anything==1.0
7272
torchrec==1.0.0; platform_system == "Linux"
73-
fbgemm-gpu==1.0.0; platform_system == "Linux"
73+
fbgemm-gpu==1.1.0; platform_system == "Linux"
+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#Runs once a month and checks links in the repo to ensure they are valid
2+
#If action fails, it creates an issue with the failing links and an "incorrect link" label
3+
#If link is valid but failing, it can be added to the .lycheeignore file
4+
#Action can also be run manually as needed.
5+
6+
7+
name: Monthly Link Check
8+
on:
9+
schedule:
10+
- cron: '0 0 1 * *' # Runs at midnight on the first day of every month
11+
workflow_dispatch: # Allows manual triggering of the workflow
12+
jobs:
13+
linkChecker:
14+
runs-on: ubuntu-latest
15+
permissions:
16+
issues: write
17+
steps:
18+
- uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 1
21+
- name: Check Links
22+
id: lychee
23+
uses: lycheeverse/lychee-action@v2
24+
with:
25+
args: --accept=200,403,429 --base . --verbose --no-progress './**/*.md' './**/*.html' './**/*.rst'
26+
token: ${{ secrets.CUSTOM_TOKEN }}
27+
fail: true
28+
29+
- name: Create Issue From File
30+
if: failure() && (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch')
31+
uses: peter-evans/create-issue-from-file@v5
32+
with:
33+
title: Broken links detected in docs 🔗
34+
content-filepath: ./lychee/out.md
35+
labels: 'incorrect link'
36+
#token: ${{ secrets.CUSTOM_TOKEN }}
37+
38+
39+
- name: Suggestions
40+
if: failure()
41+
run: |
42+
echo -e "\nPlease review the links reported in the Check links step above."
43+
echo -e "If a link is valid but fails due to a CAPTCHA challenge, IP blocking, login requirements, etc., consider adding such links to .lycheeignore file to bypass future checks.\n"
44+
exit 1

.github/workflows/build-tutorials.yml

+4
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ jobs:
4444
4545
- name: Checkout Tutorials
4646
uses: actions/checkout@v3
47+
with:
48+
fetch-depth: 0
4749

4850
- name: Setup Linux
4951
uses: pytorch/pytorch/.github/actions/setup-linux@main
@@ -115,6 +117,8 @@ jobs:
115117
116118
- name: Checkout Tutorials
117119
uses: actions/checkout@v3
120+
with:
121+
fetch-depth: 0
118122

119123
- name: Setup Linux
120124
uses: pytorch/pytorch/.github/actions/setup-linux@main

.github/workflows/link_checkPR.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818

1919
- name: Get Changed Files
2020
id: changed-files
21-
uses: tj-actions/changed-files@v41
21+
uses: tj-actions/changed-files@d6e91a2266cdb9d62096cebf1e8546899c6aa18f # v45.0.6
2222

2323
- name: Check for Skip Label
2424
id: skip-label

.github/workflows/spelling.yml

+137-4
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,149 @@ on:
55
push:
66
branches:
77
- main
8+
89
jobs:
910
pyspelling:
1011
runs-on: ubuntu-20.04
1112
steps:
12-
- uses: actions/checkout@v3
13+
- name: Check for skip label and get changed files
14+
id: check-files
15+
uses: actions/github-script@v6
16+
with:
17+
script: |
18+
let skipCheck = false;
19+
let changedFiles = [];
20+
21+
if (context.eventName === 'pull_request') {
22+
// Check for skip label
23+
const { data: labels } = await github.rest.issues.listLabelsOnIssue({
24+
owner: context.repo.owner,
25+
repo: context.repo.repo,
26+
issue_number: context.issue.number
27+
});
28+
skipCheck = labels.some(label => label.name === 'skip-spell-check');
29+
30+
if (!skipCheck) {
31+
// Get changed files in PR
32+
const { data: files } = await github.rest.pulls.listFiles({
33+
owner: context.repo.owner,
34+
repo: context.repo.repo,
35+
pull_number: context.issue.number
36+
});
37+
38+
changedFiles = files
39+
.filter(file => file.filename.match(/\.(py|rst|md)$/))
40+
.map(file => file.filename);
41+
}
42+
} else {
43+
// For push events, we'll still need to use git diff
44+
// We'll handle this after checkout
45+
}
46+
47+
core.setOutput('skip', skipCheck.toString());
48+
core.setOutput('files', changedFiles.join('\n'));
49+
core.setOutput('is-pr', (context.eventName === 'pull_request').toString());
50+
51+
- uses: actions/checkout@v4
52+
if: steps.check-files.outputs.skip != 'true'
53+
with:
54+
fetch-depth: 0
55+
56+
- name: Get changed files for push event
57+
if: |
58+
steps.check-files.outputs.skip != 'true' &&
59+
steps.check-files.outputs.is-pr != 'true'
60+
id: push-files
61+
run: |
62+
CHANGED_FILES=$(git diff --name-only HEAD^..HEAD -- '*.py' '*.rst' '*.md')
63+
echo "files<<EOF" >> $GITHUB_OUTPUT
64+
echo "$CHANGED_FILES" >> $GITHUB_OUTPUT
65+
echo "EOF" >> $GITHUB_OUTPUT
66+
67+
- name: Check if relevant files changed
68+
if: steps.check-files.outputs.skip != 'true'
69+
id: check
70+
run: |
71+
if [ "${{ steps.check-files.outputs.is-pr }}" == "true" ]; then
72+
FILES="${{ steps.check-files.outputs.files }}"
73+
else
74+
FILES="${{ steps.push-files.outputs.files }}"
75+
fi
76+
77+
if [ -z "$FILES" ]; then
78+
echo "skip=true" >> $GITHUB_OUTPUT
79+
echo "No relevant files changed (*.py, *.rst, *.md), skipping spell check"
80+
else
81+
echo "skip=false" >> $GITHUB_OUTPUT
82+
echo "Found changed files to check:"
83+
echo "$FILES"
84+
fi
85+
1386
- uses: actions/setup-python@v4
87+
if: |
88+
steps.check-files.outputs.skip != 'true' &&
89+
steps.check.outputs.skip != 'true'
1490
with:
1591
python-version: '3.9'
1692
cache: 'pip'
17-
- run: pip install pyspelling
18-
- run: sudo apt-get install aspell aspell-en
19-
- run: pyspelling
2093

94+
- name: Install dependencies
95+
if: |
96+
steps.check-files.outputs.skip != 'true' &&
97+
steps.check.outputs.skip != 'true'
98+
run: |
99+
pip install pyspelling
100+
sudo apt-get install aspell aspell-en
101+
102+
- name: Run spell check on each file
103+
id: spellcheck
104+
if: |
105+
steps.check-files.outputs.skip != 'true' &&
106+
steps.check.outputs.skip != 'true'
107+
run: |
108+
if [ "${{ steps.check-files.outputs.is-pr }}" == "true" ]; then
109+
mapfile -t FILES <<< "${{ steps.check-files.outputs.files }}"
110+
else
111+
mapfile -t FILES <<< "${{ steps.push-files.outputs.files }}"
112+
fi
113+
114+
# Check each file individually
115+
FINAL_EXIT_CODE=0
116+
SPELLCHECK_LOG=""
117+
for file in "${FILES[@]}"; do
118+
if [ -n "$file" ]; then
119+
echo "Checking spelling in $file"
120+
python3 -c "import yaml; config = yaml.safe_load(open('.pyspelling.yml')); new_matrix = [matrix.copy() for matrix in config['matrix'] if (('python' in matrix['name'].lower() and '$file'.endswith('.py')) or ('rest' in matrix['name'].lower() and '$file'.endswith('.rst')) or ('markdown' in matrix['name'].lower() and '$file'.endswith('.md'))) and not matrix.update({'sources': ['$file']})]; config['matrix'] = new_matrix; yaml.dump(config, open('temp_config.yml', 'w'))"
121+
122+
if OUTPUT=$(pyspelling -c temp_config.yml 2>&1); then
123+
echo "No spelling errors found in $file"
124+
else
125+
FINAL_EXIT_CODE=1
126+
echo "Spelling errors found in $file:"
127+
echo "$OUTPUT"
128+
SPELLCHECK_LOG+="### $file\n$OUTPUT\n\n"
129+
fi
130+
fi
131+
done
132+
133+
# Save the results to GITHUB_OUTPUT
134+
echo "spell_failed=$FINAL_EXIT_CODE" >> $GITHUB_OUTPUT
135+
echo "spell_log<<SPELLEOF" >> $GITHUB_OUTPUT
136+
echo "$SPELLCHECK_LOG" >> $GITHUB_OUTPUT
137+
echo "SPELLEOF" >> $GITHUB_OUTPUT
138+
139+
if [ $FINAL_EXIT_CODE -ne 0 ]; then
140+
echo "Spell check failed! See above for details."
141+
echo
142+
echo "Here are a few tips:"
143+
echo "- All PyTorch API objects must be in double backticks or use an intersphinx directive."
144+
echo " Example: ``torch.nn``, :func:"
145+
echo "- Consult en-wordlist.txt for spellings of some of the words."
146+
echo " You can add a word to en-wordlist.txt if:"
147+
echo " 1) It's a common abbreviation, like RNN."
148+
echo " 2) It's a word widely accepted in the industry."
149+
echo "- Please do not add words like 'dtype', 'torch.nn.Transformer' to pass spellcheck."
150+
echo " Instead wrap it in double backticks or use an intersphinx directive."
151+
echo
152+
exit 1
153+
fi

.jenkins/build.sh

+4-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@ sudo apt-get install -y pandoc
2222
#Install PyTorch Nightly for test.
2323
# Nightly - pip install --pre torch torchvision torchaudio -f https://download.pytorch.org/whl/nightly/cu102/torch_nightly.html
2424
# Install 2.5 to merge all 2.4 PRs - uncomment to install nightly binaries (update the version as needed).
25-
# pip uninstall -y torch torchvision torchaudio torchtext torchdata
26-
# pip3 install torch==2.5.0 torchvision torchaudio --no-cache-dir --index-url https://download.pytorch.org/whl/test/cu124
25+
# sudo pip uninstall -y torch torchvision torchaudio torchtext torchdata
26+
# sudo pip3 install torch==2.6.0 torchvision --no-cache-dir --index-url https://download.pytorch.org/whl/test/cu124
27+
# sudo pip uninstall -y fbgemm-gpu torchrec
28+
# sudo pip3 install fbgemm-gpu==1.1.0 torchrec==1.0.0 --no-cache-dir --index-url https://download.pytorch.org/whl/test/cu124
2729

2830
# Install two language tokenizers for Translation with TorchText tutorial
2931
python -m spacy download en_core_web_sm

0 commit comments

Comments
 (0)