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.192】Migrate paddle.searchsorted into pir #59387

Closed
wants to merge 2 commits into from

Conversation

Olive-2019
Copy link

@Olive-2019 Olive-2019 commented Nov 27, 2023

PR types

Others

PR changes

APIs

Description

#58067
PIR API 推全升级
将算子迁移升级至 pir,并更新单测
paddle.searchsorted(0/7)

Copy link

paddle-bot bot commented Nov 27, 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 Nov 27, 2023
@Olive-2019 Olive-2019 marked this pull request as draft November 27, 2023 07:55
@Olive-2019 Olive-2019 closed this Nov 28, 2023
@Olive-2019 Olive-2019 reopened this Nov 28, 2023
@Olive-2019 Olive-2019 marked this pull request as ready for review November 28, 2023 02:33
@Olive-2019
Copy link
Author

失败单测

  1. test_check_output (main.TestSearchSorted)
  2. test_static_api (main.TestSearchSortedAPI)
  3. test_check_output (main.TestSearchSortedOp1)
  4. test_check_output (main.TestSearchSortedOp2)
  5. test_check_output (main.TestSearchSortedOp3)
  6. test_check_output (main.TestSearchSortedOp4)
  7. test_check_output (main.TestSearchSortedOp5)

报错信息示例

======================================================================
ERROR: test_check_output (__main__.TestSearchSorted)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_searchsorted_op.py", line 45, in test_check_output
    self.check_output(check_pir=True)
  File "/home/aistudio/Paddle/test/legacy_test/op_test.py", line 2762, in check_output
    check_auto_parallel=check_auto_parallel,
  File "/home/aistudio/Paddle/test/legacy_test/op_test.py", line 2622, in check_output_with_place
    pir_checker.check()
  File "/home/aistudio/Paddle/test/legacy_test/op_test.py", line 2187, in check
    self.calculate_output()
  File "/home/aistudio/Paddle/test/legacy_test/op_test.py", line 2373, in calculate_output
    pir_outs = self.op_test._calc_pir_output(place)
  File "/home/aistudio/Paddle/test/legacy_test/op_test.py", line 1379, in _calc_pir_output
    ret_tuple = self.python_api(*args)
  File "/home/aistudio/.local/lib/python3.7/site-packages/paddle/tensor/search.py", line 1157, in searchsorted
    out = helper.create_variable_for_type_inference(dtype=out_type)
  File "/home/aistudio/.local/lib/python3.7/site-packages/paddle/base/layer_helper_base.py", line 476, in create_variable_for_type_inference
    stop_gradient=stop_gradient,
  File "/home/aistudio/.local/lib/python3.7/site-packages/paddle/base/framework.py", line 4223, in create_var
    var = Variable(block=self, *args, **kwargs)
  File "/home/aistudio/.local/lib/python3.7/site-packages/paddle/base/framework.py", line 1514, in __init__
    self.desc.set_dtype(dtype)
TypeError: set_dtype(): incompatible function arguments. The following argument types are supported:
    1. (self: paddle.base.libpaddle.VarDesc, arg0: paddle::framework::proto::VarType_Type) -> None

Invoked with: <paddle.base.libpaddle.VarDesc object at 0x7f391f0a97f0>, <DataType.INT64: 9>

@luotao1 luotao1 added the HappyOpenSource 快乐开源活动issue与PR label Nov 29, 2023
@MarioLulab
Copy link
Contributor

失败单测

  1. test_check_output (main.TestSearchSorted)
  2. test_static_api (main.TestSearchSortedAPI)
  3. test_check_output (main.TestSearchSortedOp1)
  4. test_check_output (main.TestSearchSortedOp2)
  5. test_check_output (main.TestSearchSortedOp3)
  6. test_check_output (main.TestSearchSortedOp4)
  7. test_check_output (main.TestSearchSortedOp5)

报错信息示例

======================================================================
ERROR: test_check_output (__main__.TestSearchSorted)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_searchsorted_op.py", line 45, in test_check_output
    self.check_output(check_pir=True)
  File "/home/aistudio/Paddle/test/legacy_test/op_test.py", line 2762, in check_output
    check_auto_parallel=check_auto_parallel,
  File "/home/aistudio/Paddle/test/legacy_test/op_test.py", line 2622, in check_output_with_place
    pir_checker.check()
  File "/home/aistudio/Paddle/test/legacy_test/op_test.py", line 2187, in check
    self.calculate_output()
  File "/home/aistudio/Paddle/test/legacy_test/op_test.py", line 2373, in calculate_output
    pir_outs = self.op_test._calc_pir_output(place)
  File "/home/aistudio/Paddle/test/legacy_test/op_test.py", line 1379, in _calc_pir_output
    ret_tuple = self.python_api(*args)
  File "/home/aistudio/.local/lib/python3.7/site-packages/paddle/tensor/search.py", line 1157, in searchsorted
    out = helper.create_variable_for_type_inference(dtype=out_type)
  File "/home/aistudio/.local/lib/python3.7/site-packages/paddle/base/layer_helper_base.py", line 476, in create_variable_for_type_inference
    stop_gradient=stop_gradient,
  File "/home/aistudio/.local/lib/python3.7/site-packages/paddle/base/framework.py", line 4223, in create_var
    var = Variable(block=self, *args, **kwargs)
  File "/home/aistudio/.local/lib/python3.7/site-packages/paddle/base/framework.py", line 1514, in __init__
    self.desc.set_dtype(dtype)
TypeError: set_dtype(): incompatible function arguments. The following argument types are supported:
    1. (self: paddle.base.libpaddle.VarDesc, arg0: paddle::framework::proto::VarType_Type) -> None

Invoked with: <paddle.base.libpaddle.VarDesc object at 0x7f391f0a97f0>, <DataType.INT64: 9>

我看 ci 运行是正常的 😄 可以检查一下本地测试代码有没有同步 python/paddle/tensor/search.py 的更改

Copy link
Contributor

@MarioLulab MarioLulab left a comment

Choose a reason for hiding this comment

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

searchsorted api 在 test/legacy_test/test_zero_dim_tensor.py 里的 TestSundryAPIStatic.test_searchsorted 有相关单测,辛苦也适配一下 pir

Copy link
Contributor

Choose a reason for hiding this comment

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

该文件下的 TestSearchSortedError 单测是否支持?如不支持请在 pr 描述里说明一下,方便我们记录问题并后续 fix

@MarioLulab
Copy link
Contributor

MarioLulab commented Dec 12, 2023

请问大佬这个 pr 最近还有空推进吗 ~ 没有的话可以让内部研发接着做啦😃

@Olive-2019
Copy link
Author

请问大佬这个 pr 最近还有空推进吗 ~ 没有的话可以让内部研发接着做啦😃

抱歉抱歉,最近期末事情太多了,可能没空推进了

@MarioLulab
Copy link
Contributor

请问大佬这个 pr 最近还有空推进吗 ~ 没有的话可以让内部研发接着做啦😃

抱歉抱歉,最近期末事情太多了,可能没空推进了

好的没事~ 那我们就在你的代码上继续推进啦 🚀

@MarioLulab
Copy link
Contributor

Done in #60014.
欢迎下次贡献~

@MarioLulab MarioLulab closed this Dec 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor External developers HappyOpenSource 快乐开源活动issue与PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants