Skip to content

Conversation

@ggggxm
Copy link
Contributor

@ggggxm ggggxm commented Jul 22, 2025

PR Category

Operator Mechanism

PR Types

Bug fixes

Description

NDHWC layout的groupnorm kernel修复:

  • 只将h*w相关变量改为int64_t类型,单个C H W D等仍然为int类型,整个kernel逻辑只支持在int范围内的NDHWC参数。
  • 为kernel添加check,不支持的launch configuration拦截报错。
@paddle-bot
Copy link

paddle-bot bot commented Jul 22, 2025

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

@ggggxm
Copy link
Contributor Author

ggggxm commented Jul 28, 2025

/re-run all-failed

std::vector<int64_t> mean_shape_;
std::vector<int64_t> variance_shape_;
GroupNormNDHWCParams<half> params_;
GroupNormNDHWCParams<half, int64_t> params_;
Copy link
Contributor

Choose a reason for hiding this comment

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

为什么只有这个用int64?其他也改成int64会怎么样,如果是CPU端用int64也不影响性能

Comment on lines 329 to 330
grid.x = divUp<int32_t>(params->c, params->cPerBlock);
grid.y = divUp<int64_t>(params->dhw, params->dhwPerBlock);
Copy link
Contributor

@lshpku lshpku Jul 28, 2025

Choose a reason for hiding this comment

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

为什么两个除法一个是int32一个是int64?这两不都是来自同一个params吗,类型应该一样?或者其实不用显式指定模板,如果两个输入的类型一样,它会自己选择的

@ggggxm
Copy link
Contributor Author

ggggxm commented Jul 30, 2025

/re-run all-failed

1 similar comment
@ggggxm
Copy link
Contributor Author

ggggxm commented Jul 30, 2025

/re-run all-failed

Copy link
Contributor

@wanghuancoder wanghuancoder left a comment

Choose a reason for hiding this comment

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

LGTM

@lshpku lshpku merged commit c2a5776 into PaddlePaddle:develop Jul 31, 2025
89 of 92 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants