[Bugfix] Ensure calculated KV scales are applied in attention. - #27232
Conversation
Signed-off-by: adabeyta <aabeyta@redhat.com>
There was a problem hiding this comment.
Code Review
This pull request correctly addresses a bug where calculated KV scales were not being applied during attention. The fix introduces a mechanism to calculate these scales on the first forward pass and then disables subsequent calculations by adding a state flag kv_scales_calculated to GPUModelRunner. The logic is sound and the changes are well-targeted. I've included one suggestion to refactor the implementation slightly, which will improve maintainability by removing a small piece of redundant logic.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
ProExpertProg
left a comment
There was a problem hiding this comment.
Thx for the fix, I got a suggestion to further simplify the logic
Signed-off-by: adabeyta <aabeyta@redhat.com>
|
Could you just sanity check with a deepseek model that it works with MLA too? |
ProExpertProg
left a comment
There was a problem hiding this comment.
Seems like there's a few more paths left over
Signed-off-by: adabeyta <aabeyta@redhat.com>
Signed-off-by: adabeyta <aabeyta@redhat.com>
Signed-off-by: adabeyta <aabeyta@redhat.com>
…ntion Signed-off-by: adabeyta <aabeyta@redhat.com>
|
This pull request has merge conflicts that must be resolved before it can be |
Signed-off-by: adabeyta <aabeyta@redhat.com> # Conflicts: # .buildkite/test-pipeline.yaml
ProExpertProg
left a comment
There was a problem hiding this comment.
Just a CI file merge note
Signed-off-by: adabeyta <aabeyta@redhat.com>
Signed-off-by: adabeyta <aabeyta@redhat.com>
Signed-off-by: adabeyta <aabeyta@redhat.com> (cherry picked from commit a5a790e)
…project#27232) Signed-off-by: adabeyta <aabeyta@redhat.com>
…project#27232) Signed-off-by: adabeyta <aabeyta@redhat.com>
…project#27232) Signed-off-by: adabeyta <aabeyta@redhat.com>
…project#27232) Signed-off-by: adabeyta <aabeyta@redhat.com> (cherry picked from commit a5a790e)
…project#27232) Signed-off-by: adabeyta <aabeyta@redhat.com>
…project#27232) Signed-off-by: adabeyta <aabeyta@redhat.com>
Purpose:
Resolves bug #27102 .
Test Plan:
Throughput
E2E Correctness
Server with KV scale calculation ON (remove --calculate-kv-scales flag for OFF case):
lm_eval
Throughput results
Main:calculate_kv_scales=False | enforce_eager=False
Main:calculate_kv_scales=True | enforce_eager=False
Main: calulate_kv_scales=True | enforce_eager=True
PR: calculate_kv_scales=False | enforce_eager=False
PR: calculate_kv_scales=True | enforce_eager=False
PR: calulate_kv_scales=True | enforce_eager=True
E2E GSM8K Accuracy Results
Main: calulate_kv_scales=False | enforce_eager=False
Main: calulate_kv_scales=True | enforce_eager=False
Main: calulate_kv_scales=True | enforce_eager=True
PR: calculate_kv_scales=False | enforce_eager=False
PR: calculate_kv_scales=True | enforce_eager=False
PR: calulate_kv_scales=True | enforce_eager=True