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

[Move selected_rows PR #5] VisitDataType use Pten::DataType #39236

Merged

Conversation

veyron95
Copy link
Contributor

@veyron95 veyron95 commented Jan 26, 2022

PR types

Others

PR changes

Others

Describe

A series of jobs where selected_rows moves from Fluid to Pten.
There are 5 PR to complete the migration work in expected.

PR 1: Renamed selected_rows.* to selected_rows_utils.* PR39037
PR 2: Added selected_rows.* and rw_lock.h to Pten PR39087
PR 3: Change the relationship of [include/Cmake]. PR39128

  1. Delete Class SelectedRows in selected_rows_utils.* under Fluid, leaving only a few serialization methods;
  2. Modify the [include/cmake] relationship;
  3. Use pten::SelectedRows in Fluid;
  4. Remove rw_lock.h, rw_lock_test.cc in Fluid;

PR 4: Selected_Rows inherits from TensorBase. PR39162

This is PR5:

PR 5: VisitDataType use Pten::DataType
(Part of func in framework/data_type.h are rewritten in pten/core/utils/data_type.h)

  1. paddle::framework::VisitDataType ---> pten::VisitDataType
  2. pten::VisitDataType use Pten::DataType in pten/core/utils/data_type.h
  3. Without including fluid/framework/framework.pb.h in pten/core/utils/data_type.h
  4. Include pten/core/utils/data_type.h in pten/core/selected_rows.cc instead of including fluid/framework/data_type.h

@paddle-bot-old
Copy link

Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

callback, ::paddle::platform::complex<double>, DataType::COMPLEX128);

template <typename Visitor>
inline void VisitDataType(pten::DataType type, Visitor visitor) {
Copy link
Contributor

Choose a reason for hiding this comment

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

同步一下,这个VisitDataType我们认为写得不是很直观,之前讨论过说希望用switch-case的形式替换掉的,参考pten/api/ext/dispatch.h,不过短时间内好像也比较困难;

此外,后续如果还是有其他kernel使用,我们可能会考虑把这段实现直接放到common/data_type.h中

Copy link
Contributor Author

Choose a reason for hiding this comment

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

好的,后续再替换或者进一步优化,多谢。

@veyron95 veyron95 closed this Jan 26, 2022
@veyron95 veyron95 reopened this Jan 26, 2022
@veyron95 veyron95 merged commit 42a0947 into PaddlePaddle:develop Jan 26, 2022
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