-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
[XPU][PHI Kernels] bind reduce_max_int64 set_value_bool sin_grad_fp32 cos_grad_fp32 for XPU #55375
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
❌ The PR is not created using PR's template. You can refer to this Demo. |
test/xpu/test_set_value_op_xpu.py
Outdated
@@ -171,6 +173,8 @@ class XPUTestSetValueItemSliceInWhile(XPUTestSetValueApi): | |||
def set_dtype(self): | |||
if self.in_type == np.float16: | |||
self.dtype = "float32" | |||
elif self.in_type == np.bool_: | |||
self.dtyper = "bool" |
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.
typo
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
@@ -57,6 +57,8 @@ def set_value(self): | |||
|
|||
def set_dtype(self): | |||
self.dtype = self.in_type | |||
if self.in_type == np.bool_: |
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.
没看明白是怎么只跑fp32的?
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.
@@ -166,7 +169,7 @@ void SetValueImpl(const Context& dev_ctx, | |||
} | |||
} | |||
|
|||
// Because strided_slice does not support the case of stride < 0 | |||
// Because strided_slice_view_update does not support the case of stride < 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.
这块注释加到下面filp那里吧
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
value_dims_vec.end(), | ||
ext_value_dims_vec.begin() + (max_dims - value_dims.size())); | ||
|
||
r = xpu::broadcast<XPUType>(dev_ctx.x_context(), |
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.
这里的broadcast以及上面slice_dims_for_assign的处理最好封装在XPUElementwise函数里面,然后以functor的形式传进去,增加代码的复用程度
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
self.dtype = "float32" | ||
else: | ||
self.dtype = self.in_type | ||
self.dtype = "float32" |
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.
这里为什么强制让类型是float32?
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.
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
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已合入Paddle库,请关注后续测试结果。 |
… cos_grad_fp32 for XPU (PaddlePaddle#55375) * bind kernels for xpu * format code * format code * 0d support for set value * refine set_value
… cos_grad_fp32 for XPU (PaddlePaddle#55375) * bind kernels for xpu * format code * format code * 0d support for set value * refine set_value
PR types
New features
PR changes
OPs
Description