Skip to content

Add support to use config dtype in HybridChunkedCache#38908

Open
vivekkhandelwal1 wants to merge 1 commit into
huggingface:mainfrom
vivekkhandelwal1:fix-hybridchunkedcache-dtype
Open

Add support to use config dtype in HybridChunkedCache#38908
vivekkhandelwal1 wants to merge 1 commit into
huggingface:mainfrom
vivekkhandelwal1:fix-hybridchunkedcache-dtype

Conversation

@vivekkhandelwal1

@vivekkhandelwal1 vivekkhandelwal1 commented Jun 19, 2025

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor Author

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

@Rocketknight1

Copy link
Copy Markdown
Member

cc @gante

@vivekkhandelwal1

Copy link
Copy Markdown
Contributor Author

Hi @gante, can you please review this PR?

@gante

gante commented Jun 23, 2025

Copy link
Copy Markdown
Contributor

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