Skip to content

[Bug]top_p_sampling 算子精度问题 #59485

@wj-Mcat

Description

@wj-Mcat

bug描述 Describe the Bug

  • 安装最新版本的 paddle

直接在官网上面安装就行了,尽量保证一周之内的 paddle 版本: https://www.paddlepaddle.org.cn/install/quick?docurl=/documentation/docs/zh/develop/install/pip/linux-pip.html

  • 复现代码
import paddle
inputs = paddle.randn([3, 10000], dtype='float32')
tokens_res = []
for i in range(10):
    # 这里加不加 seed 作用都是一样的
    _, next_tokens = paddle.tensor.top_p_sampling(inputs, paddle.full([3,1], 0.9, dtype="float32"))
    tokens_res.append(next_tokens.reshape([-1]).numpy().tolist())

for i in range(1, len(tokens_res)):
    assert tokens_res[i] == tokens_res[i-1]

其他补充信息 Additional Supplementary Information

No response

Metadata

Metadata

Labels

PFCCPaddle Framework Contributor Club,https://github.com/PaddlePaddle/community/tree/master/pfccstatus/close已关闭type/bug-fixedbug已修复

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions