Skip to content

Conversation

@abhinaykukkadapu
Copy link
Contributor

@abhinaykukkadapu abhinaykukkadapu commented Jul 9, 2025

Summary:
Implements the RFC: #12248

  1. BackendRecipeProvider -> Abstract interface that all backends must implement while providing recipes.
  2. recipe_registry -> Singleton registry that maintains BackendRecipeProviders
  3. RecipeType -> Abstract enum, backends extend this to provide support for specific recipes.
  4. ExportRecipe will have two class methods
    a. get_recipe -> Queries registry to get recipe w/ specific backend

One can simply get and use recipes with:

Using recipe as-is

recipe = ExportRecipe.get_recipe(
            XNNPackRecipeType.INT8_DYNAMIC_ACT_INT4_WEIGHT_PER_CHANNEL, 
            group_size=32)
export(eager_model, example_inputs, dynamic_shapes, recipe)

Differential Revision: D78034047

@pytorch-bot
Copy link

pytorch-bot bot commented Jul 9, 2025

🔗 Helpful Links

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

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

❌ 1 New Failure, 10 Pending, 4 Unrelated Failures

As of commit 3cf207a with merge base 4e29bc9 (image):

NEW FAILURE - The following job has failed:

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.

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported labels Jul 9, 2025
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D78034047

@github-actions
Copy link

github-actions bot commented Jul 9, 2025

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.

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D78034047

abhinaykukkadapu added a commit to abhinaykukkadapu/executorch that referenced this pull request Jul 11, 2025
… (pytorch#12319)

Summary:



Implements the RFC: pytorch#12248


1. `BackendRecipeProvider` -> Abstract interface that all backends must implement while providing recipes.
1. `recipe_registry` -> Singleton registry that maintains `BackendRecipeProviders`
1. `RecipeType` -> Abstract enum, backends extend this to provide support for specific recipes.
1. `ExportRecipe` will have two class methods
    a. `get_recipe` -> Queries registry to get recipe w/ specific backend

One can simply get and use recipes with:
## Using recipe as-is
```
recipe = ExportRecipe.get_recipe(
            XNNPackRecipeType.INT8_DYNAMIC_ACT_INT4_WEIGHT_PER_CHANNEL, 
            group_size=32)
export(eager_model, example_inputs, dynamic_shapes, recipe)
```

Differential Revision: D78034047
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D78034047

abhinaykukkadapu added a commit to abhinaykukkadapu/executorch that referenced this pull request Jul 11, 2025
… (pytorch#12319)

Summary:



Implements the RFC: pytorch#12248


1. `BackendRecipeProvider` -> Abstract interface that all backends must implement while providing recipes.
1. `recipe_registry` -> Singleton registry that maintains `BackendRecipeProviders`
1. `RecipeType` -> Abstract enum, backends extend this to provide support for specific recipes.
1. `ExportRecipe` will have two class methods
    a. `get_recipe` -> Queries registry to get recipe w/ specific backend

One can simply get and use recipes with:
## Using recipe as-is
```
recipe = ExportRecipe.get_recipe(
            XNNPackRecipeType.INT8_DYNAMIC_ACT_INT4_WEIGHT_PER_CHANNEL, 
            group_size=32)
export(eager_model, example_inputs, dynamic_shapes, recipe)
```

Differential Revision: D78034047
abhinaykukkadapu added a commit to abhinaykukkadapu/executorch that referenced this pull request Jul 11, 2025
… (pytorch#12319)

Summary:



Implements the RFC: pytorch#12248


1. `BackendRecipeProvider` -> Abstract interface that all backends must implement while providing recipes.
1. `recipe_registry` -> Singleton registry that maintains `BackendRecipeProviders`
1. `RecipeType` -> Abstract enum, backends extend this to provide support for specific recipes.
1. `ExportRecipe` will have two class methods
    a. `get_recipe` -> Queries registry to get recipe w/ specific backend

One can simply get and use recipes with:
## Using recipe as-is
```
recipe = ExportRecipe.get_recipe(
            XNNPackRecipeType.INT8_DYNAMIC_ACT_INT4_WEIGHT_PER_CHANNEL, 
            group_size=32)
export(eager_model, example_inputs, dynamic_shapes, recipe)
```

Differential Revision: D78034047
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D78034047

1 similar comment
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D78034047

abhinaykukkadapu added a commit to abhinaykukkadapu/executorch that referenced this pull request Jul 11, 2025
… (pytorch#12319)

Summary:
Pull Request resolved: pytorch#12319

Implements the RFC: pytorch#12248

1. `BackendRecipeProvider` -> Abstract interface that all backends must implement while providing recipes.
1. `recipe_registry` -> Singleton registry that maintains `BackendRecipeProviders`
1. `RecipeType` -> Abstract enum, backends extend this to provide support for specific recipes.
1. `ExportRecipe` will have two class methods
    a. `get_recipe` -> Queries registry to get recipe w/ specific backend

One can simply get and use recipes with:
## Using recipe as-is
```
recipe = ExportRecipe.get_recipe(
            XNNPackRecipeType.INT8_DYNAMIC_ACT_INT4_WEIGHT_PER_CHANNEL,
            group_size=32)
export(eager_model, example_inputs, dynamic_shapes, recipe)
```

Differential Revision: D78034047
@abhinaykukkadapu abhinaykukkadapu force-pushed the export-D78034047 branch 2 times, most recently from 748d555 to 9bef6f9 Compare July 11, 2025 23:54
abhinaykukkadapu added a commit to abhinaykukkadapu/executorch that referenced this pull request Jul 11, 2025
… (pytorch#12319)

Summary:



Implements the RFC: pytorch#12248


1. `BackendRecipeProvider` -> Abstract interface that all backends must implement while providing recipes.
1. `recipe_registry` -> Singleton registry that maintains `BackendRecipeProviders`
1. `RecipeType` -> Abstract enum, backends extend this to provide support for specific recipes.
1. `ExportRecipe` will have two class methods
    a. `get_recipe` -> Queries registry to get recipe w/ specific backend

One can simply get and use recipes with:
## Using recipe as-is
```
recipe = ExportRecipe.get_recipe(
            XNNPackRecipeType.INT8_DYNAMIC_ACT_INT4_WEIGHT_PER_CHANNEL, 
            group_size=32)
export(eager_model, example_inputs, dynamic_shapes, recipe)
```

Reviewed By: kimishpatel

Differential Revision: D78034047
abhinaykukkadapu added a commit to abhinaykukkadapu/executorch that referenced this pull request Jul 11, 2025
… (pytorch#12319)

Summary:



Implements the RFC: pytorch#12248


1. `BackendRecipeProvider` -> Abstract interface that all backends must implement while providing recipes.
1. `recipe_registry` -> Singleton registry that maintains `BackendRecipeProviders`
1. `RecipeType` -> Abstract enum, backends extend this to provide support for specific recipes.
1. `ExportRecipe` will have two class methods
    a. `get_recipe` -> Queries registry to get recipe w/ specific backend

One can simply get and use recipes with:
## Using recipe as-is
```
recipe = ExportRecipe.get_recipe(
            XNNPackRecipeType.INT8_DYNAMIC_ACT_INT4_WEIGHT_PER_CHANNEL, 
            group_size=32)
export(eager_model, example_inputs, dynamic_shapes, recipe)
```

Reviewed By: kimishpatel

Differential Revision: D78034047
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D78034047

abhinaykukkadapu added a commit to abhinaykukkadapu/executorch that referenced this pull request Jul 11, 2025
… (pytorch#12319)

Summary:



Implements the RFC: pytorch#12248


1. `BackendRecipeProvider` -> Abstract interface that all backends must implement while providing recipes.
1. `recipe_registry` -> Singleton registry that maintains `BackendRecipeProviders`
1. `RecipeType` -> Abstract enum, backends extend this to provide support for specific recipes.
1. `ExportRecipe` will have two class methods
    a. `get_recipe` -> Queries registry to get recipe w/ specific backend

One can simply get and use recipes with:
## Using recipe as-is
```
recipe = ExportRecipe.get_recipe(
            XNNPackRecipeType.INT8_DYNAMIC_ACT_INT4_WEIGHT_PER_CHANNEL, 
            group_size=32)
export(eager_model, example_inputs, dynamic_shapes, recipe)
```

Reviewed By: kimishpatel

Differential Revision: D78034047
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D78034047

abhinaykukkadapu added a commit to abhinaykukkadapu/executorch that referenced this pull request Jul 12, 2025
… (pytorch#12319)

Summary:
Pull Request resolved: pytorch#12319

Implements the RFC: pytorch#12248

1. `BackendRecipeProvider` -> Abstract interface that all backends must implement while providing recipes.
1. `recipe_registry` -> Singleton registry that maintains `BackendRecipeProviders`
1. `RecipeType` -> Abstract enum, backends extend this to provide support for specific recipes.
1. `ExportRecipe` will have two class methods
    a. `get_recipe` -> Queries registry to get recipe w/ specific backend

One can simply get and use recipes with:
## Using recipe as-is
```
recipe = ExportRecipe.get_recipe(
            XNNPackRecipeType.INT8_DYNAMIC_ACT_INT4_WEIGHT_PER_CHANNEL,
            group_size=32)
export(eager_model, example_inputs, dynamic_shapes, recipe)
```

Reviewed By: kimishpatel

Differential Revision: D78034047
@abhinaykukkadapu abhinaykukkadapu force-pushed the export-D78034047 branch 2 times, most recently from ecd11d3 to 0d7371b Compare July 12, 2025 00:08
abhinaykukkadapu added a commit to abhinaykukkadapu/executorch that referenced this pull request Jul 12, 2025
… (pytorch#12319)

Summary:
Pull Request resolved: pytorch#12319

Implements the RFC: pytorch#12248

1. `BackendRecipeProvider` -> Abstract interface that all backends must implement while providing recipes.
1. `recipe_registry` -> Singleton registry that maintains `BackendRecipeProviders`
1. `RecipeType` -> Abstract enum, backends extend this to provide support for specific recipes.
1. `ExportRecipe` will have two class methods
    a. `get_recipe` -> Queries registry to get recipe w/ specific backend

One can simply get and use recipes with:
## Using recipe as-is
```
recipe = ExportRecipe.get_recipe(
            XNNPackRecipeType.INT8_DYNAMIC_ACT_INT4_WEIGHT_PER_CHANNEL,
            group_size=32)
export(eager_model, example_inputs, dynamic_shapes, recipe)
```

Reviewed By: kimishpatel

Differential Revision: D78034047
… (pytorch#12319)

Summary:
Pull Request resolved: pytorch#12319

Implements the RFC: pytorch#12248

1. `BackendRecipeProvider` -> Abstract interface that all backends must implement while providing recipes.
1. `recipe_registry` -> Singleton registry that maintains `BackendRecipeProviders`
1. `RecipeType` -> Abstract enum, backends extend this to provide support for specific recipes.
1. `ExportRecipe` will have two class methods
    a. `get_recipe` -> Queries registry to get recipe w/ specific backend

One can simply get and use recipes with:
## Using recipe as-is
```
recipe = ExportRecipe.get_recipe(
            XNNPackRecipeType.INT8_DYNAMIC_ACT_INT4_WEIGHT_PER_CHANNEL,
            group_size=32)
export(eager_model, example_inputs, dynamic_shapes, recipe)
```

Reviewed By: kimishpatel

Differential Revision: D78034047
@facebook-github-bot
Copy link
Contributor

@abhinaykukkadapu has imported this pull request. If you are a Meta employee, you can view this in D78034047.

@abhinaykukkadapu abhinaykukkadapu merged commit 1fdebef into pytorch:main Jul 12, 2025
94 of 100 checks passed
@github-project-automation github-project-automation bot moved this from In progress to Done in ExecuTorch Core Jul 12, 2025
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

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants