Skip to content

[ET Device Support] make device support config method-based#19582

Open
Gasoonjia wants to merge 2 commits into
gh/gasoonjia/172/basefrom
gh/gasoonjia/172/head
Open

[ET Device Support] make device support config method-based#19582
Gasoonjia wants to merge 2 commits into
gh/gasoonjia/172/basefrom
gh/gasoonjia/172/head

Conversation

@Gasoonjia
Copy link
Copy Markdown
Contributor

@Gasoonjia Gasoonjia commented May 14, 2026

Stack from ghstack (oldest at bottom):

Device memory planning and H2D/D2H copy configuration were previously global
flags on ExecutorchBackendConfig, applied uniformly across all methods in a
multi-method program. This made it impossible to configure different behaviors
per method — e.g., skipping H2D copies for one method while keeping them for
another.

This diff makes these configs method-based by:

  1. Moving enable_non_cpu_memory_planning into MemoryPlanningPass, which
    already supports per-method dispatch via Dict[str, PassType] on
    ExecutorchBackendConfig.memory_planning_pass, follow other memory-planing-related config like alloc_input or alloc_output

  2. Introducing PropagateDeviceConfig dataclass that groups
    skip_h2d_for_method_inputs and skip_d2h_for_method_outputs, with each
    field accepting either a single bool or a Dict[str, bool] for per-method
    overrides. A new propagate_device_config field on ExecutorchBackendConfig
    similarly accepts either a single config or Dict[str, PropagateDeviceConfig].

Differential Revision: D101243687

Device memory planning and H2D/D2H copy configuration were previously global
flags on ExecutorchBackendConfig, applied uniformly across all methods in a
multi-method program. This made it impossible to configure different behaviors
per method — e.g., skipping H2D copies for one method while keeping them for
another.

This diff makes these configs method-based by:

1. Moving `enable_non_cpu_memory_planning` into MemoryPlanningPass, which
   already supports per-method dispatch via Dict[str, PassType] on
   ExecutorchBackendConfig.memory_planning_pass, follow other memory-planing-related config like `alloc_input` or `alloc_output`

2. Introducing PropagateDeviceConfig dataclass that groups
   `skip_h2d_for_method_inputs` and `skip_d2h_for_method_outputs`, with each
   field accepting either a single bool or a Dict[str, bool] for per-method
   overrides. A new `propagate_device_config` field on ExecutorchBackendConfig
   similarly accepts either a single config or Dict[str, PropagateDeviceConfig].

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

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

pytorch-bot Bot commented May 14, 2026

🔗 Helpful Links

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

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

❗ 1 Active SEVs

There are 1 currently active SEVs. If your PR is affected, please view them below:

❌ 8 New Failures, 3 Unrelated Failures, 1 Unclassified Failure

As of commit 0c82961 with merge base 77df9b7 (image):

NEW FAILURES - The following jobs have failed:

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

  • Check Labels / Check labels (gh) (this job did not run on the merge base, so DrCI cannot tell whether the failure is pre-existing)
    RuntimeError: GraphQL query

BROKEN TRUNK - The following jobs failed but were present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

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

Copy link
Copy Markdown
Contributor

@JacobSzwejbka JacobSzwejbka left a comment

Choose a reason for hiding this comment

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

Review automatically exported from Phabricator review in Meta.

[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.

2 participants