Skip to content

make device support config method-based (#19970)#19970

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

make device support config method-based (#19970)#19970
meta-codesync[bot] merged 1 commit into
mainfrom
export-D101243687

Conversation

@Gasoonjia

@Gasoonjia Gasoonjia commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Summary:

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 introduces 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].

Reviewed By: JacobSzwejbka

Differential Revision: D101243687

@pytorch-bot

pytorch-bot Bot commented Jun 3, 2026

Copy link
Copy Markdown

🔗 Helpful Links

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

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

⏳ No Failures, 9 Pending

As of commit 0286c23 with merge base 1b7008b (image):
💚 Looks good so far! There are no failures yet. 💚

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

meta-codesync Bot commented Jun 3, 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 D101243687.

@JacobSzwejbka JacobSzwejbka 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.

Review automatically exported from Phabricator review in Meta.

@github-actions

github-actions Bot commented Jun 3, 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:

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 introduces 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].

Reviewed By: JacobSzwejbka

Differential Revision: D101243687
@meta-codesync meta-codesync Bot changed the title make device support config method-based make device support config method-based (#19970) Jun 3, 2026
@meta-codesync meta-codesync Bot force-pushed the export-D101243687 branch from 29ef909 to 0286c23 Compare June 3, 2026 19:04
@meta-codesync meta-codesync Bot merged commit 49c6072 into main Jun 3, 2026
298 of 302 checks passed
@meta-codesync meta-codesync Bot deleted the export-D101243687 branch June 3, 2026 22:51
Gasoonjia added a commit that referenced this pull request Jun 8, 2026
Differential Revision: D101243687

Pull Request resolved: #19970
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. fb-exported meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants