8000 Merge branch 'pytorch:main' into main · pytorch/pytorch@52e948c · GitHub
[go: up one dir, main page]

Skip to content

Commit 52e948c

Browse files
Merge branch 'pytorch:main' into main
2 parents 5145626 + 7e16cb9 commit 52e948c

File tree

247 files changed

+2829
-9167
lines changed

Some content is hidden

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

247 files changed

+2829
-9167
lines changed

.ci/pytorch/build.sh

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -99,30 +99,6 @@ if [[ "$BUILD_ENVIRONMENT" == *aarch64* ]]; then
9999
export ACL_ROOT_DIR=/ComputeLibrary
100100
fi
101101

102-
if [[ "$BUILD_ENVIRONMENT" == *libtorch* ]]; then
103-
POSSIBLE_JAVA_HOMES=()
104-
POSSIBLE_JAVA_HOMES+=(/usr/local)
105-
POSSIBLE_JAVA_HOMES+=(/usr/lib/jvm/java-8-openjdk-amd64)
106-
POSSIBLE_JAVA_HOMES+=(/Library/Java/JavaVirtualMachines/*.jdk/Contents/Home)
107-
# Add the Windows-specific JNI
108-
POSSIBLE_JAVA_HOMES+=("$PWD/.circleci/windows-jni/")
109-
for JH in "${POSSIBLE_JAVA_HOMES[@]}" ; do
110-
if [[ -e "$JH/include/jni.h" ]] ; then
111-
# Skip if we're not on Windows but haven't found a JAVA_HOME
112-
if [[ "$JH" == "$PWD/.circleci/windows-jni/" && "$OSTYPE" != "msys" ]] ; then
113-
break
114-
fi
115-
echo "Found jni.h under $JH"
116-
export JAVA_HOME="$JH"
117-
export BUILD_JNI=ON
118-
break
119-
fi
120-
done
121-
if [ -z "$JAVA_HOME" ]; then
122-
echo "Did not find jni.h"
123-
fi
124-
fi
125-
126102
# Use special scripts for Android builds
127103
if [[ "${BUILD_ENVIRONMENT}" == *-android* ]]; then
128104
export ANDROID_NDK=/opt/ndk

.ci/pytorch/macos-test.sh

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,8 @@ test_torchbench_smoketest() {
232232
mkdir -p "$TEST_REPORTS_DIR"
233233

234234
local device=mps
235-
local models=(hf_T5 llama BERT_pytorch dcgan hf_GPT2 yolov3 resnet152 sam pytorch_unet stable_diffusion_text_encoder moco speech_transformer)
235+
local models=(hf_T5 llama BERT_pytorch dcgan hf_GPT2 yolov3 resnet152 sam pytorch_unet stable_diffusion_text_encoder speech_transformer Super_SloMo)
236+
local hf_models=(GoogleFnet YituTechConvBert)
236237

237238
for backend in eager inductor; do
238239

@@ -253,6 +254,16 @@ test_torchbench_smoketest() {
253254
--output "$TEST_REPORTS_DIR/inductor_${backend}_torchbench_${dtype}_inference_${device}_accuracy.csv" || true
254255
fi
255256
done
257+
for model in "${hf_models[@]}"; do
258+
if [ "$backend" == "inductor" ]; then
259+
PYTHONPATH="$(pwd)"/torchbench python benchmarks/dynamo/huggingface.py \
260+
--performance --only "$model" --backend "$backend" --inference --devices "$device" "$dtype_arg" \
261+
--output "$TEST_REPORTS_DIR/inductor_${backend}_torchbench_${dtype}_inference_${device}_performance.csv" || true
262+
PYTHONPATH="$(pwd)"/torchbench python benchmarks/dynamo/huggingface.py \
263+
--accuracy --only "$model" --backend "$backend" --inference --devices "$device" "$dtype_arg" \
264+
--output "$TEST_REPORTS_DIR/inductor_${backend}_torchbench_${dtype}_inference_${device}_accuracy.csv" || true
265+
fi
266+
done
256267
done
257268

258269
for dtype in notset amp; do

.flake8

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ ignore =
1616
# these ignores are from flake8-comprehensions; please fix!
1717
C407,
1818
# these ignores are from flake8-logging-format; please fix!
19-
G100,G101,G200
19+
G100,G101,G200,
20+
# G201 replaced by LOG400 in ruff
21+
G201,
2022
# these ignores are from flake8-simplify. please fix or ignore with commented reason
2123
SIM105,SIM108,SIM110,SIM111,SIM113,SIM114,SIM115,SIM116,SIM117,SIM118,SIM119,SIM12,
2224
# SIM104 is already covered by pyupgrade ruff

.github/actions/upload-utilization-stats/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ runs:
4444
retry_wait_seconds: 30
4545
command: |
4646
set -eu
47-
python3 -m pip install python-dateutil==2.8.2 boto3==1.35.42 pandas==2.1.3
47+
python3 -m pip install python-dateutil==2.8.2 boto3==1.35.42 pandas==2.1.3 dataclasses_json==0.6.7
4848
- name: Upload utilizatoin stats to s3
4949
shell: bash
5050
run: |

.github/pytorch-probot.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ ciflow_push_tags:
2525
- ciflow/unstable
2626
- ciflow/xpu
2727
- ciflow/torchbench
28-
- ciflow/autoformat
2928
- ciflow/op-benchmark
3029
- ciflow/pull
3130
- ciflow/h100

.github/scripts/runner_determinator.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -623,9 +623,9 @@ def main() -> None:
623623
is_canary,
624624
)
625625

626-
except Exception as e:
627-
log.error(
628-
f"Failed to get issue. Defaulting to Meta runners and no experiments. Exception: {e}"
626+
except Exception:
627+
log.exception(
628+
"Failed to get issue. Defaulting to Meta runners and no experiments."
629629
)
630630

631631
set_github_output(GH_OUTPUT_KEY_LABEL_TYPE, runner_label_prefix)

.github/scripts/trymerge.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1938,6 +1938,7 @@ def get_ghstack_dependent_prs(
19381938

19391939
def do_revert_prs(
19401940
repo: GitRepo,
1941+
original_pr: GitHubPR,
19411942
shas_and_prs: list[tuple[str, GitHubPR]],
19421943
*,
19431944
author_login: str,
@@ -1959,9 +1960,16 @@ def do_revert_prs(
19591960

19601961
# Comment/reopen PRs
19611962
for commit_sha, pr in shas_and_prs:
1962-
revert_message = (
1963-
f"@{pr.get_pr_creator_login()} your PR has been successfully reverted."
1964-
)
1963+
revert_message = ""
1964+
if pr.pr_num == original_pr.pr_num:
1965+
revert_message += (
1966+
f"@{pr.get_pr_creator_login()} your PR has been successfully reverted."
1967+
)
1968+
else:
1969+
revert_message += (
1970+
f"@{pr.get_pr_creator_login()} your PR has been reverted as part of the stack under "
1971+
f"#{original_pr.pr_num}.\n"
1972+
)
19651973
if (
19661974
pr.has_internal_changes()
19671975
and not pr.has_no_connected_diff()
@@ -2013,6 +2021,7 @@ def try_revert(
20132021

20142022
do_revert_prs(
20152023
repo,
2024+
pr,
20162025
shas_and_prs,
20172026
author_login=author_login,
20182027
extra_msg=extra_msg,

.github/workflows/inductor-perf-compare.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
docker-image: ${{ needs.linux-focal-cuda12_6-py3_10-gcc9-inductor-build.outputs.docker-image }}
5353
test-matrix: ${{ needs.linux-focal-cuda12_6-py3_10-gcc9-inductor-build.outputs.test-matrix }}
5454
# disable monitor in perf tests for more investigation
55-
disable-monitor: true
55+
disable-monitor: false
5656
monitor-log-interval: 15
5757
monitor-data-collect-interval: 4
5858
secrets: inherit

.github/workflows/inductor-perf-test-nightly-aarch64.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,9 @@ jobs:
129129
test-matrix: ${{ needs.linux-jammy-aarch64-py3_10-inductor-build.outputs.test-matrix }}
130130
timeout-minutes: 720
131131
# disable monitor in perf tests for more investigation
132-
disable-monitor: true
132+
disable-monitor: false
133+
monitor-log-interval: 15
134+
monitor-data-collect-interval: 4
133135
secrets: inherit
134136

135137

.github/workflows/inductor-perf-test-nightly-h100.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ jobs:
122122
test-matrix: ${{ needs.build.outputs.test-matrix }}
123123
timeout-minutes: 720
124124
# disable monitor in perf tests, next step is to enable it
125-
disable-monitor: true
125+
disable-monitor: false
126126
monitor-log-interval: 15
127127
monitor-data-collect-interval: 4
128128
secrets: inherit
@@ -139,7 +139,7 @@ jobs:
139139
test-matrix: ${{ needs.build.outputs.test-matrix }}
140140
timeout-minutes: 1440
141141
# disable monitor in perf tests, next step is to enable it
142-
disable-monitor: true
142+
disable-monitor: false
143143
monitor-log-interval: 15
144144
monitor-data-collect-interval: 4
145145
secrets: inherit
@@ -156,7 +156,7 @@ jobs:
156156
test-matrix: ${{ needs.build.outputs.test-matrix }}
157157
timeout-minutes: 720
158158
# disable monitor in perf tests for more investigation
159-
disable-monitor: true
159+
disable-monitor: false
160160
monitor-log-interval: 15
161161
monitor-data-collect-interval: 4
162162
secrets: inherit

.github/workflows/inductor-perf-test-nightly-x86.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ jobs:
103103
test-matrix: ${{ needs.linux-jammy-cpu-py3_9-gcc11-inductor-build.outputs.test-matrix }}
104104
timeout-minutes: 720
105105
# disable monitor in perf tests
106-
disable-monitor: true
106+
disable-monitor: false
107107
monitor-log-interval: 15
108108
monitor-data-collect-interval: 4
109109
secrets: inherit
@@ -121,7 +121,7 @@ jobs:
121121
test-matrix: ${{ needs.linux-jammy-cpu-py3_9-gcc11-inductor-build.outputs.test-matrix }}
122122
timeout-minutes: 720
123123
# disable monitor in perf tests
124-
disable-monitor: true
124+
disable-monitor: false
125125
monitor-log-interval: 15
126126
monitor-data-collect-interval: 4
127127
secrets: inherit

.github/workflows/inductor-perf-test-nightly.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,7 @@ jobs:
123123
docker-image: ${{ needs.linux-focal-cuda12_6-py3_10-gcc9-inductor-build.outputs.docker-image }}
124124
test-matrix: ${{ needs.linux-focal-cuda12_6-py3_10-gcc9-inductor-build.outputs.test-matrix }}
125125
timeout-minutes: 720
126-
# disable monitor in perf tests, next step is to enable it
127-
disable-monitor: true
126+
disable-monitor: false
128127
monitor-log-interval: 15
129128
monitor-data-collect-interval: 4
130129
secrets: inherit
@@ -141,7 +140,7 @@ jobs:
141140
test-matrix: ${{ needs.linux-focal-cuda12_6-py3_10-gcc9-inductor-build.outputs.test-matrix }}
142141
timeout-minutes: 1440
143142
# disable monitor in perf tests, next step is to enable it
144-
disable-monitor: true
143+
disable-monitor: false
145144
monitor-log-interval: 15
146145
monitor-data-collect-interval: 4
147146
secrets: inherit
@@ -157,8 +156,7 @@ jobs:
157156
docker-image: ${{ needs.linux-focal-cuda12_6-py3_10-gcc9-inductor-build.outputs.docker-image }}
158157
test-matrix: ${{ needs.linux-focal-cuda12_6-py3_10-gcc9-inductor-build.outputs.test-matrix }}
159158
timeout-minutes: 720
160-
# disable monitor in perf tests, next step is to enable it
161-
disable-monitor: true
159+
disable-monitor: false
162160
monitor-log-interval: 15
163161
monitor-data-collect-interval: 4
164162
secrets: inherit

.github/workflows/inductor-periodic.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,6 @@ jobs:
133133
build-environment: linux-focal-cuda12.6-py3.10-gcc9-sm80
134134
docker-image: ${{ needs.linux-focal-cuda12_6-py3_10-gcc9-inductor-build-gcp.outputs.docker-image }}
135135
test-matrix: ${{ needs.linux-focal-cuda12_6-py3_10-gcc9-inductor-build-gcp.outputs.test-matrix }}
136-
# disable monitor in perf tests, next step is to enable it
137-
disable-monitor: true
138-
monitor-log-interval: 15
139-
monitor-data-collect-interval: 4
140136
secrets: inherit
141137

142138
linux-jammy-cpu-py3_9-gcc11-periodic-dynamo-benchmarks-build:

.github/workflows/lint-autoformat.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
name: Apply lint suggestions
22

33
on:
4-
5-
push:
6-
tags:
7-
- ciflow/autoformat/*
4+
pull_request:
5+
types: [opened, synchronize, reopened, labeled, unlabeled]
86

97
jobs:
108
lintrunner-autoformat:
119
permissions:
1210
contents: read
1311
pull-requests: write
1412
runs-on: lf.linux.2xlarge
15-
if: ${{ github.repository_owner == 'pytorch' && github.event.pull_request.user.login != 'ezyang' && github.event.pull_request.user.login != 'malfet' && !startsWith(github.head_ref, 'export-') }}
13+
if: ${{ github.repository_owner == 'pytorch' && contains(github.event.pull_request.labels.*.name, 'autoformat') }}
1614
steps:
1715
- name: Checkout pytorch
1816
uses: pytorch/pytorch/.github/actions/checkout-pytorch@main
@@ -21,12 +19,11 @@ jobs:
2119
fetch-depth: 0
2220
- name: Run lintrunner (nonretryable)
2321
continue-on-error: true
24-
# we can't run all files here because only changes around where the diff are shown in the PR UI
2522
run: |
2623
set -ex
2724
python3 -m venv /tmp/venv
2825
source /tmp/venv/bin/activate
29-
export ADDITIONAL_LINTRUNNER_ARGS="format"
26+
export ADDITIONAL_LINTRUNNER_ARGS="format --all-files"
3027
bash .github/scripts/lintrunner.sh
3128
- name: Check for changes
3229
id: git-check

.github/workflows/trunk.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ jobs:
138138
build-environment: win-vs2022-cpu-py3
139139
cuda-version: cpu
140140
test-matrix: ${{ needs.win-vs2022-cpu-py3-build.outputs.test-matrix }}
141+
disable-monitor: false
141142
secrets: inherit
142143

143144
win-vs2022-cuda12_6-py3-build:

.github/workflows/upload-test-stats.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,25 @@ name: Upload test stats
22

33
on:
44
workflow_run:
5-
workflows: [pull, trunk, periodic, periodic-rocm-mi300, inductor, unstable, slow, unstable-periodic, inductor-periodic, rocm, rocm-mi300, inductor-micro-benchmark, inductor-micro-benchmark-x86, inductor-cu124, inductor-rocm, inductor-rocm-mi300, mac-mps]
5+
workflows:
6+
- pull
7+
- trunk
8+
- periodic
9+
- periodic-rocm-mi300
10+
- inductor
11+
- unstable
12+
- slow
13+
- unstable-periodic
14+
- inductor-periodic
15+
- rocm
16+
- rocm-mi300
17+
- inductor-micro-benchmark
18+
- inductor-micro-benchmark-x86
19+
- inductor-cu124
20+
- inductor-rocm
21+
- inductor-rocm-mi300
22+
- mac-mps
23+
- linux-aarch64
624
types:
725
- completed
826

CMakeLists.txt

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,6 @@ option(
222222
BUILD_MOBILE_TEST
223223
"Build C++ test binaries for mobile (ARM) targets(need gtest and gbenchmark)"
224224
OFF)
225-
option(BUILD_JNI "Build JNI bindings" OFF)
226225
option(BUILD_MOBILE_AUTOGRAD
227226
"Build autograd function in mobile build (in development)" OFF)
228227
cmake_dependent_option(INSTALL_TEST "Install test binaries if BUILD_TEST is on"
@@ -1350,16 +1349,6 @@ if(BUILD_BINARY)
13501349
add_subdirectory(binaries)
13511350
endif()
13521351

1353-
# ---[ JNI
1354-
if(BUILD_JNI)
1355-
if(NOT MSVC)
1356-
string(APPEND CMAKE_CXX_FLAGS " -Wno-unused-variable")
1357-
endif()
1358-
set(BUILD_LIBTORCH_WITH_JNI 1)
1359-
set(FBJNI_SKIP_TESTS 1)
1360-
add_subdirectory(android/pytorch_android)
1361-
endif()
1362-
13631352
include(cmake/Summary.cmake)
13641353
caffe2_print_configuration_summary()
13651354

0 commit comments

Comments
 (0)
0