Skip to content

Conversation

@pengcheng888
Copy link
Contributor

目标版本
main

功能描述
(1)添加python的rope的测试
(2)添加python的embeddding的实现和测试

测试结果

embedding_cpu

Screenshot from 2025-11-12 14-16-00

embedding_nvidia
Screenshot from 2025-11-12 14-16-08

rope_nvidia
Screenshot from 2025-11-12 14-16-28

rope_cpu
Screenshot from 2025-11-12 14-16-39

return inputs_embeds;
}

void embedding_(Tensor out, Tensor input, Tensor weight) {
Copy link
Contributor Author

@pengcheng888 pengcheng888 Nov 17, 2025

Choose a reason for hiding this comment

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

python的接口中,input只能是cpu类型。 在之前测试中,如果input是gpu,在c++中to到gpu上的话,会报pin_memory相关的警告,然后程序就段错误了。

Copy link
Collaborator

Choose a reason for hiding this comment

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

文件名应该时rope吧

Copy link
Contributor Author

Choose a reason for hiding this comment

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

已修改

# Test Case 1: Out-of-place (return value)
test_cases.append(
TestCase(
inputs=[x_spec, sin_table_spec, cos_table_spec],
Copy link
Collaborator

Choose a reason for hiding this comment

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

测例里sin和cos都是随机值吗

Copy link
Contributor Author

Choose a reason for hiding this comment

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

是的,用随机值测试的。当时相了一下,发现现在测试脚本,好像不太容易指定变量,就用随机数值了

@PanZezhong1725 PanZezhong1725 merged commit e6fbcc8 into InfiniTensor:main Nov 17, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[DEV] 添加python的rope的测试, embeddding的实现和测试

3 participants