Skip to content

Commit 4b2970f

Browse files
author
pytorchbot
committed
2024-10-02 nightly release (18525e1)
1 parent 972a833 commit 4b2970f

File tree

250 files changed

+6291
-2622
lines changed

Some content is hidden

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

250 files changed

+6291
-2622
lines changed

.ci/docker/build.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,14 @@ case "$image" in
379379
GCC_VERSION=11
380380
CONDA_CMAKE=yes
381381
HALIDE=yes
382+
TRITON=yes
383+
;;
384+
pytorch-linux-jammy-py3.12-triton-cpu)
385+
CUDA_VERSION=12.4
386+
ANACONDA_PYTHON_VERSION=3.12
387+
GCC_VERSION=11
388+
CONDA_CMAKE=yes
389+
TRITON_CPU=yes
382390
;;
383391
pytorch-linux-focal-linter)
384392
# TODO: Use 3.9 here because of this issue https://github.com/python/mypy/issues/13627.
@@ -509,6 +517,7 @@ docker build \
509517
--build-arg "UCC_COMMIT=${UCC_COMMIT}" \
510518
--build-arg "CONDA_CMAKE=${CONDA_CMAKE}" \
511519
--build-arg "TRITON=${TRITON}" \
520+
--build-arg "TRITON_CPU=${TRITON_CPU}" \
512521
--build-arg "ONNX=${ONNX}" \
513522
--build-arg "DOCS=${DOCS}" \
514523
--build-arg "INDUCTOR_BENCHMARKS=${INDUCTOR_BENCHMARKS}" \
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
6a333f1b05671f6fada4ba7bbfae4a02a9d96f4f

.ci/docker/common/install_triton.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,11 @@ conda_reinstall() {
1515
if [ -n "${XPU_VERSION}" ]; then
1616
TRITON_REPO="https://github.com/intel/intel-xpu-backend-for-triton"
1717
TRITON_TEXT_FILE="triton-xpu"
18+
elif [ -n "${TRITON_CPU}" ]; then
19+
TRITON_REPO="https://github.com/triton-lang/triton-cpu"
20+
TRITON_TEXT_FILE="triton-cpu"
1821
else
19-
TRITON_REPO="https://github.com/openai/triton"
22+
TRITON_REPO="https://github.com/triton-lang/triton"
2023
TRITON_TEXT_FILE="triton"
2124
fi
2225

@@ -44,9 +47,10 @@ chown -R jenkins /var/lib/jenkins/triton
4447
chgrp -R jenkins /var/lib/jenkins/triton
4548
pushd /var/lib/jenkins/
4649

47-
as_jenkins git clone ${TRITON_REPO} triton
50+
as_jenkins git clone --recursive ${TRITON_REPO} triton
4851
cd triton
4952
as_jenkins git checkout ${TRITON_PINNED_COMMIT}
53+
as_jenkins git submodule update --init --recursive
5054
cd python
5155

5256
# TODO: remove patch setup.py once we have a proper fix for https://github.com/triton-lang/triton/issues/4527

.ci/docker/ubuntu/Dockerfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,13 @@ COPY ci_commit_pins/triton.txt triton.txt
147147
RUN if [ -n "${TRITON}" ]; then bash ./install_triton.sh; fi
148148
RUN rm install_triton.sh common_utils.sh triton.txt
149149

150+
ARG TRITON_CPU
151+
COPY ./common/install_triton.sh install_triton.sh
152+
COPY ./common/common_utils.sh common_utils.sh
153+
COPY ci_commit_pins/triton-cpu.txt triton-cpu.txt
154+
RUN if [ -n "${TRITON_CPU}" ]; then bash ./install_triton.sh; fi
155+
RUN rm install_triton.sh common_utils.sh triton-cpu.txt
156+
150157
ARG EXECUTORCH
151158
# Build and install executorch
152159
COPY ./common/install_executorch.sh install_executorch.sh

.ci/pytorch/test.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ test_inductor_cpp_wrapper_abi_compatible() {
376376

377377
echo "Testing Inductor cpp wrapper mode with TORCHINDUCTOR_ABI_COMPATIBLE=1"
378378
PYTORCH_TESTING_DEVICE_ONLY_FOR="" python test/run_test.py --include inductor/test_cpu_cpp_wrapper
379-
python test/run_test.py --include inductor/test_cuda_cpp_wrapper inductor/test_cpu_repro
379+
python test/run_test.py --include inductor/test_cuda_cpp_wrapper inductor/test_cpu_repro inductor/test_extension_backend
380380

381381
TORCHINDUCTOR_CPP_WRAPPER=1 python benchmarks/dynamo/timm_models.py --device cuda --accuracy --amp \
382382
--training --inductor --disable-cudagraphs --only vit_base_patch16_224 \
@@ -403,7 +403,7 @@ pr_time_benchmarks() {
403403
PYTHONPATH=$(pwd)/benchmarks/dynamo/pr_time_benchmarks source benchmarks/dynamo/pr_time_benchmarks/benchmark_runner.sh "$TEST_REPORTS_DIR/pr_time_benchmarks_results.csv" "benchmarks/dynamo/pr_time_benchmarks/benchmarks"
404404
echo "benchmark results on current PR: "
405405
cat "$TEST_REPORTS_DIR/pr_time_benchmarks_results.csv"
406-
406+
PYTHONPATH=$(pwd)/benchmarks/dynamo/pr_time_benchmarks python benchmarks/dynamo/pr_time_benchmarks/check_results.py "benchmarks/dynamo/pr_time_benchmarks/expected_results.csv" "$TEST_REPORTS_DIR/pr_time_benchmarks_results.csv"
407407
}
408408

409409
if [[ "${TEST_CONFIG}" == *pr_time_benchmarks* ]]; then
@@ -606,6 +606,11 @@ test_inductor_halide() {
606606
assert_git_not_dirty
607607
}
608608

609+
test_inductor_triton_cpu() {
610+
python test/run_test.py --include inductor/test_triton_cpu_backend.py --verbose
611+
assert_git_not_dirty
612+
}
613+
609614
test_dynamo_benchmark() {
610615
# Usage: test_dynamo_benchmark huggingface 0
611616
TEST_REPORTS_DIR=$(pwd)/test/test-reports
@@ -1439,6 +1444,8 @@ elif [[ "${TEST_CONFIG}" == *inductor_distributed* ]]; then
14391444
test_inductor_distributed
14401445
elif [[ "${TEST_CONFIG}" == *inductor-halide* ]]; then
14411446
test_inductor_halide
1447+
elif [[ "${TEST_CONFIG}" == *inductor-triton-cpu* ]]; then
1448+
test_inductor_triton_cpu
14421449
elif [[ "${TEST_CONFIG}" == *inductor-micro-benchmark* ]]; then
14431450
test_inductor_micro_benchmark
14441451
elif [[ "${TEST_CONFIG}" == *huggingface* ]]; then

.ci/pytorch/win-build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ fi
2626
export SCRIPT_HELPERS_DIR=$SCRIPT_PARENT_DIR/win-test-helpers
2727

2828
set +ex
29-
grep -E -R 'PyLong_(From|As)(Unsigned|)Long\(' --exclude=python_numbers.h --exclude=eval_frame.c torch/
29+
grep -E -R 'PyLong_(From|As)(Unsigned|)Long\(' --exclude=python_numbers.h --exclude=pythoncapi_compat.h --exclude=eval_frame.c torch/
3030
PYLONG_API_CHECK=$?
3131
if [[ $PYLONG_API_CHECK == 0 ]]; then
3232
echo "Usage of PyLong_{From,As}{Unsigned}Long API may lead to overflow errors on Windows"

.github/ISSUE_TEMPLATE.md

Lines changed: 0 additions & 38 deletions
This file was deleted.

.github/ISSUE_TEMPLATE/ci-sev.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ about: Tracking incidents for PyTorch's CI infra.
55

66
> NOTE: Remember to label this issue with "`ci: sev`"
77
8-
**MERGE BLOCKING** <!-- remove this line if you don't want this SEV to block merges -->
8+
<!-- uncomment the below line if you don't want this SEV to block merges -->
9+
<!-- **MERGE BLOCKING** -->
910

1011
## Current Status
1112
*Status could be: preemptive, ongoing, mitigated, closed. Also tell people if they need to take action to fix it (i.e. rebase)*.

.github/scripts/runner_determinator.py

Lines changed: 41 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# flake8: noqa: G004
22

3+
# Note: Copies of this script in runner_determinator.py and _runner-determinator.yml
4+
# must be kept in sync. You can do it easily by running the following command:
5+
# python .github/scripts/update_runner_determinator.py
6+
37
"""
48
This runner determinator is used to determine which set of runners to run a
59
GitHub job on. It uses the first comment of a GitHub issue (by default
@@ -79,6 +83,9 @@ class Experiment(NamedTuple):
7983
rollout_perc: float = (
8084
0 # Percentage of workflows to experiment on when user is not opted-in.
8185
)
86+
all_branches: bool = (
87+
False # If True, the experiment is also enabled on the exception branches
88+
)
8289

8390
# Add more fields as needed
8491

@@ -212,7 +219,7 @@ def get_potential_pr_author(
212219

213220
def is_exception_branch(branch: str) -> bool:
214221
"""
215-
Branches that get opted out of all experiments and should always use Meta runners
222+
Branches that get opted out of experiments by default, until they're explicitly enabled.
216223
"""
217224
return branch.split("/")[0] in {"main", "nightly", "release", "landchecks"}
218225

@@ -338,7 +345,10 @@ def is_user_opted_in(user: str, user_optins: UserOptins, experiment_name: str) -
338345

339346

340347
def get_runner_prefix(
341-
rollout_state: str, workflow_requestors: Iterable[str], is_canary: bool = False
348+
rollout_state: str,
349+
workflow_requestors: Iterable[str],
350+
branch: str,
351+
is_canary: bool = False,
342352
) -> str:
343353
settings = parse_settings(rollout_state)
344354
user_optins = parse_users(rollout_state)
@@ -348,6 +358,12 @@ def get_runner_prefix(
348358
for experiment_name, experiment_settings in settings.experiments.items():
349359
enabled = False
350360

361+
if not experiment_settings.all_branches and is_exception_branch(branch):
362+
log.info(
363+
f"Branch {branch} is an exception branch. Not enabling experiment {experiment_name}."
364+
)
365+
continue
366+
351367
# Is any workflow_requestor opted in to this experiment?
352368
opted_in_users = [
353369
requestor
@@ -407,35 +423,34 @@ def get_rollout_state_from_issue(github_token: str, repo: str, issue_num: int) -
407423
def main() -> None:
408424
args = parse_args()
409425

410-
if args.github_ref_type == "branch" and is_exception_branch(args.github_branch):
411-
log.info(
412-
f"Exception branch: '{args.github_branch}', using Meta runners and no experiments."
426+
runner_label_prefix = DEFAULT_LABEL_PREFIX
427+
428+
try:
429+
rollout_state = get_rollout_state_from_issue(
430+
args.github_token, args.github_issue_repo, args.github_issue
413431
)
414-
runner_label_prefix = DEFAULT_LABEL_PREFIX
415-
else:
416-
try:
417-
rollout_state = get_rollout_state_from_issue(
418-
args.github_token, args.github_issue_repo, args.github_issue
419-
)
420432

421-
username = get_potential_pr_author(
422-
args.github_token,
423-
args.github_repo,
424-
args.github_actor,
425-
args.github_ref_type,
426-
args.github_branch,
427-
)
433+
username = get_potential_pr_author(
434+
args.github_token,
435+
args.github_repo,
436+
args.github_actor,
437+
args.github_ref_type,
438+
args.github_branch,
439+
)
428440

429-
is_canary = args.github_repo == "pytorch/pytorch-canary"
441+
is_canary = args.github_repo == "pytorch/pytorch-canary"
430442

431-
runner_label_prefix = get_runner_prefix(
432-
rollout_state, (args.github_issue_owner, username), is_canary
433-
)
443+
runner_label_prefix = get_runner_prefix(
444+
rollout_state,
445+
(args.github_issue_owner, username),
446+
args.github_branch,
447+
is_canary,
448+
)
434449

435-
except Exception as e:
436-
log.error(
437-
f"Failed to get issue. Defaulting to Meta runners and no experiments. Exception: {e}"
438-
)
450+
except Exception as e:
451+
log.error(
452+
f"Failed to get issue. Defaulting to Meta runners and no experiments. Exception: {e}"
453+
)
439454

440455
set_github_output(GH_OUTPUT_KEY_LABEL_TYPE, runner_label_prefix)
441456

0 commit comments

Comments
 (0)