Skip to content

Conversation

@avery-blanchard
Copy link
Contributor

@avery-blanchard avery-blanchard commented Apr 8, 2025

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

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):
Copy link
Contributor

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
)
Copy link
Contributor

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?

Copy link
Contributor

@JRosenkranz JRosenkranz left a 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]>
Copy link
Contributor

@JRosenkranz JRosenkranz left a 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?

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