Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【Hackathon 7th No.36】为 Paddle 代码转换工具新增 API 转换规则(第 3 组)-part #484

Merged
merged 28 commits into from
Oct 12, 2024

Conversation

enkilee
Copy link
Contributor

@enkilee enkilee commented Sep 25, 2024

PR Docs

PaddlePaddle/docs#6890

PR APIs

torch.blackman_window
torch.hamming_window
torch.hann_window
torch.get_num_threads
torch.set_num_threads
torch.get_num_interop_threads
torch.set_num_interop_threads
torch.frombuffer

Copy link

paddle-bot bot commented Sep 26, 2024

Thanks for your contribution!

paconvert/api_matcher.py Outdated Show resolved Hide resolved
paconvert/api_matcher.py Outdated Show resolved Hide resolved
paconvert/api_matcher.py Outdated Show resolved Hide resolved
paconvert/api_matcher.py Show resolved Hide resolved
paconvert/api_matcher.py Show resolved Hide resolved
@zhwesky2010
Copy link
Collaborator

@enkilee CI不通过,请自查问题

Copy link
Collaborator

@zhwesky2010 zhwesky2010 left a comment

Choose a reason for hiding this comment

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

丰富下测试case并自查一遍,以下四种情况的测试case必须全部包含:

  1. 传入所有参数且全部指定关键字
  2. 传入所有参数且全部不指定关键字
  3. 改变关键字顺序
  4. 默认参数均不指定

paconvert/api_matcher.py Outdated Show resolved Hide resolved
tests/test_frombuffer.py Show resolved Hide resolved
tests/test_frombuffer.py Outdated Show resolved Hide resolved
paconvert/api_matcher.py Outdated Show resolved Hide resolved
paconvert/api_matcher.py Outdated Show resolved Hide resolved
paconvert/api_matcher.py Outdated Show resolved Hide resolved
tests/test_blackman_window.py Outdated Show resolved Hide resolved
@zhwesky2010
Copy link
Collaborator

zhwesky2010 commented Oct 11, 2024

同另一个PR,现在最大的问题是通不过数值检查,这个反映了 映射存在Bug 或者 API自身存在Bug

需要给出明确的结论,最终以通过数值检查为准。

@enkilee
Copy link
Contributor Author

enkilee commented Oct 11, 2024

恩,找到问题了, blackman没法改,hamming和hann都得改。这边fftbins=perodic,ReverseMatcher在前面那个pr用。但是hann在float32时精度得调低。

@zhwesky2010
Copy link
Collaborator

zhwesky2010 commented Oct 11, 2024

恩,找到问题了, blackman没法改,hamming和hann都得改。这边fftbins=perodic,ReverseMatcher在前面那个pr用。但是hann在float32时精度得调低。

精度验证适当调低阈值是可以的。但结果完全对不上就得排查是 API自身Bug 还是 API转换的Bug 了。

@enkilee
Copy link
Contributor Author

enkilee commented Oct 12, 2024

恩,找到问题了, blackman没法改,hamming和hann都得改。这边fftbins=perodic,ReverseMatcher在前面那个pr用。但是hann在float32时精度得调低。

精度验证适当调低阈值是可以的。但结果完全对不上就得排查是 API自身Bug 还是 API转换的Bug 了。

blackman原因写在 479 了。
get_num_interop_threads 和 get_num_threads:
pytorch result is 4, but paddle result is 1。
方法不同,且paddle默认CPU_NUM为1。

Copy link
Collaborator

@zhwesky2010 zhwesky2010 left a comment

Choose a reason for hiding this comment

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

LGTM

@zhwesky2010 zhwesky2010 merged commit da330a9 into PaddlePaddle:master Oct 12, 2024
7 checks passed
@luotao1 luotao1 changed the title 【Hackathon 7th No.36】为 Paddle 代码转换工具新增 API 转换规则(第 3 组)PART 2 【Hackathon 7th No.36】为 Paddle 代码转换工具新增 API 转换规则(第 3 组)-part Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor External developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants