test(tensorscatter): cover circular prefix preservation - #32264
Open
Ti-Tai Wang (titaiwangms) wants to merge 1 commit into
Open
test(tensorscatter): cover circular prefix preservation#32264Ti-Tai Wang (titaiwangms) wants to merge 1 commit into
Ti-Tai Wang (titaiwangms) wants to merge 1 commit into
Conversation
Add a discriminating regression case where the batch dimension exceeds the maximum sequence length while sequence writes wrap from slot 3 to slot 0. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 427bc0f4-eaf2-406e-95ad-b5b1af6ccdc6 Signed-off-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds targeted regression coverage for TensorScatter circular mode to ensure batch coordinates are preserved during sequence wrapping.
Changes:
- Tests batch size exceeding maximum sequence length.
- Verifies sequence writes wrap from slot 3 to slot 0 without cross-batch corruption.
No actionable issues found.
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Ti-Tai Wang (titaiwangms)
enabled auto-merge (squash)
August 25, 2026 21:11
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds a
TensorScattercircular-mode regression test where the batch dimension exceeds the maximum sequence length. The case also wraps sequence writes from slot 3 to slot 0, verifying that modulo applies only to the sequence coordinate while every batch prefix remains unchanged.Motivation and Context
onnx/onnx#8353 identified that applying modulo to every coordinate in the full index tuple can fold one batch into another. ONNX Runtime's CPU and CUDA kernels already preserve prefix coordinates, but the existing tests use prefix dimensions smaller than the maximum sequence length and cannot distinguish the incorrect behavior.
This test makes the regression observable: with
batch_size=5andmax_sequence_length=4, a full-tuple modulo maps batch 4 to batch 0.Related: onnx/onnx#8353
Testing
cmake --build build/cpu_only/Debug --target onnxruntime_provider_test --parallel./onnxruntime_provider_test --gtest_filter=TensorScatterTest.Circular_BatchLargerThanMaxSequenceLength./onnxruntime_provider_test --gtest_filter=TensorScatterTest.*(23 passed)lintrunner onnxruntime/test/providers/cpu/llm/tensorscatter_op_test.cc