Skip to content

[CPU] 多个算子在 float16 输入下报 NotFound: kernel not registered #78461

@tingPetty

Description

@tingPetty

bug描述 Describe the Bug

在 Windows CPU 环境下,多个 Paddle 算子在 float16 输入时直接报错:
RuntimeError: (NotFound) The kernel with key (CPU, Undefined(AnyLayout), float16) of kernel <op> is not registered.,然而文档中显示它们是支持 float16 类型的。
同一组输入在对照框架(MindSpore)可执行成功,且本仓库最小复现脚本均出现 REPRODUCED_PADDLE_ERROR_ONLY=True

附上涉及脚本(可逐个运行):
pd_error_only_candidate_038_baddbmm.py
pd_error_only_candidate_084_cumsum.py
pd_error_only_candidate_150_logaddexp.py
pd_error_only_candidate_210_multiply.py
pd_error_only_candidate_305_prod.py
pd_error_only_candidate_314_remainder.py
pd_error_only_candidate_360_sinc.py
pd_error_only_candidate_367_square.py

# 最小可复现代码。Sample code to reproduce the problem.
import numpy as np
import paddle

print("paddle:", paddle.__version__)

x = paddle.to_tensor(np.ones((2, 3), dtype=np.float16))
y = paddle.to_tensor(np.ones((2, 3), dtype=np.float16))

# 示例算子之一:multiply(其它算子见上面的脚本列表)
out = paddle.multiply(x, y)
print(out)
带有完整回溯的报错信息:
RuntimeError: (NotFound) The kernel with key (CPU, Undefined(AnyLayout), float16)
of kernel `multiply` is not registered. Selected wrong DataType `float16`.
Paddle support following DataTypes: complex64, bool, bfloat16, complex128,
float32, int32, float64, int64.

其他补充信息 Additional Supplementary Information

  • 复现环境:Windows 10,Python 3.10.18,Paddle 3.2.0,CPU。
  • 期望行为:若 CPU 不支持 float16,应在 API 文档/错误信息中统一且提前给出明确约束;若按设计应支持,则应补齐 kernel。

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions