-
Notifications
You must be signed in to change notification settings - Fork 30
Add test case for cache #20
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
base: main
Are you sure you want to change the base?
Add test case for cache #20
Conversation
9a85871 to
0e07855
Compare
tests/models/test_decoders.py
Outdated
| print("passed validation level 0") | ||
|
|
||
| @pytest.mark.parametrize("model_path,batch_size,seq_length,max_new_tokens,cache_status", cache_params) | ||
| def test_cache(model_path, batch_size, seq_length, max_new_tokens, cache_status): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need to parametrize everything here other than the miss and hit. Just specify them inside the test.
| None, | ||
| only_last_token=True, | ||
| **padding_kwargs | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there something we need to assert for miss/hit?
JRosenkranz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may want to create a fixture which turns caching on, and caches the compilation. Then in the test we can re-run with caching on/off to make sure we see a hit or no-cache used
Signed-off-by: Avery Blanchard <[email protected]>
0e07855 to
87b3ac8
Compare
6a6fe67 to
2580699
Compare
JRosenkranz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to re-use the current test_common_shapes test but drive the option to use caching with an environment variable?
This PR adds a test case for caching.
The test case runs twice with a single shape. The caching feature is enabled during the test and disabled after on reset.
cc: @JRosenkranz