Skip to content

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

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

4 participants