-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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.161、162】Migrate paddle.vision.ops.nms
paddle.nn.functional.one_hot
into pir
#58735
Conversation
test_nn_functional_hot_op.py 里出现的报错: AssertionError: Detect there is KernelSignature for `one_hot_v2` op, please set the `self.python_api` if you set check_dygraph = True 是因为没有在继承自 OpTest 的单测中添加 python_api 属性,需要在 setUp 中配置一下 self.python_api |
添加之后出现和 test_one_hot_v2_op 一样的报错 1265: .E...EEE
1265: ======================================================================
1265: ERROR: test_check_output (test_nn_functional_hot_op.TestOneHotOp)
1265: ----------------------------------------------------------------------
1265: Traceback (most recent call last):
1265: File "/paddle/build/test/legacy_test/test_nn_functional_hot_op.py", line 49, in test_check_output
1265: self.check_output(check_dygraph=False, check_pir=True)
1265: File "/paddle/build/test/legacy_test/op_test.py", line 2686, in check_output
1265: check_pir=check_pir,
1265: File "/paddle/build/test/legacy_test/op_test.py", line 2548, in check_output_with_place
1265: pir_checker.check()
1265: File "/paddle/build/test/legacy_test/op_test.py", line 2149, in check
1265: self.calculate_output()
1265: File "/paddle/build/test/legacy_test/op_test.py", line 2335, in calculate_output
1265: pir_outs = self.op_test._calc_pir_output(place)
1265: File "/paddle/build/test/legacy_test/op_test.py", line 1330, in _calc_pir_output
1265: ) = self.get_ir_input_attr_dict_and_feed(stop_gradient=True)
1265: File "/paddle/build/test/legacy_test/op_test.py", line 1267, in get_ir_input_attr_dict_and_feed
1265: if OpTestUtils.is_bfloat16_type(tup[1].dtype)
1265: IndexError: list index out of range |
对于one_hot的单测:单测文件内继承自OpTest的单测因为配置了x_lod参数,目前pir的OpTest逻辑还不是支持lod的处理。所以one_hot继承自OpTest的单测先不用适配了,先把继承自unittest.TestCase的单测适配一下~ |
thanks~适配继承unittest.TestCase的单测有报错 1265: ======================================================================
1265: ERROR: test_api_with_depthTensor (test_nn_functional_hot_op.TestOneHotOpApi)
1265: ----------------------------------------------------------------------
1265: Traceback (most recent call last):
1265: File "/paddle/build/python/paddle/pir_utils.py", line 115, in impl
1265: func(*args, **kwargs)
1265: File "/paddle/build/test/legacy_test/test_nn_functional_hot_op.py", line 136, in test_api_with_depthTensor
1265: self._run(num_classes)
1265: File "/paddle/build/test/legacy_test/test_nn_functional_hot_op.py", line 165, in _run
1265: return_numpy=False,
1265: File "/paddle/build/python/paddle/base/executor.py", line 1644, in run
1265: return_numpy=return_numpy,
1265: File "/paddle/build/python/paddle/base/executor.py", line 1947, in _run_pir_impl
1265: scope,
1265: File "/paddle/build/python/paddle/base/executor.py", line 1037, in get_pir_program_and_executor
1265: program, fetch_list=fetch_list, fetch_var_name=fetch_var_name
1265: File "/paddle/build/python/paddle/base/executor.py", line 511, in _add_pir_fetch_ops
1265: global_block, fetch_list, fetch_var_name, fetch_op
1265: File "/paddle/build/python/paddle/base/executor.py", line 430, in has_fetch_operations
1265: "There is a fetch op in Program which will fetch variable that is not belong to fetch_targets."
1265: Exception: There is a fetch op in Program which will fetch variable that is not belong to fetch_targets.
1265:
1265: ======================================================================
1265: FAIL: test_error (test_nn_functional_hot_op.BadInputTestOnehotV2)
1265: ----------------------------------------------------------------------
1265: Traceback (most recent call last):
1265: File "/paddle/build/python/paddle/pir_utils.py", line 115, in impl
1265: func(*args, **kwargs)
1265: File "/paddle/build/test/legacy_test/test_nn_functional_hot_op.py", line 183, in test_error
1265: self.assertRaises(TypeError, test_bad_x)
1265: AssertionError: TypeError not raised by test_bad_x
1265: |
|
Sorry to inform you that 7dbb662's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually. |
当前问题可以按上述方式修复 😄 |
好哒好哒~ |
… ooooo-pir161162
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test/legacy_test/test_zero_dim_tensor.py 文件里还有 TestNoBackwardAPIStatic.test_one_hot_label
单测没有迁移,麻烦迁移一下吧~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
麻烦更新一下 paddle.nn.functional.one_hot 的单测覆盖率。并且在 pr 描述中将已经解决问题的报错栈删除,方便我们后续排查~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
PR types
Others
PR changes
APIs
Description
No.161-162
新IR Python API适配升级 #58067
paddle.vision.ops.nms 单测覆盖率 2/2
paddle.nn.functional.one_hot 单测覆盖率 3/13
BadInputTestOnehotV2” 当前不支持
目前pir的OpTest逻辑还不是支持lod的处理。所以one_hot继承自OpTest的单测先不用适配了