Skip to content

[CINN]optimize global memory read insert pointer #68667

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

Conversation

phlrain
Copy link
Collaborator

@phlrain phlrain commented Oct 12, 2024

PR Category

CINN

PR Types

Improvements

Description

pcard-76996

优化对于global memory 读取的处理逻辑

当前多输出的融合,会插入一些if op减少重复的写操作,这个if op 是在schedule block的内部,如下所示

if xxx // split schedule 产生的
scheduleBlock(var_0)
if xxx // 多输出产生的
out[i] = f( in [i])

该pr前
if xxx // split schedule 产生的
scheduleBlock(var_0)
if xxx // 多输出产生的
local_var = in[i]
out[i] = f( local_var )

该pr后
if xxx // split schedule 产生的
scheduleBlock(var_0)
local_var = in[i]
if xxx // 多输出产生的
out[i] = f( local_var )

本pr 对insert逻辑进行调整,把插入的语句,放到scheduleBlock的最上层Block中,(假如scheduleBlock内部没有if op,行为和之前一致) 该修复是一个临时修复,合理的方案是在EliminateCommonGlobalMemoryRead 中对所有的输入, 并分析输入if条件,并且期望load的操作和计算逻辑分析,但是工作量较大,会在后续的优化中完成

Copy link

paddle-bot bot commented Oct 12, 2024

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

… optimize_global_memory_read_insert_pointer
@phlrain phlrain changed the title optimize global memory read insert pointer [CINN]optimize global memory read insert pointer Oct 14, 2024
@phlrain phlrain merged commit dbd6614 into PaddlePaddle:develop Oct 15, 2024
27 checks passed
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