[Bug fix] Fix missing instantiation of isfinite/isinf/isnan kernels on Windows#75817
Merged
luotao1 merged 1 commit intoPaddlePaddle:developfrom Oct 14, 2025
Merged
Conversation
…n Windows 三处改动都是为了解决 Windows 平台上 `isfinite` 系列算子在编译/链接阶段缺失实例化的问题,让 CPU/GPU 的显式模板实例都能正常生成: - isfinite_kernel.h:在 `_WIN32` 分支补充了 `INSTANTIATE_ISFINITE_KERNEL_Isfinite` 宏定义。之前只有 `isinf` 和 `isnan` 的显式实例化宏,Windows 链接时会缺少 `IsfiniteKernel` 的实例。 - isfinite_kernel.cc:在 Windows 条件编译区新增了 `IsfiniteKernel` 对各数据类型(包含 float/bfloat16 与复数)的显式模板实例化,避免 Windows 链接缺符号;顺带补齐了 `Isinf/Isnan` 的复数类型实例。 - isfinite_kernel.cu:同样在 Windows 分支补充了 GPU 侧 `IsfiniteKernel` 的显式实例化,确保在 GPU 后端也不会漏掉相应符号。 整体效果是在 Windows 编译器不会自动生成这些内联模板的场景下,手动提供所需实例,消除 `isfinite`/`isinf`/`isnan` 内核的链接缺失问题。
|
你的PR提交成功,感谢你对开源项目的贡献! |
Contributor
Author
|
/re-run all-failed |
1 similar comment
Contributor
Author
|
/re-run all-failed |
Contributor
|
#75684 (review) approved by @swgu98 |
zyfncg
approved these changes
Oct 14, 2025
Contributor
Author
|
/re-run all-failed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

PR Category
Operator Mechanism
PR Types
Bug fixes
Description
三处改动都是为了解决 Windows 平台上
isfinite系列算子在编译/链接阶段缺失实例化的问题,让 CPU/GPU 的显式模板实例都能正常生成:_WIN32分支补充了INSTANTIATE_ISFINITE_KERNEL_Isfinite宏定义。之前只有isinf和isnan的显式实例化宏,Windows 链接时会缺少IsfiniteKernel的实例。IsfiniteKernel对各数据类型(包含 float/bfloat16 与复数)的显式模板实例化,避免 Windows 链接缺符号;顺带补齐了Isinf/Isnan的复数类型实例。IsfiniteKernel的显式实例化,确保在 GPU 后端也不会漏掉相应符号。整体效果是在 Windows 编译器不会自动生成这些内联模板的场景下,手动提供所需实例,消除
isfinite/isinf/isnan内核的链接缺失问题。从以下PR拆分出来: