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

[Dynamic shape] Delete SymbolicDimMgr symbolTable and SymbolicDimOp #60933

Merged
merged 18 commits into from
Jan 19, 2024

Conversation

zhangbopd
Copy link
Contributor

PR types

Others

PR changes

Others

Description

Pcard-67164

  • Delete SymbolicDimMgr symbolTable and SymbolicDimOp etc

Copy link

paddle-bot bot commented Jan 18, 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.

@zhangbopd zhangbopd changed the title delete SymbolicDimMgr symbolTable and SymbolicDimOp [Dynamic shape] Delete SymbolicDimMgr symbolTable and SymbolicDimOp Jan 18, 2024
Comment on lines +76 to +88
if (lhs == rhs) return true;
// auto lhs_type = lhs.type().dyn_cast<ShapedTypeInterface>();
// auto rhs_type = rhs.type().dyn_cast<ShapedTypeInterface>();

// if (!lhs_type || !rhs_type || !lhs_type.HasRank() || !rhs_type.HasRank())
// return false;

// return IsProductEqual(lhs,
// 0,
// static_cast<int>(lhs_type.GetRank()),
// rhs,
// 0,
// static_cast<int>(rhs_type.GetRank()));
Copy link
Contributor

Choose a reason for hiding this comment

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

这些是不是也可以清理了?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

这里接口需要保留、逻辑相同但是需要使用新的数据结构进行重构,注释掉为是保留了逻辑,后续PR会马上使用dim_expr 完成接口功能

Comment on lines +94 to +102
// std::vector<int> lhs_dim_idxs, rhs_dim_idxs;

// lhs_dim_idxs.reserve(lhs_to - lhs_from);
// rhs_dim_idxs.reserve(rhs_to - rhs_from);

// for (int i = lhs_from; i < lhs_to; ++i) lhs_dim_idxs.push_back(i);
// for (int i = rhs_from; i < rhs_to; ++i) rhs_dim_idxs.push_back(i);

// return IsProductEqual(lhs, lhs_dim_idxs, rhs, rhs_dim_idxs);
Copy link
Contributor

Choose a reason for hiding this comment

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

同上

Copy link
Contributor Author

Choose a reason for hiding this comment

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

同上

Comment on lines +179 to +186
auto it = tables_.find(program->module_op().operation()->id());

if (it == tables_.end()) {
it = tables_
.emplace(program->module_op().operation()->id(),
ShapeConstraintIRAnalysis(program->module_op()))
.first;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

这里会有不同 id 的情况出现吗

Copy link
Contributor Author

Choose a reason for hiding this comment

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

这里当时设计时和 liujie 讨论根据 program 作为 key 的,当时这里记了一个 todo


return val.defining_op()->name() + "_" + std::to_string(op_id) + "_rst_" +
std::to_string(val_idx);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

这个文件里有些也可以清理掉,GetValueId现在应该也用不到了吧,可以后续PR再删掉

Copy link
Contributor Author

Choose a reason for hiding this comment

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

这个是 zynncg PR 中加的用来debug 的、之前 GetValueId 已经清理过一次了


void VerifySig() {}
};

class IR_API DimOp : public Op<DimOp> {
Copy link
Contributor

Choose a reason for hiding this comment

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

DimOp还需要保留吗

Copy link
Contributor Author

@zhangbopd zhangbopd Jan 19, 2024

Choose a reason for hiding this comment

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

不需要了、本来想下个PR 清理 刚好 PR 冲突了,我继续在这个 PR 中清理吧

TieProductEqualOp,
TieShapeOp,
FuncOp,
RegisterOps<DimOp,
Copy link
Contributor

Choose a reason for hiding this comment

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

这里的其他几个Op是否还有必要保留?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

同上

lanxianghit
lanxianghit previously approved these changes Jan 19, 2024
Copy link
Contributor

@lanxianghit lanxianghit left a comment

Choose a reason for hiding this comment

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

再check一下,如果只是还有些无用代码未清理的问题,可以先合入,再提PR进行清理

@zhangbopd
Copy link
Contributor Author

再check一下,如果只是还有些无用代码未清理的问题,可以先合入,再提PR进行清理

刚好 PR 冲突了,我继续在这个 PR 中清理吧

Copy link
Contributor

@jiahy0825 jiahy0825 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@XiaoguangHu01 XiaoguangHu01 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 a7c079e into PaddlePaddle:develop Jan 19, 2024
29 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.

4 participants