-
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
Support selected rows new ir #54987
Merged
phlrain
merged 38 commits into
PaddlePaddle:develop
from
phlrain:support_selected_rows_new_ir
Jul 12, 2023
Merged
Support selected rows new ir #54987
Changes from all commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
e7514d3
refine program translator
kangguangli 3dca434
fix warning: not override
kangguangli fbc5d68
fix bug
kangguangli beeb0b3
Merge branch 'develop' of github.com:PaddlePaddle/Paddle into refacto…
kangguangli 7fe49a2
merge new modifications
kangguangli 4ba7532
modify by reviews
kangguangli c1b0b2c
resolve conflicts
kangguangli 2eb2ad8
resolve conflicts
kangguangli db54984
fix
kangguangli 0c8983f
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
kangguangli 5344ea9
fix
kangguangli a8bc7f2
update
phlrain 2526698
Merge commit 'refs/pull/54719/head' of https://github.com/PaddlePaddl…
phlrain 49f5666
support selected rows
phlrain 0ebd6c2
update
phlrain fd06a07
add selectrows
zhangbo9674 f21c840
fix bug
zhangbo9674 960f14b
add ut
zhangbo9674 36d9457
refine code
zhangbo9674 742d6e3
sovle conflict
zhangbo9674 bf7d2a1
solve conflict
zhangbo9674 7b75794
refien code
zhangbo9674 eb41565
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
phlrain c33099a
Merge commit 'refs/pull/55041/head' of https://github.com/PaddlePaddl…
phlrain 6bf20a2
update
phlrain 2c50f8d
update
phlrain 5c18036
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
phlrain 3b6efd6
support selected rows
phlrain f5ee2c9
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
phlrain 584537d
support selected rows
phlrain 9dd2eeb
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
phlrain be347c2
support dense tensor
phlrain c13179d
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
phlrain e16139e
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
phlrain 4d80947
remove useless code
phlrain 3a6016a
polish code
phlrain 078b685
remote standalone executor test
phlrain c2e1641
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
phlrain File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -20,9 +20,7 @@ | |||||
|
||||||
namespace paddle { | ||||||
namespace dialect { | ||||||
/// | ||||||
/// \brief Define built-in parametric types. | ||||||
/// | ||||||
|
||||||
class AllocatedDenseTensorType : public ir::Type { | ||||||
public: | ||||||
using Type::Type; | ||||||
|
@@ -64,7 +62,49 @@ class AllocatedDenseTensorType : public ir::Type { | |||||
const size_t &offset() const; | ||||||
}; | ||||||
|
||||||
class AllocatedSelectedRowsType : public ir::Type { | ||||||
public: | ||||||
using Type::Type; | ||||||
|
||||||
DECLARE_TYPE_UTILITY_FUNCTOR(AllocatedSelectedRowsType, | ||||||
AllocatedSelectedRowsTypeStorage); | ||||||
|
||||||
static AllocatedSelectedRowsType get(ir::IrContext *ctx, | ||||||
const phi::Place &place, | ||||||
dialect::SelectedRowsType type) { | ||||||
return ir::TypeManager::template get<AllocatedSelectedRowsType>( | ||||||
ctx, place, type); | ||||||
} | ||||||
|
||||||
static AllocatedSelectedRowsType get(ir::IrContext *ctx, | ||||||
const phi::Place &place, | ||||||
const ir::Type &dtype, | ||||||
const phi::DDim &dims, | ||||||
const phi::DataLayout &layout, | ||||||
const phi::LoD &lod, | ||||||
size_t offset) { | ||||||
dialect::SelectedRowsType dense_tensor_type = | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
这里copy后没有改过来吧? |
||||||
dialect::SelectedRowsType::get(ctx, dtype, dims, layout, lod, offset); | ||||||
|
||||||
return ir::TypeManager::template get<AllocatedSelectedRowsType>( | ||||||
ctx, place, dense_tensor_type); | ||||||
} | ||||||
|
||||||
const phi::Place &place() const; | ||||||
|
||||||
const ir::Type &dtype() const; | ||||||
|
||||||
const phi::DDim &dims() const; | ||||||
|
||||||
const phi::DataLayout &data_layout() const; | ||||||
|
||||||
const phi::LoD &lod() const; | ||||||
|
||||||
const size_t &offset() const; | ||||||
}; | ||||||
|
||||||
} // namespace dialect | ||||||
} // namespace paddle | ||||||
|
||||||
IR_DECLARE_EXPLICIT_TYPE_ID(paddle::dialect::AllocatedDenseTensorType) | ||||||
IR_DECLARE_EXPLICIT_TYPE_ID(paddle::dialect::AllocatedSelectedRowsType) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
对于size_t、int、double这种数据类型,直接返回copy就可以,在函数里也是直接传值的