Skip to content

Commit

Permalink
Update on "Add torch.nested namespace"
Browse files Browse the repository at this point in the history
First step towards #83775
- only `to_padded_tensor` is moved to the nested namespace for now
- following the schema used for `special`, `fft`, `linalg` and other namespaces, nested functions are registered in native_functions.yaml as `nested_{function_name}` and are bound to the desired Python name in
`torch/nested/__init__.py`, and the desired C++ name in `torch/csrc/api/include/torch/nested.h`.

~~**Question**: should we keep the documentation for `Tensor.to_padded_tensor` or can this deleted since it is shared by `torch.nested.to_padded_tensor`?~~

[generated nested docs](https://docs-preview.pytorch.org/84102/nested.html?highlight=nested#module-torch.nested)




[ghstack-poisoned]
  • Loading branch information
mikaylagawarecki committed Sep 8, 2022
2 parents 76f6837 + b0c50dd commit b4413c4
Show file tree
Hide file tree
Showing 61 changed files with 1,373 additions and 1,360 deletions.
2 changes: 1 addition & 1 deletion .github/ci_commit_pins/torchdynamo.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
01bf13a3029c8f6a8e9989e94e620622d33bfe39
fe3173f7e6c804e6330ac187ea8e4101f45ff9a2
2 changes: 1 addition & 1 deletion .github/ci_commit_pins/vision.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4c073b09521604e410bac8a0b0fe0f2680724e0d
84dcf695d64c15f8a0be845ac65901bdde845429
5 changes: 4 additions & 1 deletion .github/workflows/_binary-build-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,10 @@ jobs:
docker exec -t "${container_name}" bash -c "source ${BINARY_ENV_FILE} && bash /builder/${{ inputs.PACKAGE_TYPE }}/build.sh"
- name: Chown artifacts
if: always()
uses: ./pytorch/.github/actions/chown-workspace
shell: bash
run: |
# Ensure the working directory gets chowned back to the current user
docker run --rm -v "${RUNNER_TEMP}/artifacts:/v" -w /v "${ALPINE_IMAGE}" chown -R "$(id -u):$(id -g)" .
- uses: actions/upload-artifact@v3
with:
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/_win-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,18 @@ on:
description: |
If this is set, our linter will use this to make sure that every other
job with the same `sync-tag` is identical.
test-matrix:
required: false
type: string
description: |
An option JSON description of what test configs to run later on. This
is moved here from the Linux test workflow so that we can apply filter
logic using test-config labels earlier and skip unnecessary builds
outputs:
test-matrix:
value: ${{ inputs.test-matrix }}
description: An optional JSON description of what test configs to run later on.

env:
GIT_DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
Expand Down Expand Up @@ -61,7 +73,17 @@ jobs:
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

# Apply the filter logic to the build step too if the test-config label is already there
- name: Select all requested test configurations (if the test matrix is available)
id: filter
uses: ./.github/actions/filter-test-configs
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
test-matrix: ${{ inputs.test-matrix }}

- name: Build
if: steps.filter.outputs.is-test-matrix-empty == 'False' || inputs.test-matrix == ''
id: build
shell: bash
env:
PYTORCH_FINAL_PACKAGE_DIR: /c/${{ github.run_id }}/build-results/
Expand Down Expand Up @@ -89,6 +111,7 @@ jobs:
# Upload to github so that people can click and download artifacts
- name: Upload artifacts to s3
if: steps.build.outcome != 'skipped'
uses: seemethere/upload-artifact-s3@v5
with:
retention-days: 14
Expand All @@ -97,6 +120,7 @@ jobs:
path: C:\${{ github.run_id }}\build-results

- name: Upload sccache stats
if: steps.build.outcome != 'skipped'
uses: seemethere/upload-artifact-s3@v5
with:
s3-prefix: |
Expand Down
28 changes: 25 additions & 3 deletions .github/workflows/_win-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,33 @@ env:
GIT_DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}

jobs:
# This needs to be run right before the test starts so that it can gather the
# latest labels from the PR
filter:
runs-on: [self-hosted, linux.large]
outputs:
test-matrix: ${{ steps.filter.outputs.test-matrix }}
is-test-matrix-empty: ${{ steps.filter.outputs.is-test-matrix-empty }}
steps:
- name: Checkout PyTorch
uses: pytorch/pytorch/.github/actions/checkout-pytorch@master
with:
fetch-depth: 1
submodules: false

- name: Select all requested test configurations
id: filter
uses: ./.github/actions/filter-test-configs
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
test-matrix: ${{ inputs.test-matrix }}

test:
# Don't run on forked repos.
if: github.repository_owner == 'pytorch'
needs: filter
# Don't run on forked repos or empty test matrix
if: github.repository_owner == 'pytorch' && needs.filter.outputs.is-test-matrix-empty == 'False'
strategy:
matrix: ${{ fromJSON(inputs.test-matrix) }}
matrix: ${{ fromJSON(needs.filter.outputs.test-matrix) }}
fail-fast: false
runs-on: ${{ matrix.runner }}
timeout-minutes: 300
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/periodic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,12 @@ jobs:
with:
build-environment: win-vs2019-cuda11.7-py3
cuda-version: "11.7"
test-matrix: |
{ include: [
{ config: "default", shard: 1, num_shards: 2, runner: "windows.8xlarge.nvidia.gpu" },
{ config: "default", shard: 2, num_shards: 2, runner: "windows.8xlarge.nvidia.gpu" },
{ config: "force_on_cpu", shard: 1, num_shards: 1, runner: "windows.4xlarge" },
]}
win-vs2019-cuda11_7-py3-test:
name: win-vs2019-cuda11.7-py3
Expand All @@ -170,12 +176,7 @@ jobs:
with:
build-environment: win-vs2019-cuda11.7-py3
cuda-version: "11.7"
test-matrix: |
{ include: [
{ config: "default", shard: 1, num_shards: 2, runner: "windows.8xlarge.nvidia.gpu" },
{ config: "default", shard: 2, num_shards: 2, runner: "windows.8xlarge.nvidia.gpu" },
{ config: "force_on_cpu", shard: 1, num_shards: 1, runner: "windows.4xlarge" },
]}
test-matrix: ${{ needs.win-vs2019-cuda11_7-py3-build.outputs.test-matrix }}

ios-12-5-1-x86-64-coreml:
name: ios-12-5-1-x86-64-coreml
Expand Down
23 changes: 17 additions & 6 deletions .github/workflows/pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,12 @@ jobs:
with:
build-environment: win-vs2019-cpu-py3
cuda-version: cpu
test-matrix: |
{ include: [
{ config: "default", shard: 1, num_shards: 2, runner: "windows.4xlarge" },
{ config: "default", shard: 2, num_shards: 2, runner: "windows.4xlarge" },
{ config: "functorch", shard: 1, num_shards: 1, runner: "windows.4xlarge" },
]}
win-vs2019-cpu-py3-test:
name: win-vs2019-cpu-py3
Expand All @@ -245,12 +251,7 @@ jobs:
with:
build-environment: win-vs2019-cpu-py3
cuda-version: cpu
test-matrix: |
{ include: [
{ config: "default", shard: 1, num_shards: 2, runner: "windows.4xlarge" },
{ config: "default", shard: 2, num_shards: 2, runner: "windows.4xlarge" },
{ config: "functorch", shard: 1, num_shards: 1, runner: "windows.4xlarge" },
]}
test-matrix: ${{ needs.win-vs2019-cpu-py3-build.outputs.test-matrix }}

win-vs2019-cuda11_6-py3-build:
if: github.event_name == 'pull_request'
Expand All @@ -260,6 +261,16 @@ jobs:
build-environment: win-vs2019-cuda11.6-py3
cuda-version: "11.6"
sync-tag: win-cuda-build
test-matrix: |
{ include: [
{ config: "default", shard: 1, num_shards: 5, runner: "windows.8xlarge.nvidia.gpu" },
{ config: "default", shard: 2, num_shards: 5, runner: "windows.8xlarge.nvidia.gpu" },
{ config: "default", shard: 3, num_shards: 5, runner: "windows.8xlarge.nvidia.gpu" },
{ config: "default", shard: 4, num_shards: 5, runner: "windows.8xlarge.nvidia.gpu" },
{ config: "default", shard: 5, num_shards: 5, runner: "windows.8xlarge.nvidia.gpu" },
{ config: "functorch", shard: 1, num_shards: 1, runner: "windows.8xlarge.nvidia.gpu" },
{ config: "force_on_cpu", shard: 1, num_shards: 1, runner: "windows.4xlarge" },
]}
linux-bionic-cuda11_6-py3_10-gcc7-bazel-test:
name: linux-bionic-cuda11.6-py3.10-gcc7-bazel-test
Expand Down
17 changes: 9 additions & 8 deletions .github/workflows/trunk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -220,14 +220,6 @@ jobs:
build-environment: win-vs2019-cuda11.6-py3
cuda-version: "11.6"
sync-tag: win-cuda-build

win-vs2019-cuda11_6-py3-test:
name: win-vs2019-cuda11.6-py3
uses: ./.github/workflows/_win-test.yml
needs: win-vs2019-cuda11_6-py3-build
with:
build-environment: win-vs2019-cuda11.6-py3
cuda-version: "11.6"
test-matrix: |
{ include: [
{ config: "default", shard: 1, num_shards: 5, runner: "windows.8xlarge.nvidia.gpu" },
Expand All @@ -239,6 +231,15 @@ jobs:
{ config: "force_on_cpu", shard: 1, num_shards: 1, runner: "windows.4xlarge" },
]}
win-vs2019-cuda11_6-py3-test:
name: win-vs2019-cuda11.6-py3
uses: ./.github/workflows/_win-test.yml
needs: win-vs2019-cuda11_6-py3-build
with:
build-environment: win-vs2019-cuda11.6-py3
cuda-version: "11.6"
test-matrix: ${{ needs.win-vs2019-cuda11_6-py3-build.outputs.test-matrix }}

linux-focal-rocm5_2-py3_7-build:
name: linux-focal-rocm5.2-py3.7
uses: ./.github/workflows/_linux-build.yml
Expand Down
54 changes: 0 additions & 54 deletions .jenkins/caffe2/bench.sh

This file was deleted.

0 comments on commit b4413c4

Please sign in to comment.