Skip to content

Commit b4413c4

Browse files
Update on "Add torch.nested namespace"
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]
2 parents 76f6837 + b0c50dd commit b4413c4

Some content is hidden

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

61 files changed

+1373
-1360
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
01bf13a3029c8f6a8e9989e94e620622d33bfe39
1+
fe3173f7e6c804e6330ac187ea8e4101f45ff9a2

.github/ci_commit_pins/vision.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4c073b09521604e410bac8a0b0fe0f2680724e0d
1+
84dcf695d64c15f8a0be845ac65901bdde845429

.github/workflows/_binary-build-linux.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,10 @@ jobs:
202202
docker exec -t "${container_name}" bash -c "source ${BINARY_ENV_FILE} && bash /builder/${{ inputs.PACKAGE_TYPE }}/build.sh"
203203
- name: Chown artifacts
204204
if: always()
205-
uses: ./pytorch/.github/actions/chown-workspace
205+
shell: bash
206+
run: |
207+
# Ensure the working directory gets chowned back to the current user
208+
docker run --rm -v "${RUNNER_TEMP}/artifacts:/v" -w /v "${ALPINE_IMAGE}" chown -R "$(id -u):$(id -g)" .
206209
207210
- uses: actions/upload-artifact@v3
208211
with:

.github/workflows/_win-build.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,18 @@ on:
2323
description: |
2424
If this is set, our linter will use this to make sure that every other
2525
job with the same `sync-tag` is identical.
26+
test-matrix:
27+
required: false
28+
type: string
29+
description: |
30+
An option JSON description of what test configs to run later on. This
31+
is moved here from the Linux test workflow so that we can apply filter
32+
logic using test-config labels earlier and skip unnecessary builds
33+
34+
outputs:
35+
test-matrix:
36+
value: ${{ inputs.test-matrix }}
37+
description: An optional JSON description of what test configs to run later on.
2638

2739
env:
2840
GIT_DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
@@ -61,7 +73,17 @@ jobs:
6173
with:
6274
github-token: ${{ secrets.GITHUB_TOKEN }}
6375

76+
# Apply the filter logic to the build step too if the test-config label is already there
77+
- name: Select all requested test configurations (if the test matrix is available)
78+
id: filter
79+
uses: ./.github/actions/filter-test-configs
80+
with:
81+
github-token: ${{ secrets.GITHUB_TOKEN }}
82+
test-matrix: ${{ inputs.test-matrix }}
83+
6484
- name: Build
85+
if: steps.filter.outputs.is-test-matrix-empty == 'False' || inputs.test-matrix == ''
86+
id: build
6587
shell: bash
6688
env:
6789
PYTORCH_FINAL_PACKAGE_DIR: /c/${{ github.run_id }}/build-results/
@@ -89,6 +111,7 @@ jobs:
89111
90112
# Upload to github so that people can click and download artifacts
91113
- name: Upload artifacts to s3
114+
if: steps.build.outcome != 'skipped'
92115
uses: seemethere/upload-artifact-s3@v5
93116
with:
94117
retention-days: 14
@@ -97,6 +120,7 @@ jobs:
97120
path: C:\${{ github.run_id }}\build-results
98121

99122
- name: Upload sccache stats
123+
if: steps.build.outcome != 'skipped'
100124
uses: seemethere/upload-artifact-s3@v5
101125
with:
102126
s3-prefix: |

.github/workflows/_win-test.yml

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,33 @@ env:
2727
GIT_DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
2828

2929
jobs:
30+
# This needs to be run right before the test starts so that it can gather the
31+
# latest labels from the PR
32+
filter:
33+
runs-on: [self-hosted, linux.large]
34+
outputs:
35+
test-matrix: ${{ steps.filter.outputs.test-matrix }}
36+
is-test-matrix-empty: ${{ steps.filter.outputs.is-test-matrix-empty }}
37+
steps:
38+
- name: Checkout PyTorch
39+
uses: pytorch/pytorch/.github/actions/checkout-pytorch@master
40+
with:
41+
fetch-depth: 1
42+
submodules: false
43+
44+
- name: Select all requested test configurations
45+
id: filter
46+
uses: ./.github/actions/filter-test-configs
47+
with:
48+
github-token: ${{ secrets.GITHUB_TOKEN }}
49+
test-matrix: ${{ inputs.test-matrix }}
50+
3051
test:
31-
# Don't run on forked repos.
32-
if: github.repository_owner == 'pytorch'
52+
needs: filter
53+
# Don't run on forked repos or empty test matrix
54+
if: github.repository_owner == 'pytorch' && needs.filter.outputs.is-test-matrix-empty == 'False'
3355
strategy:
34-
matrix: ${{ fromJSON(inputs.test-matrix) }}
56+
matrix: ${{ fromJSON(needs.filter.outputs.test-matrix) }}
3557
fail-fast: false
3658
runs-on: ${{ matrix.runner }}
3759
timeout-minutes: 300

