Skip to content

Conversation

@cbalioglu
Copy link
Contributor

This PR:

(1) Makes StandardRecipeModel, DDPModel, FSDP1Model, and FSDP2Model subclasses of RecipeModel public.
(2) Replaces RecipeModel.family which was of type ModelFamily with RecipeModel.family_name which is of type str. This makes it a lot easier to use fairseq2 Trainer, Evaluator, and Validator classes with arbitrary PyTorch modules without having to define a corresponding family.
(3) Exposes "as" methods in RecipeModel, RecipeDataset, and RecipeTokenizer as helpers to safely cast assets to their actual type during runtime.

Important Note: This PR introduces a potential BC breaking change in that it replaces RecipeModel.family with RecipeModel.family_name to decouple RecipeModel and ModelFamily types. Since RecipeModel.family has been an advanced API released in v0.5, it is likely not used broadly. As long as we can guarantee that no internal repo breaks due to this change, I am okay with merging it by clearly documenting RecipeModel as experimental. If anyone has concerns, please let me know.

@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 Oct 20, 2025
@zyaoj
Copy link
Contributor

zyaoj commented Oct 29, 2025

Just leaving a landmark here -- this branch is tested from SeamlessNext in this draft PR and the interface looks great. I believe moving this PR forward and exposing these classes and interfaces will largely facilitate research on modelling.

@cbalioglu
Copy link
Contributor Author

Taking a more long-term approach in #1401

@cbalioglu cbalioglu closed this Nov 3, 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants