Skip to content

【Paddle Tensor】Fix bugs related to converting unit tests about collect shape #71305

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

Merged
merged 20 commits into from
Mar 18, 2025

Conversation

PolaKuma
Copy link
Contributor

@PolaKuma PolaKuma commented Feb 27, 2025

PR Category

Inference

PR Types

Bug fixes

Description

card-71500

  • 解决了 scale 单测问题,原因出在一维时候一旦is_shape_tensor函数判断和trt自带的不一致
  • 解决了 argsort 单测问题,改动is_shape_tensor+去掉marker不进的情况(shape[-1]>3840)
  • 解决了 elementwise 系列单测问题,is_shape_tensor问题
  • 解决了 reduce 系列单测问题,is_shape_tensor问题 + float64不让输入
  • 添加了split、split_with_num单测,由于返回为vec[tensor],而不是tensor,考虑暂时不适配,pir-trt根据旧ir例子进行补全(unbind同理,但是没有补充的)

Copy link

paddle-bot bot commented Feb 27, 2025

你的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.

self.run_test(run_pir=True)


# class TrtConvertElementwiseTestTwoInputSkipCase(TrtLayerAutoScanTest):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

这里是进不了marker的情况的单测

@@ -73,7 +73,7 @@ def generate_input1(dtype, attrs: list[dict[str, Any]]):
[3, 4, 5],
]:
for reduce_all in [True, False]:
for out_dtype in [-1, 0, 2, 5, 3, 6]:
for out_dtype in [-1, 0, 2, 5, 3]:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

去掉了float64的输入,trt会报错不支持

@@ -30,7 +30,7 @@ def is_program_valid(self, program_config: ProgramConfig) -> bool:
def sample_program_configs(self):
def generate_input1():
if self.dims == 4:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

最后一个维度如果超过了3840就不能进入marker

@@ -385,6 +385,26 @@ def test_trt_result(self):
self.check_trt_result()


class TestSplitWithNumSectionAndAxis2TRTPattern(TensorRTBaseTest):
def setUp(self):
self.python_api = paddle.split
Copy link
Contributor Author

Choose a reason for hiding this comment

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

split等返回vec类型目前暂时是新旧组网不一致,暂时不适配,在pir-trt单测体系新增一些

@@ -205,7 +200,7 @@ def generate_weight(op_type):
else:
return np.random.randn(1).astype(np.float32)

for shape in [[32]]:
for shape in [[4]]:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

当动态shape为一维并且x.numel()>8时候,result_value.is_shape_tensor会出现相反的判断,但是为了以防万一,尽量不修改基类,因此对于一维shape这里把维度改小或者dynamic_shape改成一样,后面同理

lizexu123
lizexu123 previously approved these changes Mar 17, 2025
XieYunshen
XieYunshen previously approved these changes Mar 17, 2025
@PolaKuma PolaKuma dismissed stale reviews from XieYunshen and lizexu123 via 5b9324e March 17, 2025 12:26
@lizexu123 lizexu123 merged commit 82b9f19 into PaddlePaddle:develop Mar 18, 2025
30 checks passed
PolaKuma added a commit to PolaKuma/Paddle that referenced this pull request Mar 18, 2025
…t shape (PaddlePaddle#71305)

* fix scale

* fix codestyle

* fix argsort

* fix elementwise

* fix reduce

* fix codestyle

* fix collect_shape

* fix codestyle

* add split test

* add time

* fix codestyle

* fix conv2d

* fix codestyle

* delete conv2d

* delete conv2d

* update

* last fix

* fix timeout

* Update CMakeLists.txt
qingqing01 pushed a commit that referenced this pull request Mar 18, 2025
…t shape (#71305) (#71750)

* fix scale

* fix codestyle

* fix argsort

* fix elementwise

* fix reduce

* fix codestyle

* fix collect_shape

* fix codestyle

* add split test

* add time

* fix codestyle

* fix conv2d

* fix codestyle

* delete conv2d

* delete conv2d

* update

* last fix

* fix timeout

* Update CMakeLists.txt
@PolaKuma PolaKuma deleted the fix_c_b branch March 20, 2025 04:40
YqGe585 pushed a commit to YqGe585/Paddle that referenced this pull request May 7, 2025
…t shape (PaddlePaddle#71305)

* fix scale

* fix codestyle

* fix argsort

* fix elementwise

* fix reduce

* fix codestyle

* fix collect_shape

* fix codestyle

* add split test

* add time

* fix codestyle

* fix conv2d

* fix codestyle

* delete conv2d

* delete conv2d

* update

* last fix

* fix timeout

* Update CMakeLists.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants