-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Use DimExpr and change InferSymbolicShapeInterface #60371
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
634161b
to
4b1d120
Compare
4b1d120
to
aced1f7
Compare
pir::OpResult res = op->result(0); | ||
std::string res_id = pir::GetValueId(&res); | ||
shape_analysis->value_id_to_shapeordata_[res_id] = | ||
shape_analysis->value_id_to_shapeordata_[operand_source_id]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
正式代码里最好不要直接操作成员变量了,需要使用封装接口操作
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
收到
// Value output_shape = | ||
// builder.Build<shape::FromElementsOp>(shape_values).result(0); | ||
// reified_return_shapes.push_back(output_shape); | ||
bool ShapeSrOpInferSymbolicShape( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shape"Sr"Op 中间的Sr是什么含义?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
selected_rows 版本的算子,ShapeSrOp 和 ShapeSrOp 共用了一个 yaml 配置
|
||
symbol::ShapeOrDataDimExprs shape_data; | ||
shape_data = shape_analysis->value_id_to_shapeordata_[operand_source_id]; | ||
shape_analysis->value_id_to_shapeordata_[res_id] = shape_data; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#60146 这个PR合入之后,可以增加一些调试信息输出,便于以后调试使用
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好的,这个PR里 重写了 DebugPrintOpInfo,目前也支持 符号和 int_64 两种类型的 Dim_Expr 打印,后续会改用新的接口
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#60146 已合入
std::string operand_source_id = pir::GetValueId(&operand_source); | ||
pir::OpResult res = op->result(0); | ||
std::string res_id = pir::GetValueId(&res); | ||
shape_analysis->value_id_to_shapeordata_[res_id] = | ||
shape_analysis->value_id_to_shapeordata_[operand_source_id]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
value可以直接用作map的key吗?看着用value id会多一些处理
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
可以
symbol::ShapeOrDataDimExprs shape_data; | ||
|
||
shape_data = shape_analysis->value_id_to_shapeordata_[operand_source_1_id]; | ||
shape_analysis->value_id_to_shapeordata_[res_id] = shape_data; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里的shape
和data
数据是不是需要交换下?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里应该后面要用到宏宇PR的一个接口,下个PR改,这里data应该还是空的
auto res = op->result(0); | ||
auto res_id = pir::GetValueId(&res); | ||
|
||
shape_analysis->value_id_to_shapeordata_[res_id] = value_shape; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里的value_shape是空的?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个地方的逻辑后面还需要完善一下
* Use DimExpr and change InferSymbolicShapeInterface * static infer lib
PR types
Others
PR changes
Others
Description
Pcard-67164
Use DimExpr and change InferSymbolicShapeInterface
Note : Windows static library(both CPU and GPU)over the limit, so no longer create_static_lib, and cc_library is dummy