Skip to content

[CINN]【Infer Symbolic Shape 】Add pyramid_hash op #67951

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

Merged
merged 7 commits into from
Sep 18, 2024

Conversation

crazyxiaoxi
Copy link
Contributor

@crazyxiaoxi crazyxiaoxi commented Sep 3, 2024

PR Category

CINN

PR Types

improvements

Description

添加pyramid_hash 算子符号推导接口
本算子有单测,但只含unnitest
Pcard-67164

Copy link

paddle-bot bot commented Sep 3, 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.

@paddle-bot paddle-bot bot added the contributor External developers label Sep 3, 2024
@gongshaotian
Copy link
Contributor

PR Category

CINN

PR Types

improvements

Description

unittest

Title和Description描述太简陋,Description中需要加上Pcard-67164

// Set the output shapes
std::vector<symbol::DimExpr> out_shape = {infer_context->GetNextSymName(),
symbol::DimExpr(num_emb)};
std::vector<symbol::DimExpr> drop_pos = {infer_context->GetNextSymName(), 1};
Copy link
Contributor

Choose a reason for hiding this comment

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

再看一下这个能算出来吗,看起来bottom就是x?
截屏2024-09-05 15 46 16

Copy link
Contributor Author

Choose a reason for hiding this comment

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

截屏2024-09-09 11 24 44
在kernel中,out就是top_lod, drop_pos就是drop_pos_lod。这两个符号在推导过程中用的类似的逻辑。out采用新符号,drop——pos的操作也应该采用新符号。

@crazyxiaoxi crazyxiaoxi changed the title [CINN] pyramid_hash op [CINN]【Infer Symbolic Shape 】Add pyramid_hash op Sep 9, 2024
symbol::ShapeOrDataDimExprs{symbol::TensorShapeOrDataDimExprs(drop_pos)});
infer_context->SetShapeOrDataForValue(
op->result(2),
symbol::ShapeOrDataDimExprs{symbol::TensorShapeOrDataDimExprs(x_shape)});
Copy link
Contributor

Choose a reason for hiding this comment

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

x_temp_out 是不是可以推出来
截屏2024-09-10 11 45 17

Copy link
Contributor

Choose a reason for hiding this comment

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

image

Copy link
Contributor

@gongshaotian gongshaotian left a comment

Choose a reason for hiding this comment

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

LGTM

@luotao1 luotao1 merged commit 43d6792 into PaddlePaddle:develop Sep 18, 2024
28 of 30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor External developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants