Added support for intermediate golden verification in forward pass only #1406
+186
−150
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.
Closes #1405
Ticket
Link to Github Issue
There are two scopes of graph verification:
First scope is verifying graph between compile stages. This enables us to detect in which stage of compile data mismatch occurs.
We can now set which compile stages to verify using:
STAGES_TO_PERFORM_INTERMEDIATE_VERIFICATION
env variable. Specify the compile stages to perform verification in comma separated manner:STAGES_TO_PERFORM_INTERMEDIATE_VERIFICATION=OPTIMIZED_GRAPH, PRE_LOWERING_PASS
Also, setting
FORGE_FORCE_VERIFY_ALL=1
will do verification for all compile stages.Second scope is verifying each intermediate tensor as opposed to verifying only outputs. This will enable us to locate where exactly data mismatch occurs in the graph.
By setting
FORGE_OP_LEVEL_COMPARISON=1
intermediate golden outputs will be compared with intermediate graph outputs. Without setting this variable, verification will be done only on outputs (for compile stages chosen like explained above)