Skip to content

Conversation

@SigureMo
Copy link
Member

PR Category

Execute Infrastructure

PR Types

Bug fixes

Description

strides normalization 之后,原本 shape=[1, 2, 3, 4]strides=[24, 12, 4, 1] 会变成 strides=[1, 12, 4, 1],会在某些场景出现问题,因此移除,PyTorch 在如下 PR 后也已经移除

Copilot AI review requested due to automatic review settings December 23, 2025 16:33
@paddle-bot
Copy link

paddle-bot bot commented Dec 23, 2025

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR removes stride normalization when converting Paddle tensors to DLPack format, addressing bugs that occur when strides are artificially normalized (e.g., setting stride=1 for dimensions with size < 2). The change aligns with PyTorch's recent similar modifications.

Key Changes:

  • Removed stride normalization logic that modified strides for dimensions with size < 2
  • Simplified memory management by using direct pointers to internal tensor metadata instead of heap-allocated copies
  • Updated the deleter function to remove cleanup of shape/strides arrays (no longer heap-allocated)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (develop@93ba43d). Learn more about missing BASE report.

Additional details and impacted files
@@             Coverage Diff             @@
##             develop    #77052   +/-   ##
===========================================
  Coverage           ?   100.00%           
===========================================
  Files              ?         1           
  Lines              ?         5           
  Branches           ?         0           
===========================================
  Hits               ?         5           
  Misses             ?         0           
  Partials           ?         0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@SigureMo SigureMo merged commit c2b66c0 into PaddlePaddle:develop Dec 24, 2025
130 of 142 checks passed
@SigureMo SigureMo deleted the dlpack/remove-stride-normalization branch December 24, 2025 06:02
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.

3 participants