Skip to content

[native] Move scatter-add N-dim to dynamic - #188820

Closed
slayton58 wants to merge 2 commits into
gh/slayton58/111/basefrom
gh/slayton58/111/head
Closed

slayton58 wants to merge 2 commits into
gh/slayton58/111/basefrom
gh/slayton58/111/head

Conversation

@slayton58

@slayton58 slayton58 commented Jul 2, 2026 •

Copy link
Copy Markdown
Contributor

Stack from ghstack (oldest at bottom):

For input [M, N], the scatter_add override keyed the compile cache on N,
causing a recompile for many applications. Move N to dynamic, allowing a
single compile for all sizes. (Note: dtype and contig/non-contig changes
still recompile.)

Test Plan:

python3 -m pytest test/test_scatter_gather_ops.py \
    -k "test_scatter_add_large or test_scatter_expanded_index"

Authored with assistance from Claude.

[ghstack-poisoned]
@slayton58
slayton58 requested a review from drisspg as a code owner July 2, 2026 16:38
@pytorch-bot

pytorch-bot Bot commented Jul 2, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/188820

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit dcf3165 with merge base 64d5dd4 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@slayton58 slayton58 added the topic: not user facing topic category label Jul 2, 2026
@slayton58
slayton58 marked this pull request as draft July 2, 2026 16:39
[ghstack-poisoned]
slayton58 added a commit that referenced this pull request Jul 2, 2026
For input [M, N], the scatter_add override keyed the compile cache on N,
causing a recompile for many applications. Move N to dynamic, allowing a
single compile for all sizes. (Note: dtype and contig/non-contig changes
still recompile.)

Test Plan:

    python3 -m pytest test/test_scatter_gather_ops.py \
        -k "test_inner_dim_change_no_recompile or test_scatter_add_large or test_scatter_expanded_index"

Authored with assistance from Claude.

ghstack-source-id: ad590ac
Pull-Request: #188820
@slayton58

Copy link
Copy Markdown
Contributor Author

@pytorchbot merge

@pytorch-bot pytorch-bot Bot added the ciflow/trunk Trigger trunk jobs on your pull request label Jul 7, 2026
@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

pytorchmergebot pushed a commit that referenced this pull request Jul 14, 2026
…189506)

Summary:

Second reland of the `index_add -> scatter_add` delegation. This reland sits on top of D110978969 ([native] Move scatter-add N-dim to dynamic, #188820), which moves the scatter_add CuTeDSL override's compile-cache key for the inner dimension to dynamic, so a single compile serves all N sizes instead of recompiling per application (dtype and contig/non-contig still recompile). With D110978969 landed, the issue behind the most recent revert of this diff is resolved, so the delegation is re-applied here unchanged.

Adopts the vectorized scatter_add(dim=0) kernel from D104346887 / PR #182675 as a fast path for `index_add_` on CUDA. `index_add_(0, idx, src)` is mathematically equivalent to `self.scatter_add_(0, idx.unsqueeze(-1).expand_as(src), src)` when `alpha == 1`, so we delegate so scatter_add's own TMA/vectorized eligibility check + dispatch is the single source of truth.

Eligibility (all required to enter the fast path):
- `dim == 0`
- `alpha == 1`
- dtype supported by scatter_add (excludes complex + bool)
- `index.dim() <= 1` and contiguous, `numIndex > 0`
- scatter_add gates internally per-dtype: TMA sm_90+; vec-scatter sm_60+/sm_70+/sm_90+ for fp32/fp16/bf16
- CUDA 12.8+ at compile time

Outside the eligible regime, falls through to the existing `indexFunc{Small,Large}Index` dispatch (untouched).

## Benchmarks

Kernel-side perf is unchanged from D104669063 (the delegation forwards to the same scatter_add kernel, now with PR #184554's smem padding). See D104669063 summary for full B200 and H100 benchmark tables. Highlights:
- Real workloads: B200 4.52x (bf16) / 2.74x (fp32); H100 2.97x (bf16) / 1.42x (fp32).
- bf16 sweeps up to 7.40x on B200; zipf high-contention is neutral on both arches (atomic-contention-bound, not bandwidth-bound).

PR #184554's stage-stride padding is a one-extra-smem-byte change in the worst case (chunk_bytes already padded for chunk_bytes >= 128), so no measurable perf delta from the parent commit.

bypass-github-export-checks unrelated failure

Test Plan:
Re-running the original D104669063 test suite plus the new small-D + high-M_src regression added in this diff:

```
buck2 test fbcode//mode/opt -c fbcode.enable_gpu_sections=true \
    -c fbcode.platform010_cuda_version=12.8 -c fbcode.nvcc_arch=h100a \
    fbcode//caffe2/test:test_others_cuda -- \
    --regex 'test_index_add_fast_path|test_index_add_excluded_dtypes|test_index_add_smem_stage_alignment_regression'
```

Expected: pass on all parametrized variants (fp32 / fp64 / half / bf16 across 3 shapes x 2 index dtypes for `test_index_add_fast_path`; complex64 / complex128 / bool for `test_index_add_excluded_dtypes`; fp32 / bf16 for the new regression).

`test_index_add_smem_stage_alignment_regression` specifically reproduces the SEV-class shape (D=8, M_src = sm * 64 + 256 so every CTA enters stage 1) and asserts numerical equality against a CPU reference. Without PR #184554 in the same build, this test crashes with `cudaErrorMisalignedAddress`; with the parent commit present, it passes cleanly.

No regressions in existing `index_add` tests.

Check that issues gone in

https://www.internalfb.com/mlhub/pipelines/runs/mast/fire-albertchen-train-f1110230424?job_attempt=1&version=0&tab=summary

https://www.internalfb.com/mlhub/pipelines/runs/mast/fire-albertchen-train-mast-UDD-2026-06-27-3d-f958b44a?job_attempt=1&version=0&tab=summary&env=PRODUCTION

https://www.internalfb.com/mlhub/pipelines/runs/mast/mvai-training-online-2115904614?version=0&env=PRODUCTION

Differential Revision: D111254885

Pull Request resolved: #189506
Approved by: https://github.com/jeanschmidt
vishalgoyal316 pushed a commit to vishalgoyal316/pytorch that referenced this pull request Jul 16, 2026
For input [M, N], the scatter_add override keyed the compile cache on N,
causing a recompile for many applications. Move N to dynamic, allowing a
single compile for all sizes. (Note: dtype and contig/non-contig changes
still recompile.)

Test Plan:

    python3 -m pytest test/test_scatter_gather_ops.py \
        -k "test_scatter_add_large or test_scatter_expanded_index"

Authored with assistance from Claude.
Pull Request resolved: pytorch#188820
Approved by: https://github.com/ngimel
vishalgoyal316 pushed a commit to vishalgoyal316/pytorch that referenced this pull request Jul 16, 2026
…84824) (pytorch#189506)

Summary:

Second reland of the `index_add -> scatter_add` delegation. This reland sits on top of D110978969 ([native] Move scatter-add N-dim to dynamic, pytorch#188820), which moves the scatter_add CuTeDSL override's compile-cache key for the inner dimension to dynamic, so a single compile serves all N sizes instead of recompiling per application (dtype and contig/non-contig still recompile). With D110978969 landed, the issue behind the most recent revert of this diff is resolved, so the delegation is re-applied here unchanged.

Adopts the vectorized scatter_add(dim=0) kernel from D104346887 / PR pytorch#182675 as a fast path for `index_add_` on CUDA. `index_add_(0, idx, src)` is mathematically equivalent to `self.scatter_add_(0, idx.unsqueeze(-1).expand_as(src), src)` when `alpha == 1`, so we delegate so scatter_add's own TMA/vectorized eligibility check + dispatch is the single source of truth.

Eligibility (all required to enter the fast path):
- `dim == 0`
- `alpha == 1`
- dtype supported by scatter_add (excludes complex + bool)
- `index.dim() <= 1` and contiguous, `numIndex > 0`
- scatter_add gates internally per-dtype: TMA sm_90+; vec-scatter sm_60+/sm_70+/sm_90+ for fp32/fp16/bf16
- CUDA 12.8+ at compile time

Outside the eligible regime, falls through to the existing `indexFunc{Small,Large}Index` dispatch (untouched).

## Benchmarks

Kernel-side perf is unchanged from D104669063 (the delegation forwards to the same scatter_add kernel, now with PR pytorch#184554's smem padding). See D104669063 summary for full B200 and H100 benchmark tables. Highlights:
- Real workloads: B200 4.52x (bf16) / 2.74x (fp32); H100 2.97x (bf16) / 1.42x (fp32).
- bf16 sweeps up to 7.40x on B200; zipf high-contention is neutral on both arches (atomic-contention-bound, not bandwidth-bound).

PR pytorch#184554's stage-stride padding is a one-extra-smem-byte change in the worst case (chunk_bytes already padded for chunk_bytes >= 128), so no measurable perf delta from the parent commit.

bypass-github-export-checks unrelated failure

Test Plan:
Re-running the original D104669063 test suite plus the new small-D + high-M_src regression added in this diff:

```
buck2 test fbcode//mode/opt -c fbcode.enable_gpu_sections=true \
    -c fbcode.platform010_cuda_version=12.8 -c fbcode.nvcc_arch=h100a \
    fbcode//caffe2/test:test_others_cuda -- \
    --regex 'test_index_add_fast_path|test_index_add_excluded_dtypes|test_index_add_smem_stage_alignment_regression'
```

Expected: pass on all parametrized variants (fp32 / fp64 / half / bf16 across 3 shapes x 2 index dtypes for `test_index_add_fast_path`; complex64 / complex128 / bool for `test_index_add_excluded_dtypes`; fp32 / bf16 for the new regression).

`test_index_add_smem_stage_alignment_regression` specifically reproduces the SEV-class shape (D=8, M_src = sm * 64 + 256 so every CTA enters stage 1) and asserts numerical equality against a CPU reference. Without PR pytorch#184554 in the same build, this test crashes with `cudaErrorMisalignedAddress`; with the parent commit present, it passes cleanly.

No regressions in existing `index_add` tests.

Check that issues gone in

https://www.internalfb.com/mlhub/pipelines/runs/mast/fire-albertchen-train-f1110230424?job_attempt=1&version=0&tab=summary

https://www.internalfb.com/mlhub/pipelines/runs/mast/fire-albertchen-train-mast-UDD-2026-06-27-3d-f958b44a?job_attempt=1&version=0&tab=summary&env=PRODUCTION

https://www.internalfb.com/mlhub/pipelines/runs/mast/mvai-training-online-2115904614?version=0&env=PRODUCTION

Differential Revision: D111254885

Pull Request resolved: pytorch#189506
Approved by: https://github.com/jeanschmidt
DamJanusz pushed a commit to DamJanusz/pytorch that referenced this pull request Jul 21, 2026
For input [M, N], the scatter_add override keyed the compile cache on N,
causing a recompile for many applications. Move N to dynamic, allowing a
single compile for all sizes. (Note: dtype and contig/non-contig changes
still recompile.)

Test Plan:

    python3 -m pytest test/test_scatter_gather_ops.py \
        -k "test_scatter_add_large or test_scatter_expanded_index"

Authored with assistance from Claude.
Pull Request resolved: pytorch#188820
Approved by: https://github.com/ngimel
DamJanusz pushed a commit to DamJanusz/pytorch that referenced this pull request Jul 21, 2026
…84824) (pytorch#189506)

Summary:

Second reland of the `index_add -> scatter_add` delegation. This reland sits on top of D110978969 ([native] Move scatter-add N-dim to dynamic, pytorch#188820), which moves the scatter_add CuTeDSL override's compile-cache key for the inner dimension to dynamic, so a single compile serves all N sizes instead of recompiling per application (dtype and contig/non-contig still recompile). With D110978969 landed, the issue behind the most recent revert of this diff is resolved, so the delegation is re-applied here unchanged.

Adopts the vectorized scatter_add(dim=0) kernel from D104346887 / PR pytorch#182675 as a fast path for `index_add_` on CUDA. `index_add_(0, idx, src)` is mathematically equivalent to `self.scatter_add_(0, idx.unsqueeze(-1).expand_as(src), src)` when `alpha == 1`, so we delegate so scatter_add's own TMA/vectorized eligibility check + dispatch is the single source of truth.

Eligibility (all required to enter the fast path):
- `dim == 0`
- `alpha == 1`
- dtype supported by scatter_add (excludes complex + bool)
- `index.dim() <= 1` and contiguous, `numIndex > 0`
- scatter_add gates internally per-dtype: TMA sm_90+; vec-scatter sm_60+/sm_70+/sm_90+ for fp32/fp16/bf16
- CUDA 12.8+ at compile time

Outside the eligible regime, falls through to the existing `indexFunc{Small,Large}Index` dispatch (untouched).

## Benchmarks

Kernel-side perf is unchanged from D104669063 (the delegation forwards to the same scatter_add kernel, now with PR pytorch#184554's smem padding). See D104669063 summary for full B200 and H100 benchmark tables. Highlights:
- Real workloads: B200 4.52x (bf16) / 2.74x (fp32); H100 2.97x (bf16) / 1.42x (fp32).
- bf16 sweeps up to 7.40x on B200; zipf high-contention is neutral on both arches (atomic-contention-bound, not bandwidth-bound).

PR pytorch#184554's stage-stride padding is a one-extra-smem-byte change in the worst case (chunk_bytes already padded for chunk_bytes >= 128), so no measurable perf delta from the parent commit.

bypass-github-export-checks unrelated failure

Test Plan:
Re-running the original D104669063 test suite plus the new small-D + high-M_src regression added in this diff:

```
buck2 test fbcode//mode/opt -c fbcode.enable_gpu_sections=true \
    -c fbcode.platform010_cuda_version=12.8 -c fbcode.nvcc_arch=h100a \
    fbcode//caffe2/test:test_others_cuda -- \
    --regex 'test_index_add_fast_path|test_index_add_excluded_dtypes|test_index_add_smem_stage_alignment_regression'
```

Expected: pass on all parametrized variants (fp32 / fp64 / half / bf16 across 3 shapes x 2 index dtypes for `test_index_add_fast_path`; complex64 / complex128 / bool for `test_index_add_excluded_dtypes`; fp32 / bf16 for the new regression).

`test_index_add_smem_stage_alignment_regression` specifically reproduces the SEV-class shape (D=8, M_src = sm * 64 + 256 so every CTA enters stage 1) and asserts numerical equality against a CPU reference. Without PR pytorch#184554 in the same build, this test crashes with `cudaErrorMisalignedAddress`; with the parent commit present, it passes cleanly.

No regressions in existing `index_add` tests.

Check that issues gone in

https://www.internalfb.com/mlhub/pipelines/runs/mast/fire-albertchen-train-f1110230424?job_attempt=1&version=0&tab=summary

https://www.internalfb.com/mlhub/pipelines/runs/mast/fire-albertchen-train-mast-UDD-2026-06-27-3d-f958b44a?job_attempt=1&version=0&tab=summary&env=PRODUCTION

https://www.internalfb.com/mlhub/pipelines/runs/mast/mvai-training-online-2115904614?version=0&env=PRODUCTION

Differential Revision: D111254885

Pull Request resolved: pytorch#189506
Approved by: https://github.com/jeanschmidt
youlituao pushed a commit to youlituao/pytorch that referenced this pull request Jul 28, 2026
For input [M, N], the scatter_add override keyed the compile cache on N,
causing a recompile for many applications. Move N to dynamic, allowing a
single compile for all sizes. (Note: dtype and contig/non-contig changes
still recompile.)

Test Plan:

    python3 -m pytest test/test_scatter_gather_ops.py \
        -k "test_scatter_add_large or test_scatter_expanded_index"

Authored with assistance from Claude.
Pull Request resolved: pytorch#188820
Approved by: https://github.com/ngimel
youlituao pushed a commit to youlituao/pytorch that referenced this pull request Jul 28, 2026
…84824) (pytorch#189506)

Summary:

Second reland of the `index_add -> scatter_add` delegation. This reland sits on top of D110978969 ([native] Move scatter-add N-dim to dynamic, pytorch#188820), which moves the scatter_add CuTeDSL override's compile-cache key for the inner dimension to dynamic, so a single compile serves all N sizes instead of recompiling per application (dtype and contig/non-contig still recompile). With D110978969 landed, the issue behind the most recent revert of this diff is resolved, so the delegation is re-applied here unchanged.

Adopts the vectorized scatter_add(dim=0) kernel from D104346887 / PR pytorch#182675 as a fast path for `index_add_` on CUDA. `index_add_(0, idx, src)` is mathematically equivalent to `self.scatter_add_(0, idx.unsqueeze(-1).expand_as(src), src)` when `alpha == 1`, so we delegate so scatter_add's own TMA/vectorized eligibility check + dispatch is the single source of truth.

Eligibility (all required to enter the fast path):
- `dim == 0`
- `alpha == 1`
- dtype supported by scatter_add (excludes complex + bool)
- `index.dim() <= 1` and contiguous, `numIndex > 0`
- scatter_add gates internally per-dtype: TMA sm_90+; vec-scatter sm_60+/sm_70+/sm_90+ for fp32/fp16/bf16
- CUDA 12.8+ at compile time

Outside the eligible regime, falls through to the existing `indexFunc{Small,Large}Index` dispatch (untouched).

## Benchmarks

Kernel-side perf is unchanged from D104669063 (the delegation forwards to the same scatter_add kernel, now with PR pytorch#184554's smem padding). See D104669063 summary for full B200 and H100 benchmark tables. Highlights:
- Real workloads: B200 4.52x (bf16) / 2.74x (fp32); H100 2.97x (bf16) / 1.42x (fp32).
- bf16 sweeps up to 7.40x on B200; zipf high-contention is neutral on both arches (atomic-contention-bound, not bandwidth-bound).

PR pytorch#184554's stage-stride padding is a one-extra-smem-byte change in the worst case (chunk_bytes already padded for chunk_bytes >= 128), so no measurable perf delta from the parent commit.

bypass-github-export-checks unrelated failure

Test Plan:
Re-running the original D104669063 test suite plus the new small-D + high-M_src regression added in this diff:

```
buck2 test fbcode//mode/opt -c fbcode.enable_gpu_sections=true \
    -c fbcode.platform010_cuda_version=12.8 -c fbcode.nvcc_arch=h100a \
    fbcode//caffe2/test:test_others_cuda -- \
    --regex 'test_index_add_fast_path|test_index_add_excluded_dtypes|test_index_add_smem_stage_alignment_regression'
```

Expected: pass on all parametrized variants (fp32 / fp64 / half / bf16 across 3 shapes x 2 index dtypes for `test_index_add_fast_path`; complex64 / complex128 / bool for `test_index_add_excluded_dtypes`; fp32 / bf16 for the new regression).

`test_index_add_smem_stage_alignment_regression` specifically reproduces the SEV-class shape (D=8, M_src = sm * 64 + 256 so every CTA enters stage 1) and asserts numerical equality against a CPU reference. Without PR pytorch#184554 in the same build, this test crashes with `cudaErrorMisalignedAddress`; with the parent commit present, it passes cleanly.

No regressions in existing `index_add` tests.

Check that issues gone in

https://www.internalfb.com/mlhub/pipelines/runs/mast/fire-albertchen-train-f1110230424?job_attempt=1&version=0&tab=summary

https://www.internalfb.com/mlhub/pipelines/runs/mast/fire-albertchen-train-mast-UDD-2026-06-27-3d-f958b44a?job_attempt=1&version=0&tab=summary&env=PRODUCTION

https://www.internalfb.com/mlhub/pipelines/runs/mast/mvai-training-online-2115904614?version=0&env=PRODUCTION

Differential Revision: D111254885

Pull Request resolved: pytorch#189506
Approved by: https://github.com/jeanschmidt
aws-kingrj pushed a commit to amazon-contributing/upstream-to-pytorch that referenced this pull request Jul 29, 2026
For input [M, N], the scatter_add override keyed the compile cache on N,
causing a recompile for many applications. Move N to dynamic, allowing a
single compile for all sizes. (Note: dtype and contig/non-contig changes
still recompile.)

Test Plan:

    python3 -m pytest test/test_scatter_gather_ops.py \
        -k "test_scatter_add_large or test_scatter_expanded_index"

Authored with assistance from Claude.
Pull Request resolved: pytorch#188820
Approved by: https://github.com/ngimel
aws-kingrj pushed a commit to amazon-contributing/upstream-to-pytorch that referenced this pull request Jul 29, 2026
…84824) (pytorch#189506)

Summary:

Second reland of the `index_add -> scatter_add` delegation. This reland sits on top of D110978969 ([native] Move scatter-add N-dim to dynamic, pytorch#188820), which moves the scatter_add CuTeDSL override's compile-cache key for the inner dimension to dynamic, so a single compile serves all N sizes instead of recompiling per application (dtype and contig/non-contig still recompile). With D110978969 landed, the issue behind the most recent revert of this diff is resolved, so the delegation is re-applied here unchanged.

Adopts the vectorized scatter_add(dim=0) kernel from D104346887 / PR pytorch#182675 as a fast path for `index_add_` on CUDA. `index_add_(0, idx, src)` is mathematically equivalent to `self.scatter_add_(0, idx.unsqueeze(-1).expand_as(src), src)` when `alpha == 1`, so we delegate so scatter_add's own TMA/vectorized eligibility check + dispatch is the single source of truth.

Eligibility (all required to enter the fast path):
- `dim == 0`
- `alpha == 1`
- dtype supported by scatter_add (excludes complex + bool)
- `index.dim() <= 1` and contiguous, `numIndex > 0`
- scatter_add gates internally per-dtype: TMA sm_90+; vec-scatter sm_60+/sm_70+/sm_90+ for fp32/fp16/bf16
- CUDA 12.8+ at compile time

Outside the eligible regime, falls through to the existing `indexFunc{Small,Large}Index` dispatch (untouched).

## Benchmarks

Kernel-side perf is unchanged from D104669063 (the delegation forwards to the same scatter_add kernel, now with PR pytorch#184554's smem padding). See D104669063 summary for full B200 and H100 benchmark tables. Highlights:
- Real workloads: B200 4.52x (bf16) / 2.74x (fp32); H100 2.97x (bf16) / 1.42x (fp32).
- bf16 sweeps up to 7.40x on B200; zipf high-contention is neutral on both arches (atomic-contention-bound, not bandwidth-bound).

PR pytorch#184554's stage-stride padding is a one-extra-smem-byte change in the worst case (chunk_bytes already padded for chunk_bytes >= 128), so no measurable perf delta from the parent commit.

bypass-github-export-checks unrelated failure

Test Plan:
Re-running the original D104669063 test suite plus the new small-D + high-M_src regression added in this diff:

```
buck2 test fbcode//mode/opt -c fbcode.enable_gpu_sections=true \
    -c fbcode.platform010_cuda_version=12.8 -c fbcode.nvcc_arch=h100a \
    fbcode//caffe2/test:test_others_cuda -- \
    --regex 'test_index_add_fast_path|test_index_add_excluded_dtypes|test_index_add_smem_stage_alignment_regression'
```

Expected: pass on all parametrized variants (fp32 / fp64 / half / bf16 across 3 shapes x 2 index dtypes for `test_index_add_fast_path`; complex64 / complex128 / bool for `test_index_add_excluded_dtypes`; fp32 / bf16 for the new regression).

`test_index_add_smem_stage_alignment_regression` specifically reproduces the SEV-class shape (D=8, M_src = sm * 64 + 256 so every CTA enters stage 1) and asserts numerical equality against a CPU reference. Without PR pytorch#184554 in the same build, this test crashes with `cudaErrorMisalignedAddress`; with the parent commit present, it passes cleanly.

No regressions in existing `index_add` tests.

Check that issues gone in

https://www.internalfb.com/mlhub/pipelines/runs/mast/fire-albertchen-train-f1110230424?job_attempt=1&version=0&tab=summary

https://www.internalfb.com/mlhub/pipelines/runs/mast/fire-albertchen-train-mast-UDD-2026-06-27-3d-f958b44a?job_attempt=1&version=0&tab=summary&env=PRODUCTION

https://www.internalfb.com/mlhub/pipelines/runs/mast/mvai-training-online-2115904614?version=0&env=PRODUCTION

Differential Revision: D111254885

Pull Request resolved: pytorch#189506
Approved by: https://github.com/jeanschmidt
@github-actions
github-actions Bot deleted the gh/slayton58/111/head branch August 7, 2026 02:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/trunk Trigger trunk jobs on your pull request Merged topic: not user facing topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants