-
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
[PTEN] Add pten::Place data structure. #38844
Conversation
Thanks for your contribution! |
paddle/pten/core/place.cc
Outdated
} | ||
|
||
std::string Place::DebugString() const { | ||
std::string str{"Place:{type = "}; |
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.
Better format as "Place(cpu), Place(gpu:0), etc" , to be consistent with paddle.set_device
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.
Now the format is "Place(cpu), Place(gpu:0), Place(gpu pinned)". Thanks
paddle/pten/core/place.cc
Outdated
@@ -0,0 +1,60 @@ | |||
/* Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved. |
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.
2022
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.
done
paddle/pten/core/place.h
Outdated
namespace pten { | ||
|
||
enum class AllocationType : int8_t { | ||
kUndef = 0, |
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.
之前和晓伟讨论过,这里需要和其他基础数据结构data type, layout命名风格保持统一,采用全大写的命名风格,因为这个是对外API,对外用户可能并不清楚k前缀的含义
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.
done
paddle/pten/core/place.h
Outdated
@@ -0,0 +1,112 @@ | |||
/* Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved. |
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.
2022
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.
done
paddle/pten/core/place.h
Outdated
See the License for the specific language governing permissions and | ||
limitations under the License. */ | ||
|
||
#pragma once |
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.
为什么place不需要在common中,API层面使用什么place?
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.
done
paddle/pten/tests/core/test_place.cc
Outdated
@@ -0,0 +1,51 @@ | |||
/* Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved. |
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.
2022
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.
done
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.
LGTM(place数据结构将要全面替换,把不需要的单测删掉了)
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.
LGTM
PR types
Others
PR changes
Others
Describe
Add pten::Place data structure.
Place consists of enum and device_id.