Skip to content

Conversation

@deepcharm
Copy link
Contributor

The KV cache can be passed via layer_past or past_key_value arguments. Previously, past_key_value was ignored, causing workload incompatibilities.

This PR fixes the issue while preserving the original logic.

The KV cache can be passed via `layer_past` or `past_key_value`
arguments. Previously, `past_key_value` was ignored, causing
workload incompatibilities.

This PR fixes the issue while preserving the original logic.

Signed-off-by: Max Kovalenko <[email protected]>
@deepcharm
Copy link
Contributor Author

While reviewing this change, we also noted a possible existing bug, such that self.layer_last is not used at even iterations, since the layer_last argument is overwritten. We fixed it by using a local var name _layer_last and preserving the passed argument value.

Should it be a separate PR maybe?

@sfc-gh-truwase
Copy link
Collaborator

While reviewing this change, we also noted a possible existing bug, such that self.layer_last is not used at even iterations, since the layer_last argument is overwritten. We fixed it by using a local var name _layer_last and preserving the passed argument value.

Thanks for providing this fix.

Should it be a separate PR maybe?

Yes, it would be better as a separate PR.

@sfc-gh-truwase sfc-gh-truwase merged commit 88ba24a into deepspeedai:master Jul 14, 2025
9 checks passed
lpnpcs pushed a commit to lpnpcs/DeepSpeed that referenced this pull request Jul 30, 2025
The KV cache can be passed via `layer_past` or `past_key_value`
arguments. Previously, `past_key_value` was ignored, causing workload
incompatibilities.

This PR fixes the issue while preserving the original logic.

---------

Signed-off-by: Max Kovalenko <[email protected]>
LYMDLUT pushed a commit to LYMDLUT/DeepSpeed that referenced this pull request Aug 20, 2025
The KV cache can be passed via `layer_past` or `past_key_value`
arguments. Previously, `past_key_value` was ignored, causing workload
incompatibilities.

This PR fixes the issue while preserving the original logic.

---------

Signed-off-by: Max Kovalenko <[email protected]>
Signed-off-by: lym <[email protected]>
mauryaavinash95 pushed a commit to DataStates/DeepSpeed that referenced this pull request Oct 4, 2025
The KV cache can be passed via `layer_past` or `past_key_value`
arguments. Previously, `past_key_value` was ignored, causing workload
incompatibilities.

This PR fixes the issue while preserving the original logic.

---------

Signed-off-by: Max Kovalenko <[email protected]>
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