Skip to content

Conversation

@HeyDavid633
Copy link
Contributor

PR Category

Operator Mechanism

PR Types

Bug fixes

Description

修复 paddle.nn.functional.ctc_loss 的大Tensor问题

该实现调用了第三方库 warp-ctc 其中关于 kernel 启动的配置 Paddle/third_party/warpctc/include/detail/gpu_ctc.h 也决定了该API不支持大Tensor,属于第三方库不支持的范围。对于测试case的修改见 PFCCLab/PaddleAPITest#432

在启动 Kernel 之前,对输入的张量尺寸进行检查,并抛出非法错误

PADDLE_ENFORCE_LT( num_sequences * sequence_width * max_sequence_length, std::numeric_limits<int>::max(), errors::InvalidArgument( "The total number of elements in Input(Logits) should be less than " "%d, " "but received %d", std::numeric_limits<int>::max(), num_sequences * sequence_width * max_sequence_length));
@CLAassistant
Copy link

CLAassistant commented Jul 24, 2025

CLA assistant check
All committers have signed the CLA.

@paddle-bot
Copy link

paddle-bot bot commented Jul 24, 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.

@paddle-bot paddle-bot bot added the contributor External developers label Jul 24, 2025
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

@HeyDavid633 HeyDavid633 reopened this Jul 28, 2025
@lshpku lshpku merged commit 05559e1 into PaddlePaddle:develop Jul 28, 2025
86 of 89 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor External developers

4 participants