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

【CINN】Add device query components for cinn #58988

Merged
merged 3 commits into from
Nov 17, 2023

Conversation

Courtesy-Xs
Copy link
Contributor

PR types

Others

PR changes

Others

Description

pcard-72718
This PR add device-query component for CINN

Copy link

paddle-bot bot commented Nov 14, 2023

你的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.

@@ -0,0 +1,26 @@
// Copyright (c) 2021 CINN Authors. All Rights Reserved.
Copy link
Contributor

@ZzSean ZzSean Nov 15, 2023

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.

Done

class NVGPUDevInfo : public DevInfoBase {
public:
explicit NVGPUDevInfo(int device) : device_num_(device) {
#ifdef CINN_WITH_CUDA
Copy link
Contributor

@ZzSean ZzSean Nov 16, 2023

Choose a reason for hiding this comment

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

该文件内是nvgpu的device信息,感觉可以在编译时期就确定此文件是否编译(-DCINN_WITH_CUDA=ON or OFF),不用到处加这个宏判断?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

不加编不过。。。

int device_num = 0);

Target::Arch arch_;
int device_num_;
Copy link
Contributor

Choose a reason for hiding this comment

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

考虑多卡这里是不是应该搞个vector

Copy link
Contributor Author

Choose a reason for hiding this comment

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

主要混合设备下不同架构的接口不同,如果异构的情况下,几个设备放在一块感觉Get的时候会比较乱,如果是同种设备,get其中一个也就OK了,所以就没搞这事

Copy link
Contributor

@ZzSean ZzSean left a comment

Choose a reason for hiding this comment

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

LGTM

@Courtesy-Xs Courtesy-Xs merged commit c9fa670 into PaddlePaddle:develop Nov 17, 2023
28 checks passed
SecretXV pushed a commit to SecretXV/Paddle that referenced this pull request Nov 28, 2023
* add device query components for cinn

* fix include file path bug

* refactor code
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.

2 participants