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

【PIR API adaptor No.260、274-278、292】 Migrate some ops into pir #60172

Merged
merged 6 commits into from
Dec 22, 2023

Conversation

MarioLulab
Copy link
Contributor

@MarioLulab MarioLulab commented Dec 20, 2023

PR types

Others

PR changes

Others

Description

任务 issue: #58067

PIR API 推全升级

  1. paddle.nn.Mish 迁移升级至 pir,并更新单测,单测覆盖率(3/4)

TODO: test/legacy_test/test_activation_op.py 文件下的 TestMishAPI.test_errors 单测未适配,因为暂不支持

  1. paddle.audio.features.MFCC 迁移升级至 pir,单测覆盖率(0/0)

NOTE: 单测已从 test/legacy_test/CMakeLists.txt 中移除,故只迁移 api,未迁移单测

  1. paddle.audio.features.MelSpectrogram 迁移升级至 pir,单测覆盖率(0/0)

NOTE: 单测已从 test/legacy_test/CMakeLists.txt 中移除,故只迁移 api,未迁移单测

  1. paddle.audio.functional.mel_to_hz 迁移升级至 pir,并更新单测,单测覆盖率(1/1)

  2. paddle.audio.functional.hz_to_mel 迁移升级至 pir,并更新单测,单测覆盖率(1/1)

  3. paddle.audio.functional.mel_frequencies 迁移升级至 pir,并更新单测,单测覆盖率(0/1)
    发现问题: test_audio_function_mel_static 单测加上 @test_with_pir_api 后出现精度问题,旧ir静态图未出现精度问题,此问题后续提 pr 去 fix,先取消 pir 模式的单测。报错栈

Mismatched elements: 11 / 256 (4.3%)
Max absolute difference: 0.00182431
Max relative difference: 1.82431386e-07
 x: array([5.000e-01, 1.318e+01, 2.585e+01, 3.853e+01, 5.120e+01, 6.388e+01,
       7.655e+01, 8.923e+01, 1.019e+02, 1.146e+02, 1.273e+02, 1.399e+02,
       1.526e+02, 1.653e+02, 1.780e+02, 1.906e+02, 2.033e+02, 2.160e+02,...
 y: array([5.000e-01, 1.318e+01, 2.585e+01, 3.853e+01, 5.120e+01, 6.388e+01,
       7.655e+01, 8.923e+01, 1.019e+02, 1.146e+02, 1.273e+02, 1.399e+02,
       1.526e+02, 1.653e+02, 1.780e+02, 1.906e+02, 2.033e+02, 2.160e+02,...

======================================================================
FAIL: test_audio_function_mel_static_32 (__main__.TestAudioFuncitons)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/parameterized/parameterized.py", line 620, in standalone_func
    return func(*(a + p.args), **p.kwargs, **kw)
  File "/luq/docker/paddle-docker/Paddle/build/python/paddle/pir_utils.py", line 115, in impl
    func(*args, **kwargs)
  File "test_audio_functions.py", line 179, in test_audio_function_mel_static
    np.testing.assert_almost_equal(
  File "/usr/local/lib/python3.8/dist-packages/numpy/testing/_private/utils.py", line 583, in assert_almost_equal
    return assert_array_almost_equal(actual, desired, decimal, err_msg)
  File "/usr/local/lib/python3.8/dist-packages/numpy/testing/_private/utils.py", line 1046, in assert_array_almost_equal
    assert_array_compare(compare, x, y, err_msg=err_msg, verbose=verbose,
  File "/usr/local/lib/python3.8/dist-packages/numpy/testing/_private/utils.py", line 844, in assert_array_compare
    raise AssertionError(msg)
AssertionError: 
Arrays are not almost equal to 3 decimals

Mismatched elements: 11 / 256 (4.3%)
Max absolute difference: 0.00182431
Max relative difference: 1.82431386e-07
 x: array([1.000e+00, 1.367e+01, 2.635e+01, 3.902e+01, 5.169e+01, 6.437e+01,
       7.704e+01, 8.971e+01, 1.024e+02, 1.151e+02, 1.277e+02, 1.404e+02,
       1.531e+02, 1.658e+02, 1.784e+02, 1.911e+02, 2.038e+02, 2.165e+02,...
 y: array([1.000e+00, 1.367e+01, 2.635e+01, 3.902e+01, 5.169e+01, 6.437e+01,
       7.704e+01, 8.971e+01, 1.024e+02, 1.151e+02, 1.277e+02, 1.404e+02,
       1.531e+02, 1.658e+02, 1.784e+02, 1.911e+02, 2.038e+02, 2.165e+02,...
  1. paddle.audio.functional.power_to_db 迁移升级至 pir,并更新单测,单测覆盖率(1/1)

Copy link

paddle-bot bot commented Dec 20, 2023

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@paddle-bot paddle-bot bot added the contributor External developers label Dec 20, 2023
@MarioLulab MarioLulab changed the title 【PIR API adaptor No.274-278】 Migrate some ops into pir 【PIR API adaptor No.260、274-278】 Migrate some ops into pir Dec 21, 2023
@MarioLulab MarioLulab changed the title 【PIR API adaptor No.260、274-278】 Migrate some ops into pir 【PIR API adaptor No.260、274-278、292】 Migrate some ops into pir Dec 21, 2023
@0x45f 0x45f merged commit 6934632 into PaddlePaddle:develop Dec 22, 2023
29 checks passed
@MarioLulab MarioLulab deleted the luqi/pir_api_274to278 branch December 26, 2023 07:45
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.

None yet

2 participants