make device support config method-based (#19970)#19970
Conversation
🔗 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 PendingAs of commit 0286c23 with merge base 1b7008b ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
@Gasoonjia has exported this pull request. If you are a Meta employee, you can view the originating Diff in D101243687. |
JacobSzwejbka
left a comment
There was a problem hiding this comment.
Review automatically exported from Phabricator review in Meta.
This PR needs a
|
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
29ef909 to
0286c23
Compare
Differential Revision: D101243687 Pull Request resolved: #19970
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_inputsandskip_d2h_for_method_outputs, with eachfield accepting either a single bool or a Dict[str, bool] for per-method
overrides. A new
propagate_device_configfield on ExecutorchBackendConfigsimilarly accepts either a single config or Dict[str, PropagateDeviceConfig].
Reviewed By: JacobSzwejbka
Differential Revision: D101243687