Skip to content

Add support to use config dtype in HybridChunkedCache #38908

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

vivekkhandelwal1
Copy link
Contributor

@vivekkhandelwal1 vivekkhandelwal1 commented Jun 19, 2025

What does this PR do?

This PR fixes the issue with the HybridChunkedCache initialisation since it does not consider the dtype present in the model config. Here:

self._dtype = dtype

Signed-off-by: Vivek Khandelwal <vivekkhandelwal1424@gmail.com>
@vivekkhandelwal1
Copy link
Contributor Author

Hi @ydshieh @Rocketknight1! It would be great if you can find some time to review this change.

@Rocketknight1
Copy link
Member

cc @gante

@vivekkhandelwal1
Copy link
Contributor Author

Hi @gante, can you please review this PR?

@gante
Copy link
Member

gante commented Jun 23, 2025

Hi @vivekkhandelwal1

I don't think this is the right solution: config.torch_dtype may be out of sync with the model's actual dtype, e.g. when we manually cast a model with model.to(torch.XX) after loading it.

Would you be able to expand the description of the issue you're seeing? I might be able to provide solutions 🤗

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.

3 participants