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

fix: distingush engines based on compilation settings in addition to … #3155

Merged
merged 11 commits into from
Sep 12, 2024

Conversation

narendasan
Copy link
Collaborator

Description

Adds distinguishing base on shape and compile settings to the engine cache

Fixes #3148

Type of change

Please delete options that are not relevant and/or add your own.

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code follows the style guidelines of this project (You can use the linters)
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas and hacks
  • I have made corresponding changes to the documentation
  • I have added tests to verify my fix or my feature
  • New and existing unit tests pass locally with my changes
  • I have added the relevant labels to my PR in so that relevant reviewers are notified

@github-actions github-actions bot added component: tests Issues re: Tests component: conversion Issues re: Conversion stage component: api [Python] Issues re: Python API component: runtime component: dynamo Issues relating to the `torch.compile` or `torch._dynamo.export` paths labels Sep 11, 2024
class TestEngineCache(TestCase):

@pytest.mark.xfail
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

These main disk engine cache tests are super flaky, it seems like the cache is working properly so im not sure what is going on.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We need some method other than timing to measure if its working, or we need some extreme case so it doesnt randomly fail all the time

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@zewenli98 I think xfail is fine for now but really we should test the diskenginecache directly, i.e. get a hash, put in an entry and try to pull it and see if the entries match / if when run with different weights behave as expected

for h, count in custom_engine_cache.hashes.items()
]

@pytest.mark.xfail
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

""

py/torch_tensorrt/dynamo/_engine_cache.py Outdated Show resolved Hide resolved
py/torch_tensorrt/dynamo/_engine_cache.py Outdated Show resolved Hide resolved
py/torch_tensorrt/dynamo/utils.py Outdated Show resolved Hide resolved
py/torch_tensorrt/dynamo/_engine_cache.py Show resolved Hide resolved
tests/py/dynamo/models/test_engine_cache.py Outdated Show resolved Hide resolved
@narendasan
Copy link
Collaborator Author

@lanluo-nvidia once this PR is merged can you cherry-pick into 2.5

Copy link
Collaborator

@peri044 peri044 left a comment

Choose a reason for hiding this comment

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

LGTM

@narendasan narendasan merged commit 2be2e64 into main Sep 12, 2024
67 checks passed
@narendasan narendasan deleted the settings_hash branch September 12, 2024 21:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla signed component: api [Python] Issues re: Python API component: conversion Issues re: Conversion stage component: dynamo Issues relating to the `torch.compile` or `torch._dynamo.export` paths component: runtime component: tests Issues re: Tests needs-release-cherrypick
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐛 [Bug] Engine cache does not take shape change into account
4 participants