Skip to content

[CINN] Arange support partially symbolic inputs #74209

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

Enigmatisms
Copy link
Contributor

PR Category

CINN

PR Types

Improvements

Description

这是 #72598 系列 PR 的进一步 improvements

增加了对 CINN Arange 三个inputs(start,end,step)中 start 与 end 的 symbolic input 支持。也即:

  • start 与 end 不再要求仅可以来自于 static 的 pd_op.full 才能进入 CINN,cinn_op.generate_shape 产生的 symbolic shape 也可以作为输入进入 arange

目前 arange 进入 CINN 的规则:

  • step 一定为 static 值(因为通常都是 1,-1,2,-2)
  • step 为正:
    • start 与 end 可以是 symbolic 或 static 的
  • step 为 负:
    • 为了避免引入 DimExpr 的 Abs(可支持,但是工作量太大容易引入风险),拒绝动态 start 与 end(因为与其他kernel融合时易在IndexExpr中引入Abs操作)。

Pcard-89620

Copy link

paddle-bot bot commented Jul 24, 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.

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (develop@4953c94). Learn more about missing BASE report.

Additional details and impacted files
@@             Coverage Diff             @@
##             develop    #74209   +/-   ##
===========================================
  Coverage           ?   100.00%           
===========================================
  Files              ?         1           
  Lines              ?         4           
  Branches           ?         0           
===========================================
  Hits               ?         4           
  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.

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