8000 Update base for Update on "[Array API] Add linalg.vecdot" · pytorch/pytorch@03f1878 · GitHub
[go: up one dir, main page]

Skip to content

Commit 03f1878

Browse files
committed
Update base for Update on "[Array API] Add linalg.vecdot"
This PR adds the function `linalg.vecdot` specified by the [Array API](https://data-apis.org/array-api/latest/API_specification/linear_algebra_functions.html#function-vecdot) For the complex case, it chooses to implement \sum x_i y_i. See the discussion in data-apis/array-api#356 Edit. When it comes to testing, this function is not quite a binopt, nor a reduction opt. As such, we're this close to be able to get the extra testing, but we don't quite make it. Now, it's such a simple op that I think we'll make it without this. Resolves #18027. cc mruberry rgommers pmeier asmeurer leofang AnirudhDagar asi1024 emcastillo kmaehashi [ghstack-poisoned]
2 parents abb921a + 3c2199b commit 03f1878

File tree

508 files changed

+45232
-13023
lines changed
  • ao_sparse/quantized/cpu
  • cpu
  • cuda
  • cudnn
  • mkldnn
  • mps
  • quantized
  • sparse
  • vulkan
  • templates
  • test
  • benchmarks/static_runtime
  • binaries
  • c10
  • caffe2
  • cmake
  • docs/source
  • scripts/release_notes
  • test
  • Some content is hidden

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

    508 files changed

    +45232
    -13023
    lines changed

    .circleci/docker/build.sh

    Lines changed: 3 additions & 3 deletions
    Original file line numberDiff line numberDiff line change
    @@ -139,7 +139,7 @@ case "$image" in
    139139
    KATEX=yes
    140140
    ;;
    141141
    pytorch-linux-bionic-cuda11.6-cudnn8-py3-gcc7)
    142-
    CUDA_VERSION=11.6.0
    142+
    CUDA_VERSION=11.6.2
    143143
    CUDNN_VERSION=8
    144144
    ANACONDA_PYTHON_VERSION=3.7
    145145
    GCC_VERSION=7
    @@ -234,15 +234,15 @@ case "$image" in
    234234
    DB=yes
    235235
    VISION=yes
    236236
    ;;
    237-
    pytorch-linux-bionic-rocm5.0-py3.7)
    237+
    pytorch-linux-focal-rocm5.0-py3.7)
    238238
    ANACONDA_PYTHON_VERSION=3.7
    239239
    GCC_VERSION=9
    240240
    PROTOBUF=yes
    241241
    DB=yes
    242242
    VISION=yes
    243243
    ROCM_VERSION=5.0
    244244
    ;;
    245-
    pytorch-linux-bionic-rocm5.1-py3.7)
    245+
    pytorch-linux-focal-rocm5.1-py3.7)
    246246
    ANACONDA_PYTHON_VERSION=3.7
    247247
    GCC_VERSION=9
    248248
    PROTOBUF=yes
    10000

    .circleci/docker/build_docker.sh

    Lines changed: 8 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -18,6 +18,7 @@ tag="${DOCKER_TAG}"
    1818

    1919
    registry="308535385114.dkr.ecr.us-east-1.amazonaws.com"
    2020
    image="${registry}/pytorch/${IMAGE_NAME}"
    21+
    ghcr_image="ghcr.io/pytorch/ci-image"
    2122

    2223
    login() {
    2324
    aws ecr get-authorization-token --region us-east-1 --output text --query 'authorizationData[].authorizationToken' |
    @@ -54,6 +55,13 @@ if [ "${DOCKER_SKIP_PUSH:-true}" = "false" ]; then
    5455
    if ! docker manifest inspect "${image}:${tag}" >/dev/null 2>/dev/null; then
    5556
    docker push "${image}:${tag}"
    5657
    fi
    58+
    59+
    if [ "${PUSH_GHCR_IMAGE:-}" = "true" ]; then
    60+
    # Push docker image to the ghcr.io
    61+
    echo $GHCR_PAT | docker login ghcr.io -u pytorch --password-stdin
    62+
    docker tag "${image}:${tag}" "${ghcr_image}:${IMAGE_NAME}-${tag}"
    63+
    docker push "${ghcr_image}:${IMAGE_NAME}-${tag}"
    64+
    fi
    5765
    fi
    5866

    5967
    if [ -z "${DOCKER_SKIP_S3_UPLOAD:-}" ]; then

    .circleci/docker/common/install_base.sh

    Lines changed: 2 additions & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -66,7 +66,8 @@ install_ubuntu() {
    6666
    software-properties-common \
    6767
    wget \
    6868
    sudo \
    69-
    vim
    69+
    vim \
    70+
    jq
    7071

    7172
    # Should resolve issues related to various apt package repository cert issues
    7273
    # see: https://github.com/pytorch/pytorch/issues/65931

    .github/actions/calculate-docker-image/action.yml

    Lines changed: 8 additions & 2 deletions
    Original file line numberDiff line numberDiff line change
    @@ -19,10 +19,14 @@ inputs:
    1919
    required: false
    2020
    skip_push:
    2121
    description: If set to true value, skip will be pushed, default is to skip so that pushing will be explicit
    22-
    required: true
    22+
    required: false
    23+
    default: "true"
    2324
    force_push:
    2425
    description: If set to any value, always run the push
    2526
    required: false
    27+
    push-ghcr-image:
    28+
    description: If set to any value, push docker image to the ghcr.io.
    29+
    required: false
    2630

    2731
    outputs:
    2832
    docker-image:
    @@ -37,7 +41,7 @@ runs:
    3741
    id: calculate-tag
    3842
    env:
    3943
    IS_XLA: ${{ inputs.xla == 'true' && 'true' || '' }}
    40-
    XLA_IMAGE_TAG: v0.2
    44+
    XLA_IMAGE_TAG: v0.4
    4145
    DOCKER_IMAGE_BASE: 308535385114.dkr.ecr.us-east-1.amazonaws.com/pytorch/${{ inputs.docker-image-name }}
    4246
    run: |
    4347
    if [ -n "${IS_XLA}" ]; then
    @@ -102,6 +106,8 @@ runs:
    102106
    # Skip push if we don't need it, or if specified in the inputs
    103107
    DOCKER_SKIP_PUSH: ${{ steps.check.outputs.skip_push || inputs.skip_push }}
    104108
    DOCKER_TAG: ${{ steps.calculate-tag.outputs.docker-tag }}
    109+
    PUSH_GHCR_IMAGE: ${{ inputs.push-ghcr-image }}
    110+
    GHCR_PAT: ${{ env.GHCR_PAT }}
    105111
    working-directory: .circleci/docker
    106112
    shell: bash
    107113
    run: |
    Lines changed: 1 addition & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -1 +1 @@
    1-
    e6daa3fe4cadbb35eca5ba5a2b7958f295292832
    1+
    5f2f374d9bbc6374fe725a17182e7d4c270c6833

    .github/ci_commit_pins/vision.txt

    Lines changed: 1 addition & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -1 +1 @@
    1-
    8a2dc6f22ac4389ccba8859aa1e1cb14f1ee53db
    1+
    8a45147f9df23b12981f1e80554bbae251f594ea

    .github/ci_commit_pins/xla.txt

    Lines changed: 1 addition & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -1 +1 @@
    1-
    8f0f0d3ea0818f2fc8c7a81a17d60fdf95c956d0
    1+
    2bdd718b4b7309b5868825e261ae05bef6be548f

    .github/scripts/trymerge.py

    Lines changed: 1 addition & 7 deletions
    Original file line numberDiff line numberDiff line change
    @@ -308,8 +308,6 @@
    308308
    r'https://github.com/(?P<owner>[^/]+)/(?P<repo>[^/]+)/pull/(?P<number>[0-9]+)',
    309309
    re.MULTILINE
    310310
    )
    311-
    RE_REVERT_CMD = re.compile(r"@pytorch(merge|)bot\s+revert\s+this")
    312-
    RE_REVERT_CMD_CLI = re.compile(r"@pytorch(merge|)bot\s+revert\s+(-m.*-c.*|-c.*-m.*)")
    313311
    RE_DIFF_REV = re.compile(r'^Differential Revision:.+?(D[0-9]+)', re.MULTILINE)
    314312

    315313
    def _fetch_url(url: str, *,
    @@ -921,11 +919,7 @@ def try_revert(repo: GitRepo, pr: GitHubPR, *,
    921919
    reason: Optional[str] = None) -> None:
    922920
    def post_comment(msg: str) -> None:
    923921
    gh_post_pr_comment(pr.org, pr.project, pr.pr_num, msg, dry_run=dry_run)
    924-
    if not pr.is_closed():
    925-
    return post_comment(f"Can't revert open PR #{pr.pr_num}")
    926922
    comment = pr.get_last_comment() if comment_id is None else pr.get_comment_by_id(comment_id)
    927-
    if not RE_REVERT_CMD.match(comment.body_text) and not RE_REVERT_CMD_CLI.match(comment.body_text):
    928-
    raise RuntimeError(f"Comment {comment.body_text} does not seem to be a valid revert command")
    929923
    if comment.editor_login is not None:
    930924
    return post_comment("Don't want to revert based on edited command")
    931925
    author_association = comment.author_association
    @@ -990,7 +984,7 @@ def fetch_check_run_conclusions(repo: GitRepo, commit: str) -> Dict[str, Tuple[s
    990984
    [owner, name] = repo.gh_owner_and_name()
    991985
    checks = fetch_json_dict(f'https://api.github.com/repos/{owner}/{name}/commits/{commit}/check-runs')
    992986
    check_run_conclusions = {}
    993-
    if len(checks) == 0:
    987+
    if len(checks['check_runs']) == 0:
    994988
    raise MandatoryChecksMissingError("Refusing to merge as land check(s) are not yet run")
    995989
    for check_run in checks['check_runs']:
    996990
    check_run_conclusions[check_run['name']] = (check_run['conclusion'],

    .github/templates/common.yml.j2

    Lines changed: 1 addition & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -13,7 +13,7 @@
    1313

    1414
    {%- macro concurrency(build_environment) -%}
    1515
    concurrency:
    16-
    group: !{{ build_environment }}-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }}
    16+
    group: !{{ build_environment }}-${{ github.event.pull_request.number || github.ref_name }}-${{ github.ref_type == 'branch' && github.sha }}-${{ github.event_name == 'workflow_dispatch' }}
    1717
    cancel-in-progress: true
    1818
    {%- endmacro -%}
    1919

    .github/workflows/_android-build-test.yml

    Lines changed: 7 additions & 3 deletions
    Original file line numberDiff line numberDiff line change
    @@ -11,6 +11,13 @@ on:
    1111
    required: true
    1212
    type: string
    1313
    description: Name of the base docker image to build with.
    14+
    sync-tag:
    15+
    required: false
    16+
    type: string
    17+
    default: ""
    18+
    description: |
    19+
    If this is set, our linter will use this to make sure that every other
    20+
    job with the same `sync-tag` is identical.
    1421
    1522
    env:
    1623
    GIT_DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
    @@ -66,9 +73,6 @@ jobs:
    6673
    # 1) Not shareable: it's custom selective build, which is different from default libtorch mobile build;
    6774
    # 2) Not parallelizable by architecture: it only builds libtorch for one architecture;
    6875
    69-
    echo "DOCKER_IMAGE: ${DOCKER_IMAGE}"
    70-
    time docker pull "${DOCKER_IMAGE}" >/dev/null
    71-
    7276
    export BUILD_LITE_INTERPRETER
    7377
    BUILD_LITE_INTERPRETER="1"
    7478
    if [[ "${BUILD_ENVIRONMENT}" == *"full-jit" ]]; then

    .github/workflows/_android-full-build-test.yml

    Lines changed: 7 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -11,6 +11,13 @@ on:
    1111
    required: true
    1212
    type: string
    1313
    description: Name of the base docker image to build with.
    14+
    sync-tag:
    15+
    required: false
    16+
    type: string
    17+
    default: ""
    18+
    description: |
    19+
    If this is set, our linter will use this to make sure that every other
    20+
    job with the same `sync-tag` is identical.
    1421
    1522
    secrets:
    1623
    SONATYPE_NEXUS_USERNAME:

    .github/workflows/_bazel-build-test.yml

    Lines changed: 7 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -11,6 +11,13 @@ on:
    1111
    required: true
    1212
    type: string
    1313
    description: Name of the base docker image to build with.
    14+
    sync-tag:
    15+
    required: false
    16+
    type: string
    17+
    default: ""
    18+
    description: |
    19+
    If this is set, our linter will use this to make sure that every other
    20+
    job with the same `sync-tag` is identical.
    1421
    1522
    env:
    1623
    GIT_DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}

    .github/workflows/_docs.yml

    Lines changed: 7 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -16,6 +16,13 @@ on:
    1616
    type: boolean
    1717
    default: false
    1818
    description: If set, push the docs to the docs website.
    19+
    sync-tag:
    20+
    required: false
    21+
    type: string
    22+
    default: ""
    23+
    description: |
    24+
    If this is set, our linter will use this to make sure that every other
    25+
    job with the same `sync-tag` is identical.
    1926
    2027
    secrets:
    2128
    GH_PYTORCHBOT_TOKEN:

    .github/workflows/_ios-build-test.yml

    Lines changed: 7 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -15,6 +15,13 @@ on:
    1515
    required: true
    1616
    type: string
    1717
    description: Which iOS arch to build for.
    18+
    sync-tag:
    19+
    required: false
    20+
    type: string
    21+
    default: ""
    22+
    description: |
    23+
    If this is set, our linter will use this to make sure that every other
    24+
    job with the same `sync-tag` is identical.
    1825
    1926
    secrets:
    2027
    IOS_CERT_KEY_2022:

    .github/workflows/_linux-build.yml

    Lines changed: 7 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -21,6 +21,13 @@ on:
    2121
    type: boolean
    2222
    default: false
    2323
    description: If set, build in debug mode.
    24+
    sync-tag:
    25+
    required: false
    26+
    type: string
    27+
    default: ""
    28+
    description: |
    29+
    If this is set, our linter will use this to make sure that every other
    30+
    job with the same `sync-tag` is identical.
    2431
    2532
    outputs:
    2633
    docker-image:

    .github/workflows/_linux-test.yml

    Lines changed: 7 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -15,6 +15,13 @@ on:
    1515
    required: true
    1616
    type: string
    1717
    description: Docker image to run in.
    18+
    sync-tag:
    19+
    required: false
    20+
    type: string
    21+
    default: ""
    22+
    description: |
    23+
    If this is set, our linter will use this to make sure that every other
    24+
    job with the same `sync-tag` is identical.
    1825
    1926
    env:
    2027
    GIT_DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}

    .github/workflows/_mac-build.yml

    Lines changed: 7 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -20,6 +20,13 @@ on:
    2020
    type: string
    2121
    default: ""
    2222
    description: What xcode version to build with.
    23+
    sync-tag:
    24+
    required: false
    25+
    type: string
    26+
    default: ""
    27+
    description: |
    28+
    If this is set, our linter will use this to make sure that every other
    29+
    job with the same `sync-tag` is identical.
    2330
    2431
    secrets:
    2532
    MACOS_SCCACHE_S3_ACCESS_KEY_ID:

    .github/workflows/_mac-test-arm64.yml

    Lines changed: 7 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -7,6 +7,13 @@ on:
    77
    required: true
    88
    type: string
    99
    description: Top-level label for what's being built/tested.
    10+
    sync-tag:
    11+
    required: false
    12+
    type: string
    13+
    default: ""
    14+
    description: |
    15+
    If this is set, our linter will use this to make sure that every other
    16+
    job with the same `sync-tag` is identical.
    1017
    1118
    1219
    jobs:

    .github/workflows/_mac-test.yml

    Lines changed: 7 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -11,6 +11,13 @@ on:
    1111
    required: true
    1212
    type: string
    1313
    description: JSON description of what test configs to run.
    14+
    sync-tag:
    15+
    required: false
    16+
    type: string
    17+
    default: ""
    18+
    description: |
    19+
    If this is set, our linter will use this to make sure that every other
    20+
    job with the same `sync-tag` is identical.
    1421
    1522
    secrets:
    1623
    AWS_OSSCI_METRICS_V2_ACCESS_KEY_ID:

    .github/workflows/_rocm-test.yml

    Lines changed: 7 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -19,6 +19,13 @@ on:
    1919
    required: true
    2020
    type: string
    2121
    description: Docker image to run in.
    22+
    sync-tag:
    23+
    required: false
    24+
    type: string
    25+
    default: ""
    26+
    description: |
    27+
    If this is set, our linter will use this to make sure that every other
    28+
    job with the same `sync-tag` is identical.
    2229
    2330
    secrets:
    2431
    AWS_OSSCI_METRICS_V2_ACCESS_KEY_ID:

    .github/workflows/_win-build.yml

    Lines changed: 7 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -16,6 +16,13 @@ on:
    1616
    type: boolean
    1717
    default: false
    1818
    description: If set, build in debug mode.
    19+
    sync-tag:
    20+
    required: false
    21+
    type: string
    22+
    default: ""
    23+
    description: |
    24+
    If this is set, our linter will use this to make sure that every other
    25+
    job with the same `sync-tag` is identical.
    1926
    2027
    env:
    2128
    GIT_DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}

    .github/workflows/_win-test.yml

    Lines changed: 7 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -15,6 +15,13 @@ on:
    1515
    required: true
    1616
    type: string
    1717
    description: JSON description of what test configs to run.
    18+
    sync-tag:
    19+
    required: false
    20+
    type: string
    21+
    default: ""
    22+
    description: |
    23+
    If this is set, our linter will use this to make sure that every other
    24+
    job with the same `sync-tag` is identical.
    1825
    1926
    env:
    2027
    GIT_DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}

    .github/workflows/docker-builds.yml

    Lines changed: 5 additions & 2 deletions
    Original file line numberDiff line numberDiff line change
    @@ -28,8 +28,8 @@ jobs:
    2828
    - docker-image-name: pytorch-linux-bionic-cuda11.3-cudnn8-py3-clang9
    2929
    - docker-image-name: pytorch-linux-bionic-cuda11.6-cudnn8-py3-gcc7
    3030
    - docker-image-name: pytorch-linux-bionic-py3.7-clang9
    31-
    - docker-image-name: pytorch-linux-bionic-rocm5.0-py3.7
    32-
    - docker-image-name: pytorch-linux-bionic-rocm5.1-py3.7
    31+
    - docker-image-name: pytorch-linux-focal-rocm5.0-py3.7
    32+
    - docker-image-name: pytorch-linux-focal-rocm5.1-py3.7
    3333
    - docker-image-name: pytorch-linux-jammy-cuda11.6-cudnn8-py3.8-clang12
    3434
    - docker-image-name: pytorch-linux-xenial-cuda10.2-cudnn7-py3-gcc7
    3535
    - docker-image-name: pytorch-linux-xenial-cuda11.3-cudnn8-py3-gcc7
    @@ -62,11 +62,14 @@ jobs:
    6262
    - name: Build docker image
    6363
    id: build-docker-image
    6464
    uses: ./.github/actions/calculate-docker-image
    65+
    env:
    66+
    GHCR_PAT: ${{ secrets.GHCR_PAT }}
    6567
    with:
    6668
    docker-image-name: ${{ matrix.docker-image-name }}
    6769
    always-rebuild: true
    6870
    skip_push: false
    6971
    force_push: true
    72+
    push-ghcr-image: ${{ github.event_name == 'push' }}
    7073

    7174
    - name: Pull docker image
    7275
    uses: ./.github/actions/pull-docker-image

    .github/workflows/generated-linux-binary-conda-nightly.yml

    Lines changed: 1 addition & 1 deletion
    Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

    .github/workflows/generated-linux-binary-libtorch-cxx11-abi-master.yml

    Lines changed: 1 addition & 1 deletion
    Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

    .github/workflows/generated-linux-binary-libtorch-cxx11-abi-nightly.yml

    Lines changed: 1 addition & 1 deletion
    Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

    .github/workflows/generated-linux-binary-libtorch-pre-cxx11-master.yml

    Lines changed: 1 addition & 1 deletion
    Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

    0 commit comments

    Comments
     (0)
    0