Skip to content

Extract shared device test utilities to reduce redundancy (#20061)#20061

Merged
meta-codesync[bot] merged 1 commit into
mainfrom
export-D99925172
Jun 8, 2026
Merged

Extract shared device test utilities to reduce redundancy (#20061)#20061
meta-codesync[bot] merged 1 commit into
mainfrom
export-D99925172

Conversation

@Gasoonjia

@Gasoonjia Gasoonjia commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Summary:

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.

Reviewed By: abhinaykukkadapu

Differential Revision: D99925172

@pytorch-bot

pytorch-bot Bot commented Jun 5, 2026

Copy link
Copy Markdown

🔗 Helpful Links

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

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

❌ 2 Unclassified Failures

As of commit 7ff6067 with merge base 12684ef (image):

UNCLASSIFIED FAILURES - DrCI could not classify the following jobs because the workflow did not run on the merge base. The failures may be pre-existing on trunk or introduced by this PR:

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

@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 Jun 5, 2026
@meta-codesync

meta-codesync Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

@Gasoonjia has exported this pull request. If you are a Meta employee, you can view the originating Diff in D99925172.

@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown

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.

Summary:


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.

Reviewed By: abhinaykukkadapu

Differential Revision: D99925172
@meta-codesync meta-codesync Bot changed the title Extract shared device test utilities to reduce redundancy Extract shared device test utilities to reduce redundancy (#20061) Jun 5, 2026
@meta-codesync meta-codesync Bot force-pushed the export-D99925172 branch from 1606c12 to 7ff6067 Compare June 5, 2026 22:00
@meta-codesync meta-codesync Bot merged commit aca0b1a into main Jun 8, 2026
235 of 239 checks passed
@meta-codesync meta-codesync Bot deleted the export-D99925172 branch June 8, 2026 06:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants