Skip to content

[ET Device Support] Extract shared device test utilities to reduce redundancy#18762

Open
Gasoonjia wants to merge 2 commits intogh/gasoonjia/163/basefrom
gh/gasoonjia/163/head
Open

[ET Device Support] Extract shared device test utilities to reduce redundancy#18762
Gasoonjia wants to merge 2 commits intogh/gasoonjia/163/basefrom
gh/gasoonjia/163/head

Conversation

@Gasoonjia
Copy link
Copy Markdown
Contributor

@Gasoonjia Gasoonjia commented Apr 8, 2026

Stack from ghstack (oldest at bottom):

Extract DeviceAwarePartitioner, CpuOnlyPartitioner, and MockCudaAllocator into shared test utility modules to eliminate duplicated definitions across test files.

Python: Create executorch/exir/backend/test/device_util.py with DeviceAwarePartitioner (configurable target_device, default "cuda:0"), CpuOnlyPartitioner, and AddOperatorSupport. Update 3 consumer test files.

C++: Create executorch/runtime/core/test/mock_cuda_allocator.h with a canonical MockCudaAllocator (malloc/free/memcpy-backed, with call tracking). Update 4 consumer test files.

Differential Revision: D99925172

…dundancy

Extract DeviceAwarePartitioner, CpuOnlyPartitioner, and MockCudaAllocator into shared test utility modules to eliminate duplicated definitions across test files.

Python: Create executorch/exir/backend/test/device_util.py with DeviceAwarePartitioner (configurable target_device, default "cuda:0"), CpuOnlyPartitioner, and AddOperatorSupport. Update 3 consumer test files.

C++: Create executorch/runtime/core/test/mock_cuda_allocator.h with a canonical MockCudaAllocator (malloc/free/memcpy-backed, with call tracking). Update 4 consumer test files.

Differential Revision: [D99925172](https://our.internmc.facebook.com/intern/diff/D99925172/)

[ghstack-poisoned]
@pytorch-bot
Copy link
Copy Markdown

pytorch-bot bot commented Apr 8, 2026

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/18762

Note: Links to docs will display an error until the docs builds have been completed.

❌ 72 New Failures

As of commit 6454f32 with merge base b5ae0b9 (image):

NEW FAILURES - The following jobs have failed:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 8, 2026

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

Gasoonjia added a commit that referenced this pull request Apr 8, 2026
…dundancy

Extract DeviceAwarePartitioner, CpuOnlyPartitioner, and MockCudaAllocator into shared test utility modules to eliminate duplicated definitions across test files.

Python: Create executorch/exir/backend/test/device_util.py with DeviceAwarePartitioner (configurable target_device, default "cuda:0"), CpuOnlyPartitioner, and AddOperatorSupport. Update 3 consumer test files.

C++: Create executorch/runtime/core/test/mock_cuda_allocator.h with a canonical MockCudaAllocator (malloc/free/memcpy-backed, with call tracking). Update 4 consumer test files.

Differential Revision: [D99925172](https://our.internmc.facebook.com/intern/diff/D99925172/)

ghstack-source-id: 364093617
Pull Request resolved: #18762
@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Apr 8, 2026
…o reduce redundancy"

Extract DeviceAwarePartitioner, CpuOnlyPartitioner, and MockCudaAllocator into shared test utility modules to eliminate duplicated definitions across test files.

Python: Create executorch/exir/backend/test/device_util.py with DeviceAwarePartitioner (configurable target_device, default "cuda:0"), CpuOnlyPartitioner, and AddOperatorSupport. Update 3 consumer test files.

C++: Create executorch/runtime/core/test/mock_cuda_allocator.h with a canonical MockCudaAllocator (malloc/free/memcpy-backed, with call tracking). Update 4 consumer test files.

Differential Revision: [D99925172](https://our.internmc.facebook.com/intern/diff/D99925172/)

[ghstack-poisoned]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant