diff options
10 files changed, 38 insertions, 7 deletions
diff --git a/.circleci/config.yml b/.circleci/config.yml index 3a64240fcf..cb3e148e2e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -644,6 +644,15 @@ jobs: set -ex export SCRIBE_GRAPHQL_ACCESS_TOKEN="${SCRIBE_GRAPHQL_ACCESS_TOKEN}" export JOB_BASE_NAME="$CIRCLE_JOB" + # temporary fix for https://github.com/pytorch/pytorch/issues/60746 + if [ -z "$CIRCLE_PR_NUMBER" ]; then + if [[ $CIRCLE_BRANCH =~ .*pull.* ]]; then + export PR_NUMBER="$(echo $CIRCLE_BRANCH | sed 's/[^0-9]//g')" + export CIRCLE_PR_NUMBER="$PR_NUMBER" + fi + else + export PR_NUMBER="$CIRCLE_PR_NUMBER" + fi ${PARALLEL_FLAGS} cd workspace EOL diff --git a/.circleci/verbatim-sources/job-specs/pytorch-job-specs.yml b/.circleci/verbatim-sources/job-specs/pytorch-job-specs.yml index bcc02edd5f..422e44e8a6 100644 --- a/.circleci/verbatim-sources/job-specs/pytorch-job-specs.yml +++ b/.circleci/verbatim-sources/job-specs/pytorch-job-specs.yml @@ -174,6 +174,15 @@ jobs: set -ex export SCRIBE_GRAPHQL_ACCESS_TOKEN="${SCRIBE_GRAPHQL_ACCESS_TOKEN}" export JOB_BASE_NAME="$CIRCLE_JOB" + # temporary fix for https://github.com/pytorch/pytorch/issues/60746 + if [ -z "$CIRCLE_PR_NUMBER" ]; then + if [[ $CIRCLE_BRANCH =~ .*pull.* ]]; then + export PR_NUMBER="$(echo $CIRCLE_BRANCH | sed 's/[^0-9]//g')" + export CIRCLE_PR_NUMBER="$PR_NUMBER" + fi + else + export PR_NUMBER="$CIRCLE_PR_NUMBER" + fi ${PARALLEL_FLAGS} cd workspace EOL diff --git a/.github/templates/linux_ci_workflow.yml.j2 b/.github/templates/linux_ci_workflow.yml.j2 index ec39ef6f5f..bceeba51f2 100644 --- a/.github/templates/linux_ci_workflow.yml.j2 +++ b/.github/templates/linux_ci_workflow.yml.j2 @@ -353,6 +353,7 @@ jobs: - name: Test PyTorch env: BUILD_ENVIRONMENT: !{{ build_environment }}-${{ matrix.config }} + PR_NUMBER: ${{ github.event.pull_request.number }} run: | if [[ $TEST_CONFIG == 'multigpu' ]]; then TEST_COMMAND=.jenkins/pytorch/multigpu-test.sh @@ -368,6 +369,7 @@ jobs: docker run \ ${GPU_FLAG:-} \ -e BUILD_ENVIRONMENT \ + -e PR_NUMBER \ -e CUSTOM_TEST_ARTIFACT_BUILD_DIR \ -e GITHUB_ACTIONS \ -e IN_CI \ diff --git a/.github/workflows/generated-linux-bionic-cuda10.2-py3.9-gcc7.yml b/.github/workflows/generated-linux-bionic-cuda10.2-py3.9-gcc7.yml index 7aa572d833..1e1aec057c 100644 --- a/.github/workflows/generated-linux-bionic-cuda10.2-py3.9-gcc7.yml +++ b/.github/workflows/generated-linux-bionic-cuda10.2-py3.9-gcc7.yml @@ -321,6 +321,7 @@ jobs: - name: Test PyTorch env: BUILD_ENVIRONMENT: linux-bionic-cuda10.2-py3.9-gcc7-${{ matrix.config }} + PR_NUMBER: ${{ github.event.pull_request.number }} run: | if [[ $TEST_CONFIG == 'multigpu' ]]; then TEST_COMMAND=.jenkins/pytorch/multigpu-test.sh @@ -336,6 +337,7 @@ jobs: docker run \ ${GPU_FLAG:-} \ -e BUILD_ENVIRONMENT \ + -e PR_NUMBER \ -e CUSTOM_TEST_ARTIFACT_BUILD_DIR \ -e GITHUB_ACTIONS \ -e IN_CI \ diff --git a/.github/workflows/generated-linux-bionic-py3.8-gcc9-coverage.yml b/.github/workflows/generated-linux-bionic-py3.8-gcc9-coverage.yml index eda7568a80..28180e3e98 100644 --- a/.github/workflows/generated-linux-bionic-py3.8-gcc9-coverage.yml +++ b/.github/workflows/generated-linux-bionic-py3.8-gcc9-coverage.yml @@ -321,6 +321,7 @@ jobs: - name: Test PyTorch env: BUILD_ENVIRONMENT: linux-bionic-py3.8-gcc9-coverage-${{ matrix.config }} + PR_NUMBER: ${{ github.event.pull_request.number }} run: | if [[ $TEST_CONFIG == 'multigpu' ]]; then TEST_COMMAND=.jenkins/pytorch/multigpu-test.sh @@ -336,6 +337,7 @@ jobs: docker run \ ${GPU_FLAG:-} \ -e BUILD_ENVIRONMENT \ + -e PR_NUMBER \ -e CUSTOM_TEST_ARTIFACT_BUILD_DIR \ -e GITHUB_ACTIONS \ -e IN_CI \ diff --git a/.github/workflows/generated-linux-xenial-cuda10.2-py3.6-gcc7.yml b/.github/workflows/generated-linux-xenial-cuda10.2-py3.6-gcc7.yml index c50cac76a2..ddb1522962 100644 --- a/.github/workflows/generated-linux-xenial-cuda10.2-py3.6-gcc7.yml +++ b/.github/workflows/generated-linux-xenial-cuda10.2-py3.6-gcc7.yml @@ -321,6 +321,7 @@ jobs: - name: Test PyTorch env: BUILD_ENVIRONMENT: linux-xenial-cuda10.2-py3.6-gcc7-${{ matrix.config }} + PR_NUMBER: ${{ github.event.pull_request.number }} run: | if [[ $TEST_CONFIG == 'multigpu' ]]; then TEST_COMMAND=.jenkins/pytorch/multigpu-test.sh @@ -336,6 +337,7 @@ jobs: docker run \ ${GPU_FLAG:-} \ -e BUILD_ENVIRONMENT \ + -e PR_NUMBER \ -e CUSTOM_TEST_ARTIFACT_BUILD_DIR \ -e GITHUB_ACTIONS \ -e IN_CI \ diff --git a/.github/workflows/generated-linux-xenial-cuda11.1-py3.6-gcc7.yml b/.github/workflows/generated-linux-xenial-cuda11.1-py3.6-gcc7.yml index cf2395e9ca..fb6d83a0f2 100644 --- a/.github/workflows/generated-linux-xenial-cuda11.1-py3.6-gcc7.yml +++ b/.github/workflows/generated-linux-xenial-cuda11.1-py3.6-gcc7.yml @@ -321,6 +321,7 @@ jobs: - name: Test PyTorch env: BUILD_ENVIRONMENT: linux-xenial-cuda11.1-py3.6-gcc7-${{ matrix.config }} + PR_NUMBER: ${{ github.event.pull_request.number }} run: | if [[ $TEST_CONFIG == 'multigpu' ]]; then TEST_COMMAND=.jenkins/pytorch/multigpu-test.sh @@ -336,6 +337,7 @@ jobs: docker run \ ${GPU_FLAG:-} \ -e BUILD_ENVIRONMENT \ + -e PR_NUMBER \ -e CUSTOM_TEST_ARTIFACT_BUILD_DIR \ -e GITHUB_ACTIONS \ -e IN_CI \ diff --git a/.github/workflows/generated-linux-xenial-py3.6-gcc5.4.yml b/.github/workflows/generated-linux-xenial-py3.6-gcc5.4.yml index dd3cb50cfc..eabc42408f 100644 --- a/.github/workflows/generated-linux-xenial-py3.6-gcc5.4.yml +++ b/.github/workflows/generated-linux-xenial-py3.6-gcc5.4.yml @@ -321,6 +321,7 @@ jobs: - name: Test PyTorch env: BUILD_ENVIRONMENT: linux-xenial-py3.6-gcc5.4-${{ matrix.config }} + PR_NUMBER: ${{ github.event.pull_request.number }} run: | if [[ $TEST_CONFIG == 'multigpu' ]]; then TEST_COMMAND=.jenkins/pytorch/multigpu-test.sh @@ -336,6 +337,7 @@ jobs: docker run \ ${GPU_FLAG:-} \ -e BUILD_ENVIRONMENT \ + -e PR_NUMBER \ -e CUSTOM_TEST_ARTIFACT_BUILD_DIR \ -e GITHUB_ACTIONS \ -e IN_CI \ diff --git a/.github/workflows/generated-periodic-linux-xenial-cuda11.3-py3.6-gcc7.yml b/.github/workflows/generated-periodic-linux-xenial-cuda11.3-py3.6-gcc7.yml index dcbd19d661..47ac9f73d4 100644 --- a/.github/workflows/generated-periodic-linux-xenial-cuda11.3-py3.6-gcc7.yml +++ b/.github/workflows/generated-periodic-linux-xenial-cuda11.3-py3.6-gcc7.yml @@ -319,6 +319,7 @@ jobs: - name: Test PyTorch env: BUILD_ENVIRONMENT: periodic-linux-xenial-cuda11.3-py3.6-gcc7-${{ matrix.config }} + PR_NUMBER: ${{ github.event.pull_request.number }} run: | if [[ $TEST_CONFIG == 'multigpu' ]]; then TEST_COMMAND=.jenkins/pytorch/multigpu-test.sh @@ -334,6 +335,7 @@ jobs: docker run \ ${GPU_FLAG:-} \ -e BUILD_ENVIRONMENT \ + -e PR_NUMBER \ -e CUSTOM_TEST_ARTIFACT_BUILD_DIR \ -e GITHUB_ACTIONS \ -e IN_CI \ diff --git a/.jenkins/pytorch/test.sh b/.jenkins/pytorch/test.sh index 93de6fbf68..124fd7c8cd 100755 --- a/.jenkins/pytorch/test.sh +++ b/.jenkins/pytorch/test.sh @@ -26,11 +26,7 @@ echo "Testing pytorch" export LANG=C.UTF-8 -# Try to pull value from CIRCLE_PULL_REQUEST first then GITHUB_HEAD_REF second -# CIRCLE_PULL_REQUEST comes from CircleCI -# NOTE: file_diff_from_base is currently bugged for GHA due to an issue finding a merge base for ghstack PRs -# see https://github.com/pytorch/pytorch/issues/60111 -IN_PULL_REQUEST=${CIRCLE_PULL_REQUEST:-} +PR_NUMBER=${PR_NUMBER:-${CIRCLE_PR_NUMBER:-}} if [[ "$BUILD_ENVIRONMENT" == *-slow-* || $TEST_CONFIG == 'slow' ]]; then export PYTORCH_TEST_WITH_SLOW=1 @@ -64,7 +60,7 @@ else export PYTORCH_TEST_SKIP_NOARCH=1 fi -if [[ -n "$IN_PULL_REQUEST" ]] && [[ -z "$CI_MASTER" || "$CI_MASTER" == "false" ]]; then +if [[ -n "$PR_NUMBER" ]] && [[ -z "$CI_MASTER" || "$CI_MASTER" == "false" ]]; then # skip expensive checks when on PR and CI_MASTER flag is not set export PYTORCH_TEST_SKIP_CUDA_MEM_LEAK_CHECK=1 else @@ -146,7 +142,10 @@ elif [[ "${BUILD_ENVIRONMENT}" == *-NO_AVX512-* || $TEST_CONFIG == 'nogpu_NO_AVX export ATEN_CPU_CAPABILITY=avx2 fi -if [ -n "$IN_PULL_REQUEST" ] && [[ "$BUILD_ENVIRONMENT" != *coverage* ]]; then +# NOTE: file_diff_from_base is currently bugged for GHA due to an issue finding a merge base for ghstack PRs +# see https://github.com/pytorch/pytorch/issues/60111 +# change it back to PR_NUMBER when issue is fixed. +if [ -n "$CIRCLE_PR_NUMBER" ] && [[ "$BUILD_ENVIRONMENT" != *coverage* ]]; then DETERMINE_FROM=$(mktemp) file_diff_from_base "$DETERMINE_FROM" fi |