Skip to content

[0-size Tensor No.120、313] Add 0-size Tensor support for log - #72940

Merged
wanghuancoder merged 3 commits into
PaddlePaddle:developfrom
enkilee:0size-log
May 29, 2025
Merged

wanghuancoder merged 3 commits into
PaddlePaddle:developfrom
enkilee:0size-log

Conversation

@enkilee

@enkilee enkilee commented May 26, 2025 •

Copy link
Copy Markdown
Collaborator

PR Category

Execute Infrastructure

PR Types

Improvements

Description

当前PR为增加单测

cpu:

python engineV2.py --api_config='paddle.log(Tensor([0, 1],"float32"), )' --paddle_only=True --test_cpu=True

Main process id: 3483775
Options: {'api_config_file': '', 'api_config_file_pattern': '', 'api_config': 'paddle.log(Tensor([0, 1],"float32"), )', 'paddle_only': 'True', 'paddle_cinn': False, 'accuracy': False, 'test_amp': False, 'num_gpus': 0, 'num_workers_per_gpu': 1, 'gpu_ids': '', 'required_memory': 10.0, 'test_cpu': True, 'use_cached_numpy': False, 'log_dir': ''}
Test begin: paddle.log(Tensor([0, 1],"float32"), )
[Pass] paddle.log(Tensor([0, 1],"float32"), )
Done.

ython engineV2.py --api_config='paddle.log(Tensor([0, 2, 3],"float32"), name="Categorical_log_prob",)'  --paddle_only=True --test_cpu=True
Main process id: 5373
Options: {'api_config_file': '', 'api_config_file_pattern': '', 'api_config': 'paddle.log(Tensor([0, 2, 3],"float32"), name="Categorical_log_prob",)', 'paddle_only': 'True', 'paddle_cinn': False, 'accuracy': False, 'test_amp': False, 'num_gpus': 0, 'num_workers_per_gpu': 1, 'gpu_ids': '', 'required_memory': 10.0, 'test_cpu': True, 'use_cached_numpy': False, 'log_dir': ''}
Test begin: paddle.log(Tensor([0, 2, 3],"float32"), name="Categorical_log_prob",)
W0527 08:21:15.502329  5373 gpu_resources.cc:114] Please NOTE: device: 0, GPU Compute Capability: 7.0, Driver API Version: 12.0, Runtime API Version: 11.8
[Pass] paddle.log(Tensor([0, 2, 3],"float32"), name="Categorical_log_prob",)
Done.

gpu:

2025-05-27 08:07:32.114727 Worker PID: 3216, Assigned GPU ID: 0
2025-05-27 08:07:32.116576 GPU 0 3216 test begin: paddle.log(Tensor([0, 100, 4],"float32"), )
W0527 08:07:41.031105  3216 gpu_resources.cc:114] Please NOTE: device: 0, GPU Compute Capability: 7.0, Driver API Version: 12.0, Runtime API Version: 11.8
[Pass] paddle.log(Tensor([0, 100, 4],"float32"), )
2025-05-27 08:07:41.295067 GPU 0 3216 test begin: paddle.log(Tensor([0, 10164, 4],"float32"), )
[Pass] paddle.log(Tensor([0, 10164, 4],"float32"), )
2025-05-27 08:07:41.398893 GPU 0 3216 test begin: paddle.log(Tensor([0, 16],"float32"), )
[Pass] paddle.log(Tensor([0, 16],"float32"), )
2025-05-27 08:07:41.582868 GPU 0 3216 test begin: paddle.log(Tensor([0, 1],"float32"), )
[Pass] paddle.log(Tensor([0, 1],"float32"), )
2025-05-27 08:07:41.763330 GPU 0 3216 test begin: paddle.log(Tensor([0, 2, 300, 2],"float16"), )
[Pass] paddle.log(Tensor([0, 2, 300, 2],"float16"), )
2025-05-27 08:07:41.949025 GPU 0 3216 test begin: paddle.log(Tensor([0, 2, 300, 2],"float32"), )
[Pass] paddle.log(Tensor([0, 2, 300, 2],"float32"), )
2025-05-27 08:07:42.130497 GPU 0 3216 test begin: paddle.log(Tensor([0, 2, 3],"float32"), name="Categorical_log_prob", )
[Pass] paddle.log(Tensor([0, 2, 3],"float32"), name="Categorical_log_prob", )
2025-05-27 08:07:42.310728 GPU 0 3216 test begin: paddle.log(Tensor([0, 2],"float32"), name="Categorical_log_prob", )
[Pass] paddle.log(Tensor([0, 2],"float32"), name="Categorical_log_prob", )
2025-05-27 08:07:42.484663 GPU 0 3216 test begin: paddle.log(Tensor([0, 3],"float32"), name="Categorical_log_prob", )
[Pass] paddle.log(Tensor([0, 3],"float32"), name="Categorical_log_prob", )
2025-05-27 08:07:42.666959 GPU 0 3216 test begin: paddle.log(Tensor([0, 6],"float32"), name="Uniform_entropy", )
[Pass] paddle.log(Tensor([0, 6],"float32"), name="Uniform_entropy", )
2025-05-27 08:07:42.843080 GPU 0 3216 test begin: paddle.log(Tensor([0, 6],"float64"), name="Uniform_entropy", )
[Pass] paddle.log(Tensor([0, 6],"float64"), name="Uniform_entropy", )
2025-05-27 08:07:43.044196 GPU 0 3216 test begin: paddle.log(Tensor([0],"float32"), )
[Pass] paddle.log(Tensor([0],"float32"), )
2025-05-27 08:07:43.227147 GPU 0 3216 test begin: paddle.log(Tensor([0],"float32"), name="Categorical_log_prob", )
[Pass] paddle.log(Tensor([0],"float32"), name="Categorical_log_prob", )
2025-05-27 08:07:43.407388 GPU 0 3216 test begin: paddle.log(Tensor([0],"float64"), )
[Pass] paddle.log(Tensor([0],"float64"), )
2025-05-27 08:07:43.603193 GPU 0 3216 test begin: paddle.log(Tensor([1, 0, 300, 2],"float16"), )
[Pass] paddle.log(Tensor([1, 0, 300, 2],"float16"), )
2025-05-27 08:07:43.814351 GPU 0 3216 test begin: paddle.log(Tensor([1, 0, 300, 2],"float32"), )
[Pass] paddle.log(Tensor([1, 0, 300, 2],"float32"), )
2025-05-27 08:07:44.006270 GPU 0 3216 test begin: paddle.log(Tensor([1, 0, 4],"float32"), )
[Pass] paddle.log(Tensor([1, 0, 4],"float32"), )
2025-05-27 08:07:44.175760 GPU 0 3216 test begin: paddle.log(Tensor([1, 0],"float32"), )
[Pass] paddle.log(Tensor([1, 0],"float32"), )
2025-05-27 08:07:44.392704 GPU 0 3216 test begin: paddle.log(Tensor([1, 100, 0],"float32"), )
[Pass] paddle.log(Tensor([1, 100, 0],"float32"), )
2025-05-27 08:07:44.555662 GPU 0 3216 test begin: paddle.log(Tensor([1, 10164, 0],"float32"), )
[Pass] paddle.log(Tensor([1, 10164, 0],"float32"), )
2025-05-27 08:07:44.731746 GPU 0 3216 test begin: paddle.log(Tensor([1, 2, 0, 2],"float16"), )
[Pass] paddle.log(Tensor([1, 2, 0, 2],"float16"), )
2025-05-27 08:07:44.926290 GPU 0 3216 test begin: paddle.log(Tensor([1, 2, 0, 2],"float32"), )
[Pass] paddle.log(Tensor([1, 2, 0, 2],"float32"), )
2025-05-27 08:07:45.100193 GPU 0 3216 test begin: paddle.log(Tensor([1, 2, 300, 0],"float16"), )
[Pass] paddle.log(Tensor([1, 2, 300, 0],"float16"), )
2025-05-27 08:07:45.272753 GPU 0 3216 test begin: paddle.log(Tensor([1, 2, 300, 0],"float32"), )
[Pass] paddle.log(Tensor([1, 2, 300, 0],"float32"), )
2025-05-27 08:07:45.452124 GPU 0 3216 test begin: paddle.log(Tensor([3, 0, 3],"float32"), name="Categorical_log_prob", )
[Pass] paddle.log(Tensor([3, 0, 3],"float32"), name="Categorical_log_prob", )
2025-05-27 08:07:45.636470 GPU 0 3216 test begin: paddle.log(Tensor([3, 0],"float32"), name="Categorical_log_prob", )
[Pass] paddle.log(Tensor([3, 0],"float32"), name="Categorical_log_prob", )
2025-05-27 08:07:45.837101 GPU 0 3216 test begin: paddle.log(Tensor([3, 2, 0],"float32"), name="Categorical_log_prob", )
[Pass] paddle.log(Tensor([3, 2, 0],"float32"), name="Categorical_log_prob", )
2025-05-27 08:07:46.012415 GPU 0 3216 test begin: paddle.log(Tensor([5, 0],"float32"), name="Uniform_entropy", )
[Pass] paddle.log(Tensor([5, 0],"float32"), name="Uniform_entropy", )
2025-05-27 08:07:46.185724 GPU 0 3216 test begin: paddle.log(Tensor([5, 0],"float64"), name="Uniform_entropy", )
[Pass] paddle.log(Tensor([5, 0],"float64"), name="Uniform_entropy", )
2025-05-27 08:07:46.345100 GPU 0 3216 test begin: paddle.log(x=Tensor([0, 2, 3],"float64"), )
[Pass] paddle.log(x=Tensor([0, 2, 3],"float64"), )
2025-05-27 08:07:46.539098 GPU 0 3216 test begin: paddle.log(x=Tensor([0, 2, 3],"float64"), name="test_log", )
[Pass] paddle.log(x=Tensor([0, 2, 3],"float64"), name="test_log", )
2025-05-27 08:07:46.721764 GPU 0 3216 test begin: paddle.log(x=Tensor([0, 2],"float32"), )
[Pass] paddle.log(x=Tensor([0, 2],"float32"), )
2025-05-27 08:07:46.903643 GPU 0 3216 test begin: paddle.log(x=Tensor([0, 2],"float64"), )
[Pass] paddle.log(x=Tensor([0, 2],"float64"), )
2025-05-27 08:07:47.079234 GPU 0 3216 test begin: paddle.log(x=Tensor([0],"float64"), )
[Pass] paddle.log(x=Tensor([0],"float64"), )
2025-05-27 08:07:47.277642 GPU 0 3216 test begin: paddle.log(x=Tensor([2, 0, 3],"float64"), )
[Pass] paddle.log(x=Tensor([2, 0, 3],"float64"), )
2025-05-27 08:07:47.432213 GPU 0 3216 test begin: paddle.log(x=Tensor([2, 0, 3],"float64"), name="test_log", )
[Pass] paddle.log(x=Tensor([2, 0, 3],"float64"), name="test_log", )
2025-05-27 08:07:47.610011 GPU 0 3216 test begin: paddle.log(x=Tensor([2, 0],"float32"), )
[Pass] paddle.log(x=Tensor([2, 0],"float32"), )
2025-05-27 08:07:47.805536 GPU 0 3216 test begin: paddle.log(x=Tensor([2, 0],"float64"), )
[Pass] paddle.log(x=Tensor([2, 0],"float64"), )
2025-05-27 08:07:47.965151 GPU 0 3216 test begin: paddle.log(x=Tensor([2, 2, 0],"float64"), )
[Pass] paddle.log(x=Tensor([2, 2, 0],"float64"), )
2025-05-27 08:07:48.134744 GPU 0 3216 test begin: paddle.log(x=Tensor([2, 2, 0],"float64"), name="test_log", )
[Pass] paddle.log(x=Tensor([2, 2, 0],"float64"), name="test_log", )

@paddle-bot

paddle-bot Bot commented May 26, 2025

Copy link
Copy Markdown

你的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 May 26, 2025
@DanielSun11

Copy link
Copy Markdown
Contributor

补充一下GPU和CPU的PaddleAPI测试结果,CPU测试可使用python engineV2.py --api_config='xxxx' --paddle_only=True --test_cpu=True

@luotao1 luotao1 added the HappyOpenSource Pro 进阶版快乐开源活动,更具挑战性的任务 label May 26, 2025
Comment thread test/legacy_test/test_activation_op.py Resolved

@DanielSun11 DanielSun11 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@wanghuancoder wanghuancoder left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@wanghuancoder
wanghuancoder merged commit 213e076 into PaddlePaddle:develop May 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor External developers HappyOpenSource Pro 进阶版快乐开源活动,更具挑战性的任务

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants