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

[Phi] Migrate logical_and/or/not/xor into Phi #39942

Merged
merged 3 commits into from
Mar 1, 2022

Conversation

Aurelius84
Copy link
Contributor

PR types

Others

PR changes

Others

Describe

[Phi] Migrate logical_and/or/not/xor into Phi

@paddle-bot-old
Copy link

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

YuanRisheng
YuanRisheng previously approved these changes Feb 25, 2022

} // namespace phi

#define REGISTER_LOGICAL_CUDA_KERNEL(logical_and, func_type) \
Copy link
Contributor

Choose a reason for hiding this comment

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

这里的宏定义参数命名 logical_and 需要改为 kernel_name?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

这里是因为我们CMake里有一个kernel的匹配逻辑,会去匹配第一个有效kernel_name,所以这里是故意这么写的


} // namespace phi

#define REGISTER_LOGICAL_CPU_KERNEL(logical_and, func_type) \
Copy link
Contributor

Choose a reason for hiding this comment

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

这里的宏定义参数命名 logical_and 需要改为 kernel_name?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

如上

Copy link
Contributor

@MingMingShangTian MingMingShangTian left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -55,7 +55,7 @@ def setUp(self):

def test_dygraph(self):
for place in self.places:
paddle.disable_static(place)
paddle.disable_static()
Copy link
Contributor

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.

paddle.disable_static(place) 根据不同的place多次调用时,在除了第一次以外的调用,并不会根据place来切换tracer执行的place。这里 place的取值为cpu, gpu,导致第二次for循环本来应该用gpu的,但却使用了CPU。

@Aurelius84 Aurelius84 merged commit 8c23797 into PaddlePaddle:develop Mar 1, 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.

4 participants