Skip to content

Conversation

jeffkbkim
Copy link
Contributor

Summary:
This diff implements the constant padding functionality (aten.constant_pad_nd.default) for LocalShardsWrapper. The method applies constant padding to the local shards based on the provided padding specification.

Depending on the sharding type (RW, CW), the padding on [left, right, top, bottom] directions will be either applied to the first/last shard, or all local shards.

New unit tests cover:

  • 1D (RW) top/bottom paddings
  • 2D (CW) left, right, top, bottom paddings
  • empty shards, number of dimensions > 2

Differential Revision: D82663766

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Sep 17, 2025
@facebook-github-bot
Copy link
Contributor

@jeffkbkim has exported this pull request. If you are a Meta employee, you can view the originating diff in D82663766.

jeffkbkim added a commit to jeffkbkim/pytorch that referenced this pull request Sep 17, 2025
…rds wrapper (pytorch#163183)

Summary:
X-link: pytorch/torchrec#3382


This diff implements the constant padding functionality (aten.constant_pad_nd.default) for `LocalShardsWrapper`. The method applies constant padding to the local shards based on the provided padding specification.

Depending on the sharding type (RW, CW), the padding on [left, right, top, bottom] directions will be either applied to the first/last shard, or all local shards.

New unit tests cover:
- 1D (RW) top/bottom paddings
- 2D (CW) left, right, top, bottom paddings
- empty shards, number of dimensions > 2

Test Plan:
```
buck2 test fbcode//mode/opt fbcode//torchrec/distributed/tests:test_shards_wrapper
<...>
Buck UI: https://www.internalfb.com/buck2/9fff7732-346a-43eb-b1a0-f0e43e2e8815
Test UI: https://www.internalfb.com/intern/testinfra/testrun/18014398620870153
Network: Up: 110KiB  Down: 95KiB  (reSessionID-c0cdcb56-f82e-4f42-9fb8-54d8a3fb74eb)
Analyzing targets. Remaining     0/191                                                                                                                                                                                                 
Executing actions. Remaining     0/12849                                                                                                                                                                                               7.6s exec time total
Command: test.     Finished 5 local                                                                                                                                                                                                                                                                         
Time elapsed: 1:40.1s
Test execution completed but tests were skipped
Tests finished: Pass 14. Fail 0. Fatal 0. Skip 3. Build failure 0
```

Rollback Plan:

Differential Revision: D82663766
jeffkbkim added a commit to jeffkbkim/torchrec that referenced this pull request Sep 17, 2025
Summary:

X-link: pytorch/pytorch#163183

This diff implements the constant padding functionality (aten.constant_pad_nd.default) for `LocalShardsWrapper`. The method applies constant padding to the local shards based on the provided padding specification.

Depending on the sharding type (RW, CW), the padding on [left, right, top, bottom] directions will be either applied to the first/last shard, or all local shards.

New unit tests cover:
- 1D (RW) top/bottom paddings
- 2D (CW) left, right, top, bottom paddings
- empty shards, number of dimensions > 2

Differential Revision: D82663766
@facebook-github-bot
Copy link
Contributor

@jeffkbkim has exported this pull request. If you are a Meta employee, you can view the originating diff in D82663766.

jeffkbkim added a commit to jeffkbkim/torchrec that referenced this pull request Sep 17, 2025
Summary:

X-link: pytorch/pytorch#163183

This diff implements the constant padding functionality (aten.constant_pad_nd.default) for `LocalShardsWrapper`. The method applies constant padding to the local shards based on the provided padding specification.

Depending on the sharding type (RW, CW), the padding on [left, right, top, bottom] directions will be either applied to the first/last shard, or all local shards.

New unit tests cover:
- 1D (RW) top/bottom paddings
- 2D (CW) left, right, top, bottom paddings
- empty shards, number of dimensions > 2

Differential Revision: D82663766
@facebook-github-bot
Copy link
Contributor

@jeffkbkim has exported this pull request. If you are a Meta employee, you can view the originating diff in D82663766.

jeffkbkim added a commit to jeffkbkim/pytorch that referenced this pull request Sep 17, 2025
…rds wrapper (pytorch#163183)

Summary:
X-link: pytorch/torchrec#3382


This diff implements the constant padding functionality (aten.constant_pad_nd.default) for `LocalShardsWrapper`. The method applies constant padding to the local shards based on the provided padding specification.

Depending on the sharding type (RW, CW), the padding on [left, right, top, bottom] directions will be either applied to the first/last shard, or all local shards.

New unit tests cover:
- 1D (RW) top/bottom paddings
- 2D (CW) left, right, top, bottom paddings
- empty shards, number of dimensions > 2

Test Plan:
```
buck2 test fbcode//mode/opt fbcode//torchrec/distributed/tests:test_shards_wrapper
<...>
Buck UI: https://www.internalfb.com/buck2/9fff7732-346a-43eb-b1a0-f0e43e2e8815
Test UI: https://www.internalfb.com/intern/testinfra/testrun/18014398620870153
Network: Up: 110KiB  Down: 95KiB  (reSessionID-c0cdcb56-f82e-4f42-9fb8-54d8a3fb74eb)
Analyzing targets. Remaining     0/191                                                                                                                                                                                                 
Executing actions. Remaining     0/12849                                                                                                                                                                                               7.6s exec time total
Command: test.     Finished 5 local                                                                                                                                                                                                                                                                         
Time elapsed: 1:40.1s
Test execution completed but tests were skipped
Tests finished: Pass 14. Fail 0. Fatal 0. Skip 3. Build failure 0
```

Rollback Plan:

Differential Revision: D82663766
jeffkbkim added a commit to jeffkbkim/pytorch that referenced this pull request Sep 17, 2025
…rds wrapper (pytorch#163183)

Summary:
X-link: pytorch/torchrec#3382


This diff implements the constant padding functionality (aten.constant_pad_nd.default) for `LocalShardsWrapper`. The method applies constant padding to the local shards based on the provided padding specification.

Depending on the sharding type (RW, CW), the padding on [left, right, top, bottom] directions will be either applied to the first/last shard, or all local shards.

New unit tests cover:
- 1D (RW) top/bottom paddings
- 2D (CW) left, right, top, bottom paddings
- empty shards, number of dimensions > 2

Test Plan:
```
buck2 test fbcode//mode/opt fbcode//torchrec/distributed/tests:test_shards_wrapper
<...>
Buck UI: https://www.internalfb.com/buck2/9fff7732-346a-43eb-b1a0-f0e43e2e8815
Test UI: https://www.internalfb.com/intern/testinfra/testrun/18014398620870153
Network: Up: 110KiB  Down: 95KiB  (reSessionID-c0cdcb56-f82e-4f42-9fb8-54d8a3fb74eb)
Analyzing targets. Remaining     0/191                                                                                                                                                                                                 
Executing actions. Remaining     0/12849                                                                                                                                                                                               7.6s exec time total
Command: test.     Finished 5 local                                                                                                                                                                                                                                                                         
Time elapsed: 1:40.1s
Test execution completed but tests were skipped
Tests finished: Pass 14. Fail 0. Fatal 0. Skip 3. Build failure 0
```

Rollback Plan:

Differential Revision: D82663766
jeffkbkim added a commit to jeffkbkim/torchrec that referenced this pull request Sep 17, 2025
Summary:

X-link: pytorch/pytorch#163183

This diff implements the constant padding functionality (aten.constant_pad_nd.default) for `LocalShardsWrapper`. The method applies constant padding to the local shards based on the provided padding specification.

Depending on the sharding type (RW, CW), the padding on [left, right, top, bottom] directions will be either applied to the first/last shard, or all local shards.

New unit tests cover:
- 1D (RW) top/bottom paddings
- 2D (CW) left, right, top, bottom paddings
- empty shards, number of dimensions > 2

Differential Revision: D82663766
@facebook-github-bot
Copy link
Contributor

@jeffkbkim has exported this pull request. If you are a Meta employee, you can view the originating diff in D82663766.

jeffkbkim added a commit to jeffkbkim/pytorch that referenced this pull request Sep 17, 2025
…rds wrapper (pytorch#163183)

Summary:
X-link: pytorch/torchrec#3382


This diff implements the constant padding functionality (aten.constant_pad_nd.default) for `LocalShardsWrapper`. The method applies constant padding to the local shards based on the provided padding specification.

Depending on the sharding type (RW, CW), the padding on [left, right, top, bottom] directions will be either applied to the first/last shard, or all local shards.

New unit tests cover:
- 1D (RW) top/bottom paddings
- 2D (CW) left, right, top, bottom paddings
- empty shards, number of dimensions > 2

Test Plan:
```
buck2 test fbcode//mode/opt fbcode//torchrec/distributed/tests:test_shards_wrapper
<...>
Buck UI: https://www.internalfb.com/buck2/9fff7732-346a-43eb-b1a0-f0e43e2e8815
Test UI: https://www.internalfb.com/intern/testinfra/testrun/18014398620870153
Network: Up: 110KiB  Down: 95KiB  (reSessionID-c0cdcb56-f82e-4f42-9fb8-54d8a3fb74eb)
Analyzing targets. Remaining     0/191                                                                                                                                                                                                 
Executing actions. Remaining     0/12849                                                                                                                                                                                               7.6s exec time total
Command: test.     Finished 5 local                                                                                                                                                                                                                                                                         
Time elapsed: 1:40.1s
Test execution completed but tests were skipped
Tests finished: Pass 14. Fail 0. Fatal 0. Skip 3. Build failure 0
```

Rollback Plan:

Differential Revision: D82663766
jeffkbkim added a commit to jeffkbkim/torchrec that referenced this pull request Sep 17, 2025
Summary:

X-link: pytorch/pytorch#163183

This diff implements the constant padding functionality (aten.constant_pad_nd.default) for `LocalShardsWrapper`. The method applies constant padding to the local shards based on the provided padding specification.

Depending on the sharding type (RW, CW), the padding on [left, right, top, bottom] directions will be either applied to the first/last shard, or all local shards.

New unit tests cover:
- 1D (RW) top/bottom paddings
- 2D (CW) left, right, top, bottom paddings
- empty shards, number of dimensions > 2

Differential Revision: D82663766
@facebook-github-bot
Copy link
Contributor

@jeffkbkim has exported this pull request. If you are a Meta employee, you can view the originating diff in D82663766.

jeffkbkim added a commit to jeffkbkim/torchrec that referenced this pull request Sep 17, 2025
Summary:

X-link: pytorch/pytorch#163183

This diff implements the constant padding functionality (aten.constant_pad_nd.default) for `LocalShardsWrapper`. The method applies constant padding to the local shards based on the provided padding specification.

Depending on the sharding type (RW, CW), the padding on [left, right, top, bottom] directions will be either applied to the first/last shard, or all local shards.

New unit tests cover:
- 1D (RW) top/bottom paddings
- 2D (CW) left, right, top, bottom paddings
- empty shards, number of dimensions > 2

Differential Revision: D82663766
jeffkbkim added a commit to jeffkbkim/pytorch that referenced this pull request Sep 17, 2025
…rds wrapper (pytorch#163183)

Summary:
X-link: pytorch/torchrec#3382


This diff implements the constant padding functionality (aten.constant_pad_nd.default) for `LocalShardsWrapper`. The method applies constant padding to the local shards based on the provided padding specification.

Depending on the sharding type (RW, CW), the padding on [left, right, top, bottom] directions will be either applied to the first/last shard, or all local shards.

New unit tests cover:
- 1D (RW) top/bottom paddings
- 2D (CW) left, right, top, bottom paddings
- empty shards, number of dimensions > 2

Test Plan:
```
buck2 test fbcode//mode/opt fbcode//torchrec/distributed/tests:test_shards_wrapper
<...>
Buck UI: https://www.internalfb.com/buck2/9fff7732-346a-43eb-b1a0-f0e43e2e8815
Test UI: https://www.internalfb.com/intern/testinfra/testrun/18014398620870153
Network: Up: 110KiB  Down: 95KiB  (reSessionID-c0cdcb56-f82e-4f42-9fb8-54d8a3fb74eb)
Analyzing targets. Remaining     0/191                                                                                                                                                                                                 
Executing actions. Remaining     0/12849                                                                                                                                                                                               7.6s exec time total
Command: test.     Finished 5 local                                                                                                                                                                                                                                                                         
Time elapsed: 1:40.1s
Test execution completed but tests were skipped
Tests finished: Pass 14. Fail 0. Fatal 0. Skip 3. Build failure 0
```

Rollback Plan:

Differential Revision: D82663766
@facebook-github-bot
Copy link
Contributor

@jeffkbkim has exported this pull request. If you are a Meta employee, you can view the originating diff in D82663766.

jeffkbkim added a commit to jeffkbkim/pytorch that referenced this pull request Sep 17, 2025
…rds wrapper (pytorch#163183)

Summary:
X-link: pytorch/torchrec#3382


This diff implements the constant padding functionality (aten.constant_pad_nd.default) for `LocalShardsWrapper`. The method applies constant padding to the local shards based on the provided padding specification.

Depending on the sharding type (RW, CW), the padding on [left, right, top, bottom] directions will be either applied to the first/last shard, or all local shards.

New unit tests cover:
- 1D (RW) top/bottom paddings
- 2D (CW) left, right, top, bottom paddings
- empty shards, number of dimensions > 2

Test Plan:
```
buck2 test fbcode//mode/opt fbcode//torchrec/distributed/tests:test_shards_wrapper
<...>
Buck UI: https://www.internalfb.com/buck2/9fff7732-346a-43eb-b1a0-f0e43e2e8815
Test UI: https://www.internalfb.com/intern/testinfra/testrun/18014398620870153
Network: Up: 110KiB  Down: 95KiB  (reSessionID-c0cdcb56-f82e-4f42-9fb8-54d8a3fb74eb)
Analyzing targets. Remaining     0/191                                                                                                                                                                                                 
Executing actions. Remaining     0/12849                                                                                                                                                                                               7.6s exec time total
Command: test.     Finished 5 local                                                                                                                                                                                                                                                                         
Time elapsed: 1:40.1s
Test execution completed but tests were skipped
Tests finished: Pass 14. Fail 0. Fatal 0. Skip 3. Build failure 0
```

Rollback Plan:

Differential Revision: D82663766
jeffkbkim added a commit to jeffkbkim/pytorch that referenced this pull request Sep 17, 2025
…rds wrapper (pytorch#163183)

Summary:
X-link: pytorch/torchrec#3382


This diff implements the constant padding functionality (aten.constant_pad_nd.default) for `LocalShardsWrapper`. The method applies constant padding to the local shards based on the provided padding specification.

Depending on the sharding type (RW, CW), the padding on [left, right, top, bottom] directions will be either applied to the first/last shard, or all local shards.

New unit tests cover:
- 1D (RW) top/bottom paddings
- 2D (CW) left, right, top, bottom paddings
- empty shards, number of dimensions > 2

Test Plan:
```
buck2 test fbcode//mode/opt fbcode//torchrec/distributed/tests:test_shards_wrapper
<...>
Buck UI: https://www.internalfb.com/buck2/9fff7732-346a-43eb-b1a0-f0e43e2e8815
Test UI: https://www.internalfb.com/intern/testinfra/testrun/18014398620870153
Network: Up: 110KiB  Down: 95KiB  (reSessionID-c0cdcb56-f82e-4f42-9fb8-54d8a3fb74eb)
Analyzing targets. Remaining     0/191                                                                                                                                                                                                 
Executing actions. Remaining     0/12849                                                                                                                                                                                               7.6s exec time total
Command: test.     Finished 5 local                                                                                                                                                                                                                                                                         
Time elapsed: 1:40.1s
Test execution completed but tests were skipped
Tests finished: Pass 14. Fail 0. Fatal 0. Skip 3. Build failure 0
```

Rollback Plan:

Differential Revision: D82663766
jeffkbkim added a commit to jeffkbkim/torchrec that referenced this pull request Sep 17, 2025
Summary:

X-link: pytorch/pytorch#163183

This diff implements the constant padding functionality (aten.constant_pad_nd.default) for `LocalShardsWrapper`. The method applies constant padding to the local shards based on the provided padding specification.

Depending on the sharding type (RW, CW), the padding on [left, right, top, bottom] directions will be either applied to the first/last shard, or all local shards.

New unit tests cover:
- 1D (RW) top/bottom paddings
- 2D (CW) left, right, top, bottom paddings
- empty shards, number of dimensions > 2

Differential Revision: D82663766
@facebook-github-bot
Copy link
Contributor

@jeffkbkim has exported this pull request. If you are a Meta employee, you can view the originating diff in D82663766.

pytorch-bot bot pushed a commit to pytorch/pytorch that referenced this pull request Sep 18, 2025
…rds wrapper (#163183)

Summary:
X-link: pytorch/torchrec#3382


This diff implements the constant padding functionality (aten.constant_pad_nd.default) for `LocalShardsWrapper`. The method applies constant padding to the local shards based on the provided padding specification.

Depending on the sharding type (RW, CW), the padding on [left, right, top, bottom] directions will be either applied to the first/last shard, or all local shards.

New unit tests cover:
- 1D (RW) top/bottom paddings
- 2D (CW) left, right, top, bottom paddings
- empty shards, number of dimensions > 2

Test Plan:
```
buck2 test fbcode//mode/opt fbcode//torchrec/distributed/tests:test_shards_wrapper
<...>
Buck UI: https://www.internalfb.com/buck2/9fff7732-346a-43eb-b1a0-f0e43e2e8815
Test UI: https://www.internalfb.com/intern/testinfra/testrun/18014398620870153
Network: Up: 110KiB  Down: 95KiB  (reSessionID-c0cdcb56-f82e-4f42-9fb8-54d8a3fb74eb)
Analyzing targets. Remaining     0/191                                                                                                                                                                                                 
Executing actions. Remaining     0/12849                                                                                                                                                                                               7.6s exec time total
Command: test.     Finished 5 local                                                                                                                                                                                                                                                                         
Time elapsed: 1:40.1s
Test execution completed but tests were skipped
Tests finished: Pass 14. Fail 0. Fatal 0. Skip 3. Build failure 0
```

Rollback Plan:

Differential Revision: D82663766
@facebook-github-bot
Copy link
Contributor

@jeffkbkim has exported this pull request. If you are a Meta employee, you can view the originating diff in D82663766.

jeffkbkim added a commit to jeffkbkim/pytorch that referenced this pull request Sep 18, 2025
…rds wrapper (pytorch#163183)

Summary:
X-link: pytorch/torchrec#3382


This diff implements the constant padding functionality (aten.constant_pad_nd.default) for `LocalShardsWrapper`. The method applies constant padding to the local shards based on the provided padding specification.

Depending on the sharding type (RW, CW), the padding on [left, right, top, bottom] directions will be either applied to the first/last shard, or all local shards.

New unit tests cover:
- 1D (RW) top/bottom paddings
- 2D (CW) left, right, top, bottom paddings
- empty shards, number of dimensions > 2

Test Plan:
```
buck2 test fbcode//caffe2/test/distributed/tensor:shards_wrapper
2025-09-18T15:32:46.525914Z  WARN buck2_interpreter_for_build::interpreter::functions::warning: ptxas 12.8 is not available on platform platform010-aarch64-compat
2025-09-18T15:32:46.525953Z  WARN buck2_interpreter_for_build::interpreter::functions::warning: ptxas 12.8 is not available on platform platform010-compat
2025-09-18T15:32:46.525959Z  WARN buck2_interpreter_for_build::interpreter::functions::warning: ptxas 12.8 is not available on platform platform010-libcxx
Buck UI: https://www.internalfb.com/buck2/ffb34bcb-1555-4fa3-89c6-9c22d078606a
Test UI: https://www.internalfb.com/intern/testinfra/testrun/12384899087608299
Network: Up: 159MiB  Down: 13GiB  (reSessionID-f734bd3c-19ca-44c9-919f-57203ac00be8)
Loading targets.   Remaining      0/5110                                                                                                                                                                        104336 dirs read, 1265395 targets declared
Analyzing targets. Remaining      0/80346                                                                                                                                                                       3349033 actions, 4142832 artifacts declared
Executing actions. Remaining      0/521855                                                                                                                                                                      149:06:17.8s exec time total
Command: test.     Finished 14 local, 397 remote, 199840 cache (99% hit)                                                                                                                                        148:27:40.9s exec time cached (99%)                                  
Time elapsed: 8:55.5s
Tests finished: Pass 14. Fail 0. Fatal 0. Skip 0. Build failure 0
```

Differential Revision: D82663766
jeffkbkim added a commit to jeffkbkim/torchrec that referenced this pull request Sep 18, 2025
Summary:

X-link: pytorch/pytorch#163183

This diff implements the constant padding functionality (aten.constant_pad_nd.default) for `LocalShardsWrapper`. The method applies constant padding to the local shards based on the provided padding specification.

Depending on the sharding type (RW, CW), the padding on [left, right, top, bottom] directions will be either applied to the first/last shard, or all local shards.

New unit tests cover:
- 1D (RW) top/bottom paddings
- 2D (CW) left, right, top, bottom paddings
- empty shards, number of dimensions > 2

Differential Revision: D82663766
@facebook-github-bot
Copy link
Contributor

@jeffkbkim has exported this pull request. If you are a Meta employee, you can view the originating diff in D82663766.

pytorch-bot bot pushed a commit to pytorch/pytorch that referenced this pull request Sep 19, 2025
…rds wrapper (#163183)

Summary:
X-link: pytorch/torchrec#3382


This diff implements the constant padding functionality (aten.constant_pad_nd.default) for `LocalShardsWrapper`. The method applies constant padding to the local shards based on the provided padding specification.

Depending on the sharding type (RW, CW), the padding on [left, right, top, bottom] directions will be either applied to the first/last shard, or all local shards.

New unit tests cover:
- 1D (RW) top/bottom paddings
- 2D (CW) left, right, top, bottom paddings
- empty shards, number of dimensions > 2

Test Plan:
```
buck2 test fbcode//caffe2/test/distributed/tensor:shards_wrapper
2025-09-18T15:32:46.525914Z  WARN buck2_interpreter_for_build::interpreter::functions::warning: ptxas 12.8 is not available on platform platform010-aarch64-compat
2025-09-18T15:32:46.525953Z  WARN buck2_interpreter_for_build::interpreter::functions::warning: ptxas 12.8 is not available on platform platform010-compat
2025-09-18T15:32:46.525959Z  WARN buck2_interpreter_for_build::interpreter::functions::warning: ptxas 12.8 is not available on platform platform010-libcxx
Buck UI: https://www.internalfb.com/buck2/ffb34bcb-1555-4fa3-89c6-9c22d078606a
Test UI: https://www.internalfb.com/intern/testinfra/testrun/12384899087608299
Network: Up: 159MiB  Down: 13GiB  (reSessionID-f734bd3c-19ca-44c9-919f-57203ac00be8)
Loading targets.   Remaining      0/5110                                                                                                                                                                        104336 dirs read, 1265395 targets declared
Analyzing targets. Remaining      0/80346                                                                                                                                                                       3349033 actions, 4142832 artifacts declared
Executing actions. Remaining      0/521855                                                                                                                                                                      149:06:17.8s exec time total
Command: test.     Finished 14 local, 397 remote, 199840 cache (99% hit)                                                                                                                                        148:27:40.9s exec time cached (99%)                                  
Time elapsed: 8:55.5s
Tests finished: Pass 14. Fail 0. Fatal 0. Skip 0. Build failure 0
```

Differential Revision: D82663766
jeffkbkim added a commit to jeffkbkim/pytorch that referenced this pull request Sep 19, 2025
…rds wrapper (pytorch#163183)

Summary:
X-link: pytorch/torchrec#3382


This diff implements the constant padding functionality (aten.constant_pad_nd.default) for `LocalShardsWrapper`. The method applies constant padding to the local shards based on the provided padding specification.

Depending on the sharding type (RW, CW), the padding on [left, right, top, bottom] directions will be either applied to the first/last shard, or all local shards.

New unit tests cover:
- 1D (RW) top/bottom paddings
- 2D (CW) left, right, top, bottom paddings
- empty shards, number of dimensions > 2

Test Plan:
```
buck2 test fbcode//caffe2/test/distributed/tensor:shards_wrapper
2025-09-18T15:32:46.525914Z  WARN buck2_interpreter_for_build::interpreter::functions::warning: ptxas 12.8 is not available on platform platform010-aarch64-compat
2025-09-18T15:32:46.525953Z  WARN buck2_interpreter_for_build::interpreter::functions::warning: ptxas 12.8 is not available on platform platform010-compat
2025-09-18T15:32:46.525959Z  WARN buck2_interpreter_for_build::interpreter::functions::warning: ptxas 12.8 is not available on platform platform010-libcxx
Buck UI: https://www.internalfb.com/buck2/ffb34bcb-1555-4fa3-89c6-9c22d078606a
Test UI: https://www.internalfb.com/intern/testinfra/testrun/12384899087608299
Network: Up: 159MiB  Down: 13GiB  (reSessionID-f734bd3c-19ca-44c9-919f-57203ac00be8)
Loading targets.   Remaining      0/5110                                                                                                                                                                        104336 dirs read, 1265395 targets declared
Analyzing targets. Remaining      0/80346                                                                                                                                                                       3349033 actions, 4142832 artifacts declared
Executing actions. Remaining      0/521855                                                                                                                                                                      149:06:17.8s exec time total
Command: test.     Finished 14 local, 397 remote, 199840 cache (99% hit)                                                                                                                                        148:27:40.9s exec time cached (99%)                                  
Time elapsed: 8:55.5s
Tests finished: Pass 14. Fail 0. Fatal 0. Skip 0. Build failure 0
```

Differential Revision: D82663766
jeffkbkim added a commit to jeffkbkim/torchrec that referenced this pull request Sep 19, 2025
Summary:

X-link: pytorch/pytorch#163183

This diff implements the constant padding functionality (aten.constant_pad_nd.default) for `LocalShardsWrapper`. The method applies constant padding to the local shards based on the provided padding specification.

Depending on the sharding type (RW, CW), the padding on [left, right, top, bottom] directions will be either applied to the first/last shard, or all local shards.

New unit tests cover:
- 1D (RW) top/bottom paddings
- 2D (CW) left, right, top, bottom paddings
- empty shards, number of dimensions > 2

Differential Revision: D82663766
@facebook-github-bot
Copy link
Contributor

@jeffkbkim has exported this pull request. If you are a Meta employee, you can view the originating diff in D82663766.

jeffkbkim added a commit to jeffkbkim/pytorch that referenced this pull request Sep 19, 2025
…rds wrapper (pytorch#163183)

Summary:
X-link: pytorch/torchrec#3382


This diff implements the constant padding functionality (aten.constant_pad_nd.default) for `LocalShardsWrapper`. The method applies constant padding to the local shards based on the provided padding specification.

Depending on the sharding type (RW, CW), the padding on [left, right, top, bottom] directions will be either applied to the first/last shard, or all local shards.

New unit tests cover:
- 1D (RW) top/bottom paddings
- 2D (CW) left, right, top, bottom paddings
- empty shards, number of dimensions > 2

Test Plan:
```
buck2 test fbcode//caffe2/test/distributed/tensor:shards_wrapper
2025-09-18T15:32:46.525914Z  WARN buck2_interpreter_for_build::interpreter::functions::warning: ptxas 12.8 is not available on platform platform010-aarch64-compat
2025-09-18T15:32:46.525953Z  WARN buck2_interpreter_for_build::interpreter::functions::warning: ptxas 12.8 is not available on platform platform010-compat
2025-09-18T15:32:46.525959Z  WARN buck2_interpreter_for_build::interpreter::functions::warning: ptxas 12.8 is not available on platform platform010-libcxx
Buck UI: https://www.internalfb.com/buck2/ffb34bcb-1555-4fa3-89c6-9c22d078606a
Test UI: https://www.internalfb.com/intern/testinfra/testrun/12384899087608299
Network: Up: 159MiB  Down: 13GiB  (reSessionID-f734bd3c-19ca-44c9-919f-57203ac00be8)
Loading targets.   Remaining      0/5110                                                                                                                                                                        104336 dirs read, 1265395 targets declared
Analyzing targets. Remaining      0/80346                                                                                                                                                                       3349033 actions, 4142832 artifacts declared
Executing actions. Remaining      0/521855                                                                                                                                                                      149:06:17.8s exec time total
Command: test.     Finished 14 local, 397 remote, 199840 cache (99% hit)                                                                                                                                        148:27:40.9s exec time cached (99%)                                  
Time elapsed: 8:55.5s
Tests finished: Pass 14. Fail 0. Fatal 0. Skip 0. Build failure 0
```

Differential Revision: D82663766
jeffkbkim added a commit to jeffkbkim/pytorch that referenced this pull request Sep 19, 2025
…rds wrapper (pytorch#163183)

Summary:
X-link: pytorch/torchrec#3382


This diff implements the constant padding functionality (aten.constant_pad_nd.default) for `LocalShardsWrapper`. The method applies constant padding to the local shards based on the provided padding specification.

Depending on the sharding type (RW, CW), the padding on [left, right, top, bottom] directions will be either applied to the first/last shard, or all local shards.

New unit tests cover:
- 1D (RW) top/bottom paddings
- 2D (CW) left, right, top, bottom paddings
- empty shards, number of dimensions > 2

Test Plan:
```
buck2 test fbcode//caffe2/test/distributed/tensor:shards_wrapper
2025-09-18T15:32:46.525914Z  WARN buck2_interpreter_for_build::interpreter::functions::warning: ptxas 12.8 is not available on platform platform010-aarch64-compat
2025-09-18T15:32:46.525953Z  WARN buck2_interpreter_for_build::interpreter::functions::warning: ptxas 12.8 is not available on platform platform010-compat
2025-09-18T15:32:46.525959Z  WARN buck2_interpreter_for_build::interpreter::functions::warning: ptxas 12.8 is not available on platform platform010-libcxx
Buck UI: https://www.internalfb.com/buck2/ffb34bcb-1555-4fa3-89c6-9c22d078606a
Test UI: https://www.internalfb.com/intern/testinfra/testrun/12384899087608299
Network: Up: 159MiB  Down: 13GiB  (reSessionID-f734bd3c-19ca-44c9-919f-57203ac00be8)
Loading targets.   Remaining      0/5110                                                                                                                                                                        104336 dirs read, 1265395 targets declared
Analyzing targets. Remaining      0/80346                                                                                                                                                                       3349033 actions, 4142832 artifacts declared
Executing actions. Remaining      0/521855                                                                                                                                                                      149:06:17.8s exec time total
Command: test.     Finished 14 local, 397 remote, 199840 cache (99% hit)                                                                                                                                        148:27:40.9s exec time cached (99%)                                  
Time elapsed: 8:55.5s
Tests finished: Pass 14. Fail 0. Fatal 0. Skip 0. Build failure 0
```

Differential Revision: D82663766
jeffkbkim added a commit to jeffkbkim/torchrec that referenced this pull request Sep 19, 2025
Summary:

X-link: pytorch/pytorch#163183

This diff implements the constant padding functionality (aten.constant_pad_nd.default) for `LocalShardsWrapper`. The method applies constant padding to the local shards based on the provided padding specification.

Depending on the sharding type (RW, CW), the padding on [left, right, top, bottom] directions will be either applied to the first/last shard, or all local shards.

New unit tests cover:
- 1D (RW) top/bottom paddings
- 2D (CW) left, right, top, bottom paddings
- empty shards, number of dimensions > 2

Differential Revision: D82663766
@jeffkbkim jeffkbkim force-pushed the export-D82663766 branch 2 times, most recently from 9f54f54 to 1bacdf7 Compare September 19, 2025 17:10
jeffkbkim added a commit to jeffkbkim/torchrec that referenced this pull request Sep 19, 2025
Summary:

X-link: pytorch/pytorch#163183

This diff implements the constant padding functionality (aten.constant_pad_nd.default) for `LocalShardsWrapper`. The method applies constant padding to the local shards based on the provided padding specification.

Depending on the sharding type (RW, CW), the padding on [left, right, top, bottom] directions will be either applied to the first/last shard, or all local shards.

New unit tests cover:
- 1D (RW) top/bottom paddings
- 2D (CW) left, right, top, bottom paddings
- empty shards, number of dimensions > 2

Differential Revision: D82663766
@facebook-github-bot
Copy link
Contributor

@jeffkbkim has exported this pull request. If you are a Meta employee, you can view the originating diff in D82663766.

1 similar comment
@facebook-github-bot
Copy link
Contributor

@jeffkbkim has exported this pull request. If you are a Meta employee, you can view the originating diff in D82663766.

jeffkbkim added a commit to jeffkbkim/pytorch that referenced this pull request Sep 19, 2025
…rds wrapper (pytorch#163183)

Summary:
X-link: pytorch/torchrec#3382


This diff implements the constant padding functionality (aten.constant_pad_nd.default) for `LocalShardsWrapper`. The method applies constant padding to the local shards based on the provided padding specification.

Depending on the sharding type (RW, CW), the padding on [left, right, top, bottom] directions will be either applied to the first/last shard, or all local shards.

New unit tests cover:
- 1D (RW) top/bottom paddings
- 2D (CW) left, right, top, bottom paddings
- empty shards, number of dimensions > 2

Test Plan:
```
buck2 test fbcode//caffe2/test/distributed/tensor:shards_wrapper
2025-09-18T15:32:46.525914Z  WARN buck2_interpreter_for_build::interpreter::functions::warning: ptxas 12.8 is not available on platform platform010-aarch64-compat
2025-09-18T15:32:46.525953Z  WARN buck2_interpreter_for_build::interpreter::functions::warning: ptxas 12.8 is not available on platform platform010-compat
2025-09-18T15:32:46.525959Z  WARN buck2_interpreter_for_build::interpreter::functions::warning: ptxas 12.8 is not available on platform platform010-libcxx
Buck UI: https://www.internalfb.com/buck2/ffb34bcb-1555-4fa3-89c6-9c22d078606a
Test UI: https://www.internalfb.com/intern/testinfra/testrun/12384899087608299
Network: Up: 159MiB  Down: 13GiB  (reSessionID-f734bd3c-19ca-44c9-919f-57203ac00be8)
Loading targets.   Remaining      0/5110                                                                                                                                                                        104336 dirs read, 1265395 targets declared
Analyzing targets. Remaining      0/80346                                                                                                                                                                       3349033 actions, 4142832 artifacts declared
Executing actions. Remaining      0/521855                                                                                                                                                                      149:06:17.8s exec time total
Command: test.     Finished 14 local, 397 remote, 199840 cache (99% hit)                                                                                                                                        148:27:40.9s exec time cached (99%)                                  
Time elapsed: 8:55.5s
Tests finished: Pass 14. Fail 0. Fatal 0. Skip 0. Build failure 0
```

Differential Revision: D82663766
jeffkbkim added a commit to jeffkbkim/torchrec that referenced this pull request Sep 19, 2025
Summary:

X-link: pytorch/pytorch#163183

This diff implements the constant padding functionality (aten.constant_pad_nd.default) for `LocalShardsWrapper`. The method applies constant padding to the local shards based on the provided padding specification.

Depending on the sharding type (RW, CW), the padding on [left, right, top, bottom] directions will be either applied to the first/last shard, or all local shards.

New unit tests cover:
- 1D (RW) top/bottom paddings
- 2D (CW) left, right, top, bottom paddings
- empty shards, number of dimensions > 2

Differential Revision: D82663766
@facebook-github-bot
Copy link
Contributor

@jeffkbkim has exported this pull request. If you are a Meta employee, you can view the originating diff in D82663766.

jeffkbkim added a commit to jeffkbkim/pytorch that referenced this pull request Sep 19, 2025
…rds wrapper (pytorch#163183)

Summary:
X-link: pytorch/torchrec#3382


This diff implements the constant padding functionality (aten.constant_pad_nd.default) for `LocalShardsWrapper`. The method applies constant padding to the local shards based on the provided padding specification.

Depending on the sharding type (RW, CW), the padding on [left, right, top, bottom] directions will be either applied to the first/last shard, or all local shards.

New unit tests cover:
- 1D (RW) top/bottom paddings
- 2D (CW) left, right, top, bottom paddings
- empty shards, number of dimensions > 2

Test Plan:
```
buck2 test fbcode//caffe2/test/distributed/tensor:shards_wrapper
2025-09-18T15:32:46.525914Z  WARN buck2_interpreter_for_build::interpreter::functions::warning: ptxas 12.8 is not available on platform platform010-aarch64-compat
2025-09-18T15:32:46.525953Z  WARN buck2_interpreter_for_build::interpreter::functions::warning: ptxas 12.8 is not available on platform platform010-compat
2025-09-18T15:32:46.525959Z  WARN buck2_interpreter_for_build::interpreter::functions::warning: ptxas 12.8 is not available on platform platform010-libcxx
Buck UI: https://www.internalfb.com/buck2/ffb34bcb-1555-4fa3-89c6-9c22d078606a
Test UI: https://www.internalfb.com/intern/testinfra/testrun/12384899087608299
Network: Up: 159MiB  Down: 13GiB  (reSessionID-f734bd3c-19ca-44c9-919f-57203ac00be8)
Loading targets.   Remaining      0/5110                                                                                                                                                                        104336 dirs read, 1265395 targets declared
Analyzing targets. Remaining      0/80346                                                                                                                                                                       3349033 actions, 4142832 artifacts declared
Executing actions. Remaining      0/521855                                                                                                                                                                      149:06:17.8s exec time total
Command: test.     Finished 14 local, 397 remote, 199840 cache (99% hit)                                                                                                                                        148:27:40.9s exec time cached (99%)                                  
Time elapsed: 8:55.5s
Tests finished: Pass 14. Fail 0. Fatal 0. Skip 0. Build failure 0
```

Differential Revision: D82663766
jeffkbkim added a commit to jeffkbkim/torchrec that referenced this pull request Sep 19, 2025
Summary:

X-link: pytorch/pytorch#163183

This diff implements the constant padding functionality (aten.constant_pad_nd.default) for `LocalShardsWrapper`. The method applies constant padding to the local shards based on the provided padding specification.

Depending on the sharding type (RW, CW), the padding on [left, right, top, bottom] directions will be either applied to the first/last shard, or all local shards.

New unit tests cover:
- 1D (RW) top/bottom paddings
- 2D (CW) left, right, top, bottom paddings
- empty shards, number of dimensions > 2

Differential Revision: D82663766
@facebook-github-bot
Copy link
Contributor

@jeffkbkim has exported this pull request. If you are a Meta employee, you can view the originating diff in D82663766.

jeffkbkim added a commit to jeffkbkim/pytorch that referenced this pull request Sep 19, 2025
…rds wrapper (pytorch#163183)

Summary:
X-link: pytorch/torchrec#3382


This diff implements the constant padding functionality (aten.constant_pad_nd.default) for `LocalShardsWrapper`. The method applies constant padding to the local shards based on the provided padding specification.

Depending on the sharding type (RW, CW), the padding on [left, right, top, bottom] directions will be either applied to the first/last shard, or all local shards.

New unit tests cover:
- 1D (RW) top/bottom paddings
- 2D (CW) left, right, top, bottom paddings
- empty shards, number of dimensions > 2

Test Plan:
```
buck2 test fbcode//caffe2/test/distributed/tensor:shards_wrapper
2025-09-18T15:32:46.525914Z  WARN buck2_interpreter_for_build::interpreter::functions::warning: ptxas 12.8 is not available on platform platform010-aarch64-compat
2025-09-18T15:32:46.525953Z  WARN buck2_interpreter_for_build::interpreter::functions::warning: ptxas 12.8 is not available on platform platform010-compat
2025-09-18T15:32:46.525959Z  WARN buck2_interpreter_for_build::interpreter::functions::warning: ptxas 12.8 is not available on platform platform010-libcxx
Buck UI: https://www.internalfb.com/buck2/ffb34bcb-1555-4fa3-89c6-9c22d078606a
Test UI: https://www.internalfb.com/intern/testinfra/testrun/12384899087608299
Network: Up: 159MiB  Down: 13GiB  (reSessionID-f734bd3c-19ca-44c9-919f-57203ac00be8)
Loading targets.   Remaining      0/5110                                                                                                                                                                        104336 dirs read, 1265395 targets declared
Analyzing targets. Remaining      0/80346                                                                                                                                                                       3349033 actions, 4142832 artifacts declared
Executing actions. Remaining      0/521855                                                                                                                                                                      149:06:17.8s exec time total
Command: test.     Finished 14 local, 397 remote, 199840 cache (99% hit)                                                                                                                                        148:27:40.9s exec time cached (99%)                                  
Time elapsed: 8:55.5s
Tests finished: Pass 14. Fail 0. Fatal 0. Skip 0. Build failure 0
```

Differential Revision: D82663766
Summary:

X-link: pytorch/pytorch#163183

This diff implements the constant padding functionality (aten.constant_pad_nd.default) for `LocalShardsWrapper`. The method applies constant padding to the local shards based on the provided padding specification.

Depending on the sharding type (RW, CW), the padding on [left, right, top, bottom] directions will be either applied to the first/last shard, or all local shards.

New unit tests cover:
- 1D (RW) top/bottom paddings
- 2D (CW) left, right, top, bottom paddings
- empty shards, number of dimensions > 2

Differential Revision: D82663766
@facebook-github-bot
Copy link
Contributor

@jeffkbkim has exported this pull request. If you are a Meta employee, you can view the originating diff in D82663766.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported meta-exported
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants