Add prefil decode in expectations#452
Add prefil decode in expectations#452nirajkamal wants to merge 22 commits intofoundation-model-stack:mainfoundation-model-stack/foundation-model-stack:mainfrom nirajkamal:Add_Prefil_Decode_in_Expectationsnirajkamal/foundation-model-stack:Add_Prefil_Decode_in_ExpectationsCopy head branch name to clipboard
Conversation
JRosenkranz
left a comment
There was a problem hiding this comment.
@nirajkamal This is a great start, I think we will want to separate test_model_output and test_model_generation into 2 separate tests that both capture different output. test_model_output would continue to get the signature from model forward, whereas test_model_generation would get some compressed form of the logits from prefill + decode.
JRosenkranz
left a comment
There was a problem hiding this comment.
Once a new model test is added specifically for generation, as part of this PR can you capture expectations for the generation test
|
@JRosenkranz @ani300 I tried to resolve all the comments - If possible please look into it. Also need help capturing logits with bamba model. If possible please try. (was moving cities and school start thus the delay) Ill add captured logits once everything is okay! |
ede30f8 to
06e8ad8
Compare
|
I tried to rebase to resolve a signoff check - seems like it messes up the PR. Please let me know if the code looks okay, will make a clean branch from main to push the changes. |
06e8ad8 to
ede30f8
Compare
Overview
This PR introduces a modular and approach to model testing by separating forward pass and generation tests. It adds the handling of generative models (e.g., causal language models like LLaMA) while maintaining compatibility for non-generative models.
Changes
1. Test Structure Refactoring
test_model_forward(): Tests only the forward pass signature (renamed fromtest_model_output).test_model_generation(): New dedicated test for generation testing (1 prefill + 1 decode).test_model_output(): Maintained for backward compatibility, delegates totest_model_forward().2. Generation Testing
_supports_generation: Class attribute to enable generation testing (set toTruein test classes)._get_generation_signature():generate()with greedy sampling.get_signature()(max-min normalization).3. Independent Expectation Files
models.test_llama.TestLlama2.test_model_forward.models.test_llama.TestLlama2.test_model_generation.Usage
Capture New Expectations
Test
@spzala @JRosenkranz