.github/workflows/periodic.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,12 @@ jobs:
162162
with:
163163
build-environment: win-vs2019-cuda11.7-py3
164164
cuda-version: "11.7"
165+
test-matrix: |
166+
{ include: [
167+
{ config: "default", shard: 1, num_shards: 2, runner: "windows.8xlarge.nvidia.gpu" },
168+
{ config: "default", shard: 2, num_shards: 2, runner: "windows.8xlarge.nvidia.gpu" },
169+
{ config: "force_on_cpu", shard: 1, num_shards: 1, runner: "windows.4xlarge" },
170+
]}
165171
166172
win-vs2019-cuda11_7-py3-test:
167173
name: win-vs2019-cuda11.7-py3
@@ -170,12 +176,7 @@ jobs:
170176
with:
171177
build-environment: win-vs2019-cuda11.7-py3
172178
cuda-version: "11.7"
173-
test-matrix: |
174-
{ include: [
175-
{ config: "default", shard: 1, num_shards: 2, runner: "windows.8xlarge.nvidia.gpu" },
176-
{ config: "default", shard: 2, num_shards: 2, runner: "windows.8xlarge.nvidia.gpu" },
177-
{ config: "force_on_cpu", shard: 1, num_shards: 1, runner: "windows.4xlarge" },
178-
]}
179+
test-matrix: ${{ needs.win-vs2019-cuda11_7-py3-build.outputs.test-matrix }}
179180

180181
ios-12-5-1-x86-64-coreml:
181182
name: ios-12-5-1-x86-64-coreml

.github/workflows/pull.yml

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,12 @@ jobs:
237237
with:
238238
build-environment: win-vs2019-cpu-py3
239239
cuda-version: cpu
240+
test-matrix: |
241+
{ include: [
242+
{ config: "default", shard: 1, num_shards: 2, runner: "windows.4xlarge" },
243+
{ config: "default", shard: 2, num_shards: 2, runner: "windows.4xlarge" },
244+
{ config: "functorch", shard: 1, num_shards: 1, runner: "windows.4xlarge" },
245+
]}
240246
241247
win-vs2019-cpu-py3-test:
242248
name: win-vs2019-cpu-py3
@@ -245,12 +251,7 @@ jobs:
245251
with:
246252
build-environment: win-vs2019-cpu-py3
247253
cuda-version: cpu
248-
test-matrix: |
249-
{ include: [
250-
{ config: "default", shard: 1, num_shards: 2, runner: "windows.4xlarge" },
251-
{ config: "default", shard: 2, num_shards: 2, runner: "windows.4xlarge" },
252-
{ config: "functorch", shard: 1, num_shards: 1, runner: "windows.4xlarge" },
253-
]}
254+
test-matrix: ${{ needs.win-vs2019-cpu-py3-build.outputs.test-matrix }}
254255

255256
win-vs2019-cuda11_6-py3-build:
256257
if: github.event_name == 'pull_request'
@@ -260,6 +261,16 @@ jobs:
260261
build-environment: win-vs2019-cuda11.6-py3
261262
cuda-version: "11.6"
262263
sync-tag: win-cuda-build
264+
test-matrix: |
265+
{ include: [
266+
{ config: "default", shard: 1, num_shards: 5, runner: "windows.8xlarge.nvidia.gpu" },
267+
{ config: "default", shard: 2, num_shards: 5, runner: "windows.8xlarge.nvidia.gpu" },
268+
{ config: "default", shard: 3, num_shards: 5, runner: "windows.8xlarge.nvidia.gpu" },
269+
{ config: "default", shard: 4, num_shards: 5, runner: "windows.8xlarge.nvidia.gpu" },
270+
{ config: "default", shard: 5, num_shards: 5, runner: "windows.8xlarge.nvidia.gpu" },
271+
{ config: "functorch", shard: 1, num_shards: 1, runner: "windows.8xlarge.nvidia.gpu" },
272+
{ config: "force_on_cpu", shard: 1, num_shards: 1, runner: "windows.4xlarge" },
273+
]}
263274
264275
linux-bionic-cuda11_6-py3_10-gcc7-bazel-test:
265276
name: linux-bionic-cuda11.6-py3.10-gcc7-bazel-test

.github/workflows/trunk.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -220,14 +220,6 @@ jobs:
220220
build-environment: win-vs2019-cuda11.6-py3
221221
cuda-version: "11.6"
222222
sync-tag: win-cuda-build
223-
224-
win-vs2019-cuda11_6-py3-test:
225-
name: win-vs2019-cuda11.6-py3
226-
uses: ./.github/workflows/_win-test.yml
227-
needs: win-vs2019-cuda11_6-py3-build
228-
with:
229-
build-environment: win-vs2019-cuda11.6-py3
230-
cuda-version: "11.6"
231223
test-matrix: |
232224
{ include: [
233225
{ config: "default", shard: 1, num_shards: 5, runner: "windows.8xlarge.nvidia.gpu" },
@@ -239,6 +231,15 @@ jobs:
239231
{ config: "force_on_cpu", shard: 1, num_shards: 1, runner: "windows.4xlarge" },
240232
]}
241233
234+
win-vs2019-cuda11_6-py3-test:
235+
name: win-vs2019-cuda11.6-py3
236+
uses: ./.github/workflows/_win-test.yml
237+
needs: win-vs2019-cuda11_6-py3-build
238+
with:
239+
build-environment: win-vs2019-cuda11.6-py3
240+
cuda-version: "11.6"
241+
test-matrix: ${{ needs.win-vs2019-cuda11_6-py3-build.outputs.test-matrix }}
242+
242243
linux-focal-rocm5_2-py3_7-build:
243244
name: linux-focal-rocm5.2-py3.7
244245
uses: ./.github/workflows/_linux-build.yml

.jenkins/caffe2/bench.sh

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

0 commit comments

Comments
 (0)