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

Added support for intermediate golden verification in forward pass only #1406

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dgolubovicTT
Copy link
Contributor

@dgolubovicTT dgolubovicTT commented Mar 7, 2025

Closes #1405

  • Added support for intermediate golden verification in forward pass only
  • Added few simple tests in forge/test/mlir/test_golden_verification.py, more to come with backward support.

Ticket

Link to Github Issue

There are two scopes of graph verification:

  1. 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.

  2. 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)

Added few simple tests in forge/test/mlir/test_golden_verification.py, more to come with backward support.
@dgolubovicTT dgolubovicTT requested review from vkovinicTT, pilkicTT and nvukobratTT and removed request for nvukobratTT and pilkicTT March 7, 2025 17:41
@dgolubovicTT dgolubovicTT self-assigned this Mar 7, 2025
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 0% with 12 lines in your changes missing coverage. Please review.

Project coverage is 43.60%. Comparing base (c80672e) to head (e19287c).

Files with missing lines Patch % Lines
forge/csrc/graph_lib/python_bindings.cpp 0.00% 12 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1406      +/-   ##
==========================================
+ Coverage   43.40%   43.60%   +0.19%     
==========================================
  Files          48       48              
  Lines        7860     7822      -38     
==========================================
- Hits         3412     3411       -1     
+ Misses       4448     4411      -37     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

github-actions bot commented Mar 7, 2025

TestsPassed ☑️Skipped ⚠️Failed ❌️
TT-Forge-FE Tests634 ran485 passed144 skipped5 failed
TestResult
TT-Forge-FE Tests
pytest
test_eltwise_unary.test_nan_to_num[shape4-dtype4]❌ failure
test_eltwise_unary.test_nan_to_num[shape6-dtype6]❌ failure
test_nn.test_avgpool3d[shape1-kernel_size1-stride1]❌ failure
test_nn.test_avgpool3d[shape3-kernel_size3-stride3]❌ failure
test_nn.test_avgpool3d[shape5-kernel_size5-stride5]❌ failure

1 similar comment
Copy link

github-actions bot commented Mar 7, 2025

TestsPassed ☑️Skipped ⚠️Failed ❌️
TT-Forge-FE Tests634 ran485 passed144 skipped5 failed
TestResult
TT-Forge-FE Tests
pytest
test_eltwise_unary.test_nan_to_num[shape4-dtype4]❌ failure
test_eltwise_unary.test_nan_to_num[shape6-dtype6]❌ failure
test_nn.test_avgpool3d[shape1-kernel_size1-stride1]❌ failure
test_nn.test_avgpool3d[shape3-kernel_size3-stride3]❌ failure
test_nn.test_avgpool3d[shape5-kernel_size5-stride5]❌ failure

Copy link

github-actions bot commented Mar 7, 2025

TestsPassed ☑️Skipped ⚠️Failed ❌️
TT-Forge-FE Tests693 ran548 passed139 skipped6 failed
TestResult
TT-Forge-FE Tests
pytest
test_eltwise_unary.test_nan_to_num[shape1-dtype1]❌ failure
test_eltwise_unary.test_nan_to_num[shape7-dtype7]❌ failure
test_nn.test_avgpool3d[shape0-kernel_size0-stride0]❌ failure
test_nn.test_avgpool3d[shape2-kernel_size2-stride2]❌ failure
test_nn.test_avgpool3d[shape4-kernel_size4-stride4]❌ failure
test_nn.test_avgpool3d[shape6-kernel_size6-stride6]❌ failure

1 similar comment
Copy link

github-actions bot commented Mar 7, 2025

TestsPassed ☑️Skipped ⚠️Failed ❌️
TT-Forge-FE Tests693 ran548 passed139 skipped6 failed
TestResult
TT-Forge-FE Tests
pytest
test_eltwise_unary.test_nan_to_num[shape1-dtype1]❌ failure
test_eltwise_unary.test_nan_to_num[shape7-dtype7]❌ failure
test_nn.test_avgpool3d[shape0-kernel_size0-stride0]❌ failure
test_nn.test_avgpool3d[shape2-kernel_size2-stride2]❌ failure
test_nn.test_avgpool3d[shape4-kernel_size4-stride4]❌ failure
test_nn.test_avgpool3d[shape6-kernel_size6-stride6]❌ failure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enable intermediate verification in forward pass
2 participants