Skip to content

Conversation

@Dayuxiaoshui
Copy link
Contributor

@Dayuxiaoshui Dayuxiaoshui commented Sep 20, 2025

PR Category

Operator Mechanism

PR Types

Bug fixes

Description

  • Remove dependency on op_test module to fix import errors
  • Add local get_device_place function implementation
  • Fix static graph mode issues in API test
  • Ensure all tests pass in GPU environment with CUDA support

PR Category
Operator Mechanism

PR Types
Bug fixes

Description
Fix test_memcpy_op unittest error and support PIR API compatibility.
The Paddle framework has migrated from old IR to new PIR (Program IR), causing API compatibility issues in static graph tests.
test_memcpy_op unit test now supports PIR API and uses dynamic graph mode for better compatibility.
Fixed data type checking issues where paddle.float32 corresponds to different objects in different contexts.
@CLAassistant
Copy link

CLAassistant commented Sep 20, 2025

CLA assistant check
All committers have signed the CLA.

@paddle-bot
Copy link

paddle-bot bot commented Sep 20, 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.

@paddle-bot paddle-bot bot added the contributor External developers label Sep 20, 2025
…py_op.py

- Replace all Chinese comments with English equivalents
- Improve code readability for international developers
- Maintain consistent comment language throughout the codebase
- Replace static graph API with dynamic graph mode to avoid PIR compatibility issues
- Fix create_var and append_op calls that are not available in PIR API
- Add CUDA fallback handling for CPU-only environments
- Ensure all tests pass in both CUDA and CPU environments
- Maintain original test logic and assertions

PR Category: Operator Mechanism
PR Types: Bug fixes
Description: Fix memcpy unittest error and support PIR API compatibility. The test now uses dynamic graph mode to avoid PIR API compatibility issues while maintaining the same test coverage.
- Remove dependency on op_test module to fix import errors
- Add local get_device_place function implementation
- Fix static graph mode issues in API test
- Ensure all tests pass in GPU environment with CUDA support

All 5 tests now pass successfully:
- test_gpu_copy_to_pinned: GPU to GPU Pinned memory copy
- test_pinned_copy_gpu: GPU Pinned memory to GPU copy
- test_hip_copy_bool_value: HIP environment bool value copy
- test_SELECTED_ROWS: SELECTED_ROWS type error handling
- test_api: API functionality test
@luotao1 luotao1 added the HappyOpenSource 快乐开源活动issue与PR label Sep 22, 2025
@luotao1
Copy link
Contributor

luotao1 commented Sep 22, 2025

请修复 CodeStyle 流水线错误

@Dayuxiaoshui
Copy link
Contributor Author

@luotao1 修复好了,请求再次批准检查

@Dayuxiaoshui
Copy link
Contributor Author

@luotao1 修复好了,等待检查

Copy link
Contributor

@YqGe585 YqGe585 left a comment

Choose a reason for hiding this comment

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

LGTM

@YqGe585
Copy link
Contributor

YqGe585 commented Sep 24, 2025

PR名称麻烦按照规范修改。
在 PR 的标题中以 【UnitTestFix No.xxx】 开头,注明任务编号

@Dayuxiaoshui Dayuxiaoshui changed the title fix: Fix test_memcpy_op unittest error and support PIR API compatibility 【UnitTestFix No.9】: Fix test_memcpy_op unittest error and support PIR API compatibility Sep 24, 2025
@Dayuxiaoshui
Copy link
Contributor Author

修改完成

@Dayuxiaoshui
Copy link
Contributor Author

@luotao1 请求审查

@luotao1 luotao1 merged commit ad6dc33 into PaddlePaddle:develop Sep 24, 2025
68 of 69 checks passed
@luotao1
Copy link
Contributor

luotao1 commented Sep 24, 2025

hi, @Dayuxiaoshui

  • 非常感谢你对飞桨的贡献,我们正在运营一个PFCC组织。PFCC是飞桨开源的贡献者俱乐部,只有给飞桨合入过代码的开发者才能加入,俱乐部里每两周会有一次例会(按兴趣参加),也会时不时办线下meetup面基,详情可见 https://github.com/luotao1 主页说明。
  • 如果你对PFCC有兴趣,请发送邮件至 [email protected],我们会邀请你加入~

wanglezz pushed a commit to wanglezz/Paddle that referenced this pull request Sep 25, 2025
… API compatibility (PaddlePaddle#75395)

* fix: Fix test_memcpy_op unittest error and support PIR API compatibility

PR Category
Operator Mechanism

PR Types
Bug fixes

Description
Fix test_memcpy_op unittest error and support PIR API compatibility.
The Paddle framework has migrated from old IR to new PIR (Program IR), causing API compatibility issues in static graph tests.
test_memcpy_op unit test now supports PIR API and uses dynamic graph mode for better compatibility.
Fixed data type checking issues where paddle.float32 corresponds to different objects in different contexts.

* refactor: Replace Chinese comments with English comments in test_memcpy_op.py

- Replace all Chinese comments with English equivalents
- Improve code readability for international developers
- Maintain consistent comment language throughout the codebase

* Fix test_memcpy_op unittest compatibility with PIR API

- Replace static graph API with dynamic graph mode to avoid PIR compatibility issues
- Fix create_var and append_op calls that are not available in PIR API
- Add CUDA fallback handling for CPU-only environments
- Ensure all tests pass in both CUDA and CPU environments
- Maintain original test logic and assertions

PR Category: Operator Mechanism
PR Types: Bug fixes
Description: Fix memcpy unittest error and support PIR API compatibility. The test now uses dynamic graph mode to avoid PIR API compatibility issues while maintaining the same test coverage.

* Fix test_memcpy_op.py for GPU environment compatibility

- Remove dependency on op_test module to fix import errors
- Add local get_device_place function implementation
- Fix static graph mode issues in API test
- Ensure all tests pass in GPU environment with CUDA support

All 5 tests now pass successfully:
- test_gpu_copy_to_pinned: GPU to GPU Pinned memory copy
- test_pinned_copy_gpu: GPU Pinned memory to GPU copy
- test_hip_copy_bool_value: HIP environment bool value copy
- test_SELECTED_ROWS: SELECTED_ROWS type error handling
- test_api: API functionality test

* chore: fix EOF newline for test_memcpy_op.py via pre-commit end-of-file-fixer

* test(legacy): replace get_device_place with base.CUDAPlace(0); fix EOF newline
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.

4 participants