PaddlePaddle / PaddlePaddle/Paddle
[DeviceId] GetCurrentDeviceId 和 _global_expected_place_ 是否完全无关?
Open
@zhangting2020 is already working on this.
Since Apr 15, 2022.
status/following-up
type/question
- Dominant language
- C++
- Stars
- 24.1k
- Forks
- 6k
- Avg merge
- 4d 17h
- Merged PRs (30d)
- 60
Description
请提出你的问题 Please ask your question
paddle 目前的 place 是一个 python 端全局的对象。
https://github.com/PaddlePaddle/Paddle/blob/develop/python/paddle/fluid/framework.py#L517-L520
def _set_expected_place(place):
global _global_expected_place_
_global_expected_place_ = place
_set_dygraph_tracer_expected_place(place)
int GetCurrentDeviceId() {
int device_id;
PADDLE_ENFORCE_GPU_SUCCESS(cudaGetDevice(&device_id));
return device_id;
}
中的 GetCurrentDeviceId 是不是完全没有关联。
C++中如何获取当前place的 device id.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.