Skip to content

[Compat Test] Add cross-framework scatter_reduce test#71

Open
youge325 wants to merge 9 commits into
PFCCLab:masterfrom
youge325:test/scatter_reduce-20260530
Open

[Compat Test] Add cross-framework scatter_reduce test#71
youge325 wants to merge 9 commits into
PFCCLab:masterfrom
youge325:test/scatter_reduce-20260530

Conversation

@youge325

@youge325 youge325 commented May 30, 2026

Copy link
Copy Markdown
Contributor

Summary

Add ScatterReduceTest for cross-framework compatibility testing of Tensor::scatter_reduce.

Test coverage (16 cases):

  • Shapes: small/medium/large 2D tensors, empty tensor
  • Dtypes: Float, Double, Int, Long
  • Reduce modes: sum, amax, amin, mean, prod
  • Dimensions: dim=0 (default), dim=1
  • Options: include_self=false, inplace variant
  • Error handling: invalid reduce mode
  • Workaround: torch replace mode segfault handled by outputting "exception"

Test plan

  • result_cmp.sh achieves MATCH for ScatterReduceTest

Related: PaddlePaddle/Paddle#79196

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings May 30, 2026 11:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@youge325 youge325 force-pushed the test/scatter_reduce-20260530 branch from d612a67 to 24e3807 Compare June 14, 2026 08:00
@youge325 youge325 force-pushed the test/scatter_reduce-20260530 branch from f39046c to b215101 Compare June 28, 2026 19:46
youge325 and others added 9 commits June 29, 2026 12:28
   [Compat Test] Add cross-framework scatter_reduce test

   Add ScatterReduceTest with 16 test cases covering:
   - Shapes: small/medium/large 2D, empty tensor
   - Dtypes: Float, Double, Int, Long
   - Reduce modes: sum, amax, amin, mean, prod
   - Special cases: dim=1, include_self=false, inplace, invalid reduce
   - Workaround for torch replace mode segfault

   Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
   EOF
   )
…inplace prod

Add cross-framework comparison tests:
- ScatterReduceProdFloatNoIncludeSelf
- ScatterReduceInplaceProdFloatSmall

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…lf=false

Add cross-framework comparison tests:
- ScatterReduceAmaxFloatNoIncludeSelf
- ScatterReduceAminFloatNoIncludeSelf
- ScatterReduceMeanFloatNoIncludeSelf

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Change self from 5.0f to 25.0f so some src values are below self
and some are above, ensuring the test can distinguish
include_self=true vs false behavior.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Add ScatterReduceDimOutOfRange cross-framework comparison test
for int64_t dim exceeding int range.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@youge325 youge325 force-pushed the test/scatter_reduce-20260530 branch from b215101 to 6de8da9 Compare June 29, 2026 05:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants