Skip to content

4/x: Add LoadBackendOptionsMap support to Module::load()#17687

Merged
meta-codesync[bot] merged 1 commit into
pytorch:mainfrom
metascroy:export-D92358607
Feb 27, 2026
Merged

4/x: Add LoadBackendOptionsMap support to Module::load()#17687
meta-codesync[bot] merged 1 commit into
pytorch:mainfrom
metascroy:export-D92358607

Conversation

@metascroy
Copy link
Copy Markdown
Contributor

Summary:
This diff exposes the LoadBackendOptionsMap API at the Module level, providing the user-facing interface for configuring backend options at model load time.

Key changes:

  • Added Module::load() overload accepting LoadBackendOptionsMap parameter
  • Options are forwarded through the executor layer to backend delegates
  • Backward compatible: existing load() calls continue to work without options

This completes the end-to-end user flow:

// Configure backend options
LoadOptionsBuilder coreml_opts;
coreml_opts.setComputeUnit(LoadOptionsBuilder::ComputeUnit::CPU_AND_GPU);

LoadBackendOptionsMap options;
options.set_options(coreml_opts);

// Load model with options
Module module(model_path);
module.load("forward", options);

Reviewed By: larryliu0820

Differential Revision: D92358607

@pytorch-bot
Copy link
Copy Markdown

pytorch-bot Bot commented Feb 25, 2026

🔗 Helpful Links

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

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

❌ 5 New Failures

As of commit bd530b3 with merge base 19de115 (image):

NEW FAILURES - The following jobs have failed:

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 Feb 25, 2026
@meta-codesync
Copy link
Copy Markdown
Contributor

meta-codesync Bot commented Feb 25, 2026

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

Copy link
Copy Markdown
Contributor

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

@github-actions
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.

metascroy added a commit to metascroy/executorch that referenced this pull request Feb 25, 2026
Summary:

This diff exposes the `LoadBackendOptionsMap` API at the `Module` level, providing the user-facing interface for configuring backend options at model load time.

Key changes:
- Added `Module::load()` overload accepting `LoadBackendOptionsMap` parameter
- Options are forwarded through the executor layer to backend delegates
- Backward compatible: existing `load()` calls continue to work without options

This completes the end-to-end user flow:
```cpp
// Configure backend options
LoadOptionsBuilder coreml_opts;
coreml_opts.setComputeUnit(LoadOptionsBuilder::ComputeUnit::CPU_AND_GPU);

LoadBackendOptionsMap options;
options.set_options(coreml_opts);

// Load model with options
Module module(model_path);
module.load("forward", options);
```

Reviewed By: larryliu0820

Differential Revision: D92358607
metascroy added a commit to metascroy/executorch that referenced this pull request Feb 25, 2026
Summary:
Pull Request resolved: pytorch#17687

This diff exposes the `LoadBackendOptionsMap` API at the `Module` level, providing the user-facing interface for configuring backend options at model load time.

Key changes:
- Added `Module::load()` overload accepting `LoadBackendOptionsMap` parameter
- Options are forwarded through the executor layer to backend delegates
- Backward compatible: existing `load()` calls continue to work without options

This completes the end-to-end user flow:
```cpp
// Configure backend options
LoadOptionsBuilder coreml_opts;
coreml_opts.setComputeUnit(LoadOptionsBuilder::ComputeUnit::CPU_AND_GPU);

LoadBackendOptionsMap options;
options.set_options(coreml_opts);

// Load model with options
Module module(model_path);
module.load("forward", options);
```

Reviewed By: larryliu0820

Differential Revision: D92358607
metascroy added a commit to metascroy/executorch that referenced this pull request Feb 25, 2026
Summary:

This diff exposes the `LoadBackendOptionsMap` API at the `Module` level, providing the user-facing interface for configuring backend options at model load time.

Key changes:
- Added `Module::load()` overload accepting `LoadBackendOptionsMap` parameter
- Options are forwarded through the executor layer to backend delegates
- Backward compatible: existing `load()` calls continue to work without options

This completes the end-to-end user flow:
```cpp
// Configure backend options
LoadOptionsBuilder coreml_opts;
coreml_opts.setComputeUnit(LoadOptionsBuilder::ComputeUnit::CPU_AND_GPU);

LoadBackendOptionsMap options;
options.set_options(coreml_opts);

// Load model with options
Module module(model_path);
module.load("forward", options);
```

Reviewed By: larryliu0820

Differential Revision: D92358607
metascroy added a commit to metascroy/executorch that referenced this pull request Feb 25, 2026
Summary:
Pull Request resolved: pytorch#17687

This diff exposes the `LoadBackendOptionsMap` API at the `Module` level, providing the user-facing interface for configuring backend options at model load time.

Key changes:
- Added `Module::load()` overload accepting `LoadBackendOptionsMap` parameter
- Options are forwarded through the executor layer to backend delegates
- Backward compatible: existing `load()` calls continue to work without options

This completes the end-to-end user flow:
```cpp
// Configure backend options
LoadOptionsBuilder coreml_opts;
coreml_opts.setComputeUnit(LoadOptionsBuilder::ComputeUnit::CPU_AND_GPU);

LoadBackendOptionsMap options;
options.set_options(coreml_opts);

// Load model with options
Module module(model_path);
module.load("forward", options);
```

Reviewed By: larryliu0820

Differential Revision: D92358607
@metascroy metascroy force-pushed the export-D92358607 branch 2 times, most recently from 4a6df62 to e78661a Compare February 26, 2026 17:59
metascroy added a commit to metascroy/executorch that referenced this pull request Feb 26, 2026
Summary:

This diff exposes the `LoadBackendOptionsMap` API at the `Module` level, providing the user-facing interface for configuring backend options at model load time.

Key changes:
- Added `Module::load()` overload accepting `LoadBackendOptionsMap` parameter
- Options are forwarded through the executor layer to backend delegates
- Backward compatible: existing `load()` calls continue to work without options

This completes the end-to-end user flow:
```cpp
// Configure backend options
LoadOptionsBuilder coreml_opts;
coreml_opts.setComputeUnit(LoadOptionsBuilder::ComputeUnit::CPU_AND_GPU);

LoadBackendOptionsMap options;
options.set_options(coreml_opts);

// Load model with options
Module module(model_path);
module.load("forward", options);
```

Reviewed By: larryliu0820

Differential Revision: D92358607
metascroy added a commit to metascroy/executorch that referenced this pull request Feb 26, 2026
Summary:
Pull Request resolved: pytorch#17687

This diff exposes the `LoadBackendOptionsMap` API at the `Module` level, providing the user-facing interface for configuring backend options at model load time.

Key changes:
- Added `Module::load()` overload accepting `LoadBackendOptionsMap` parameter
- Options are forwarded through the executor layer to backend delegates
- Backward compatible: existing `load()` calls continue to work without options

This completes the end-to-end user flow:
```cpp
// Configure backend options
LoadOptionsBuilder coreml_opts;
coreml_opts.setComputeUnit(LoadOptionsBuilder::ComputeUnit::CPU_AND_GPU);

LoadBackendOptionsMap options;
options.set_options(coreml_opts);

// Load model with options
Module module(model_path);
module.load("forward", options);
```

Reviewed By: larryliu0820

Differential Revision: D92358607
metascroy added a commit to metascroy/executorch that referenced this pull request Feb 26, 2026
Summary:

This diff exposes the `LoadBackendOptionsMap` API at the `Module` level, providing the user-facing interface for configuring backend options at model load time.

Key changes:
- Added `Module::load()` overload accepting `LoadBackendOptionsMap` parameter
- Options are forwarded through the executor layer to backend delegates
- Backward compatible: existing `load()` calls continue to work without options

This completes the end-to-end user flow:
```cpp
// Configure backend options
LoadOptionsBuilder coreml_opts;
coreml_opts.setComputeUnit(LoadOptionsBuilder::ComputeUnit::CPU_AND_GPU);

LoadBackendOptionsMap options;
options.set_options(coreml_opts);

// Load model with options
Module module(model_path);
module.load("forward", options);
```

Reviewed By: larryliu0820

Differential Revision: D92358607
metascroy added a commit to metascroy/executorch that referenced this pull request Feb 26, 2026
Summary:
Pull Request resolved: pytorch#17687

This diff exposes the `LoadBackendOptionsMap` API at the `Module` level, providing the user-facing interface for configuring backend options at model load time.

Key changes:
- Added `Module::load()` overload accepting `LoadBackendOptionsMap` parameter
- Options are forwarded through the executor layer to backend delegates
- Backward compatible: existing `load()` calls continue to work without options

This completes the end-to-end user flow:
```cpp
// Configure backend options
LoadOptionsBuilder coreml_opts;
coreml_opts.setComputeUnit(LoadOptionsBuilder::ComputeUnit::CPU_AND_GPU);

LoadBackendOptionsMap options;
options.set_options(coreml_opts);

// Load model with options
Module module(model_path);
module.load("forward", options);
```

Reviewed By: larryliu0820

Differential Revision: D92358607
Summary:

This diff exposes the `LoadBackendOptionsMap` API at the `Module` level, providing the user-facing interface for configuring backend options at model load time.

Key changes:
- Added `Module::load()` overload accepting `LoadBackendOptionsMap` parameter
- Options are forwarded through the executor layer to backend delegates
- Backward compatible: existing `load()` calls continue to work without options

This completes the end-to-end user flow:
```cpp
// Configure backend options
LoadOptionsBuilder coreml_opts;
coreml_opts.setComputeUnit(LoadOptionsBuilder::ComputeUnit::CPU_AND_GPU);

LoadBackendOptionsMap options;
options.set_options(coreml_opts);

// Load model with options
Module module(model_path);
module.load("forward", options);
```

Reviewed By: larryliu0820

Differential Revision: D92358607
@meta-codesync meta-codesync Bot merged commit 4528ae2 into pytorch:main Feb 27, 2026
158 of 164 checks passed
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