Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow to skip loading model weights in build_model() #630

Closed

Conversation

stephenyan1231
Copy link
Contributor

Summary:
Currently, in runner build_model() method, when eval_only=True, we always try to load model weights.
This is quite restricted in some cases. For example, we may just wanna build a model in eval mode to profile its efficiency, and we have not trained the model or generated the model weights in a checkpoint file.

Thus, this diff adds an argument skip_model_weights to allow users to skip the loading of model weights.
Note, this diff is entirely back-compatible and is NOT expected to break existing implementations.

Differential Revision: D50623772

@facebook-github-bot facebook-github-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 24, 2023
@facebook-github-bot
Copy link
Contributor

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

@facebook-github-bot
Copy link
Contributor

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

@facebook-github-bot
Copy link
Contributor

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

@facebook-github-bot
Copy link
Contributor

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

@facebook-github-bot
Copy link
Contributor

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

@facebook-github-bot
Copy link
Contributor

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

@facebook-github-bot
Copy link
Contributor

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

@facebook-github-bot
Copy link
Contributor

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

@facebook-github-bot
Copy link
Contributor

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

Summary:

Currently, in runner **build_model()** method, when **eval_only=True**, we always try to load model weights.
This is quite restricted in some cases. For example, we may just wanna build a model in eval mode to profile its efficiency, and we have not trained the model or generated the model weights in a checkpoint file.

Thus, this diff adds an argument **skip_model_weights** to allow users to skip the loading of model weights.
Note, this diff is entirely back-compatible and is NOT expected to break existing implementations.

Reviewed By: navsud, wat3rBro

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

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

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in f2a0c52.

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 Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants