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

[IR Dialect] ⚔Elden chapter 1.1⚔ #55256

Closed

Conversation

Liyulingyue
Copy link
Contributor

PR types

Others

PR changes

Others

Description

add const return in StrAttributeStorage

#55205 case 1.1

🎉让大卢恩再次获得力量🎉

@paddle-bot
Copy link

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

@paddle-bot paddle-bot bot added contributor External developers status: proposed labels Jul 8, 2023
@Liyulingyue Liyulingyue changed the title [IR Dialect] Elden chapter 1.1 [IR Dialect] ⚔Elden chapter 1.1⚔ Jul 8, 2023
@luotao1 luotao1 added the HappyOpenSource 快乐开源活动issue与PR label Jul 10, 2023

private:
char *data_;
uint32_t size_;
ParamKey DataString;
Copy link
Contributor

Choose a reason for hiding this comment

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

  1. data_已经malloc放到了heap了,这里如果再存一份string的话,成员变量重复了
  2. 从框架内规范而言,类的成员变量是小写,且以下划线作为区分,规范写法应该是 data_string_

关于上述①,已与内部进行讨论,看是否可以移除malloc,只保留 data_string_即可

@Aurelius84
Copy link
Contributor

这里补充下一些 Storage 的设计考量(后续会以「设计文档」方式发布到Community社区)。

可以看到,在新 IR 里有很多 Storage 的设计,比如每个Attribute 都仅关联了一个对应的 Storage 指针。

  • 首先为了能让Attribute支持轻量级的浅Copy,以方便值传递;
  • 所有的 Attribute 都是交由 AttributeManager 来创建的

这里涉及的内容比较多,我来写个 《Storage 技术设计剖析》专栏吧

@Aurelius84
Copy link
Contributor

@Liyulingyue 这个 PR 在现有的规范下可能还合入不了,StringAtrribute这个比较特殊,可以先搁置下。可以优化 IntArrayAttribute的接口:

  • IntArrayAttributeStorage中GetAsKey 返回const &
  • IntArraryAttribute 中 data 接口返回 const &

@paddle-ci-bot
Copy link

paddle-ci-bot bot commented Jul 19, 2023

Sorry to inform you that 46c87fa's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually.

@Aurelius84 Aurelius84 closed this Jul 19, 2023
@Aurelius84
Copy link
Contributor

先close掉了,string这个内部同学为了避免歧义,修改为了AsString()接口

@Liyulingyue Liyulingyue deleted the Elden_Chapter_1.1 branch August 10, 2023 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor External developers HappyOpenSource 快乐开源活动issue与PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants