Skip to content
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

【PIR】Add ShapeAnalysis, and save() into SymDimMgr. #57029

Merged
merged 10 commits into from
Sep 14, 2023

Conversation

liuruyan
Copy link
Contributor

@liuruyan liuruyan commented Sep 6, 2023

PR types

Others

PR changes

Others

Description

  1. 添加 ShapeAnalysis 结构。
  2. 添加 TieShapeOp,目前仅实现 Value Shape 与 SymbolicDim 通过属性绑定。
  3. 添加 FuncOp,Op 内存在一个 block 用来存放 Shape_Constraint_Op,更新所有约束相关 Op 存放位置至 FuncOp 内。使用时添加 在Program ModuleOp 的 block 中,执行时应跳过该 Op。
  4. 重载 TieProductEqualOp Build 方法,可接受已分割好的 lhs_vec、rhs_vec。
  5. 固定符号属性名称:SymbolicDimAttr,通过 SymbolicDim::getSymbolicDimAttrName() 获取。
  6. 为 SymbolicDimMgr 添加 save 方法,保证 sym 属性更新,约束更新。
  7. 完成所有 ShapedType 位置替换的 TODO。为 ShapedType 增加 hasStaticShape 方法。

Other

Pcard-67164

@paddle-bot
Copy link

paddle-bot bot commented Sep 6, 2023

你的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.

@liuruyan liuruyan changed the title Add ShapeAnalysis, and save() into SymDimMgr. [PIR] Add ShapeAnalysis, and save() into SymDimMgr. Sep 13, 2023
pir::dialect::TieShapeOp tieShapeOp5 =
builder.Build<pir::dialect::TieShapeOp>(value5);

builder.SetInsertionPointToEnd(funcOp.block());
Copy link
Contributor

Choose a reason for hiding this comment

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

FuncOp 里包含了一个region,内含一个block,存放一个op列表,在FuncOp里能自然访问到父级(即FuncOp所在层级或以上)的变量,但是否有父级需要访问其内region里的变量的场景或需求,因为region默认是「封闭的」

Copy link
Contributor Author

@liuruyan liuruyan Sep 13, 2023

Choose a reason for hiding this comment

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

目前没有这种需求。FuncOp 中会存放约束相关 Op 和 SymbolicDim,其中 SymbolicDim 也是以 Op 形式存储的。使用时会通过 SymbolDimMgr 加载 FuncOp 中 Op,之后通过 string symName 来进行绑定。

Copy link
Contributor

@zhangbopd zhangbopd left a comment

Choose a reason for hiding this comment

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

LGTM

@zhangbopd zhangbopd merged commit 7aa9884 into PaddlePaddle:develop Sep 14, 2023
@liuruyan liuruyan deleted the shapeAnalysis_ branch September 14, 2023 05:03
@liuruyan liuruyan changed the title [PIR] Add ShapeAnalysis, and save() into SymDimMgr. 【PIR】Add ShapeAnalysis, and save() into SymDimMgr. Sep 14, 2023
danleifeng pushed a commit to danleifeng/Paddle that referenced this pull request Nov 14, 2023
* add ShapeAnalysis、Mgr::save

* add funcOp.

* access ShapedType.

* remove const_cast.
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.

4 participants