Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

expose example_input argument in setup_qat_model() #647

Closed

Conversation

stephenyan1231
Copy link
Contributor

Summary:
Major changes

  • example_input argument in prepare_fake_quant_model() is useful in certain cases. For example, in Argos model custom_prepare_fx() method under FX graph + QAT setup (D52760682), it is used to prepare example inputs to individual sub-modules by running one forward pass and bookkeeping the inputs to individual sub-modules. Therefore, we export argument example_input in setup_qat_model() function.
  • For QAT model, currently we assert # of state dict keys (excluding observers) should be equal to # of state dict keys in the original model. However, when the assertion fails, it does not log useful information for debugging. We make changes to report what are the unique keys in each state dict.

Differential Revision: D52760688

@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 Jan 15, 2024
@facebook-github-bot
Copy link
Contributor

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

@facebook-github-bot
Copy link
Contributor

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

@facebook-github-bot
Copy link
Contributor

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

@facebook-github-bot
Copy link
Contributor

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

@facebook-github-bot
Copy link
Contributor

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

@facebook-github-bot
Copy link
Contributor

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

@facebook-github-bot
Copy link
Contributor

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

Summary:

Major changes
- **example_input** argument in **prepare_fake_quant_model()** is useful in certain cases. For example, in Argos model **custom_prepare_fx()** method under FX graph + QAT setup (D52760682), it is used to prepare example inputs to individual sub-modules by running one forward pass and bookkeeping the inputs to individual sub-modules. Therefore, we export argument **example_input** in **setup_qat_model()** function.
- For QAT model, currently we assert # of state dict keys (excluding observers) should be equal to # of state dict keys in the original model. However, when the assertion fails, it does not log useful information for debugging. We make changes to report what are the unique keys in each state dict.

Reviewed By: navsud

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

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

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 3c6f71b.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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