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

Simplify testing of models to minimize extra code #52

Merged
merged 1 commit into from
Jul 30, 2024
Merged

Conversation

kevinwuTT
Copy link
Contributor

  • Add Pytest autouse fixture that compiles a model and records metrics for original and compiled run
    • Models no longer need to import ttnn or torch_ttnn modules
    • Models will need to register a few lines of information for this fixture to work
  • Simplify the collect metrics script
    • No longer need to hard-code a map of model paths
    • No longer need to import output artifacts to calculate accuracy
      • Accuracy is calculated in the pytest fixture directly

@kevinwuTT kevinwuTT requested a review from ayerofieiev-tt July 30, 2024 20:05
Copy link
Member

@ayerofieiev-tt ayerofieiev-tt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Goooood sign!
Screenshot 2024-07-30 at 1 07 16 PM

@@ -15,3 +22,61 @@ def reset_torch_dynamo():
# PyTorch caches models. Start a fresh compile for each parameter of the test case.
torch._dynamo.reset()
yield


@pytest.fixture(autouse=True)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does autouse apply it to lowering tests too?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked on a call. Yes.
We agreed it is ok for now.
We agreed this will go away during the next step.

@kevinwuTT kevinwuTT added this pull request to the merge queue Jul 30, 2024
Merged via the queue into main with commit 72796c3 Jul 30, 2024
1 check passed
@kevinwuTT kevinwuTT deleted the kw/test_infra branch July 30, 2024 20:49
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.

2 participants