Make the quantized path the main testing path, and introduce a nop quantizer for fp32 cases #7915
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary:
For a while, testing APIs were
quantize_and_run
andrun_and_verify
, with the former calling the latter. That flow is a bit inconvenient since the quantized and fp32 cases are not consistent, and the names are also inconsistent.This diff changes the two main APIs to become
export_run_and_verify
andquantize_export_run_and_verify
to be more descriptive.It also changes the calling order; we now use a nop quantizer for the fp32 case, allowing us to use the exact same flow as the quantized cases.
The existing
run_and_verify
function is made "private" (as far as python goes at least) and now takes in anExportedProgram
instead of thetorch.nn.Module
before.Finally, it removes the
eval()
part ofexport_program
, since now everything should go through the quantizer (including as a nop).Reviewed By: zonglinpeng, hsharma35
Differential Revision: D67561806