Skip to content
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

Regarding Quantization Of The KV Cache #3

Open
akshatsh49 opened this issue Feb 5, 2025 · 0 comments
Open

Regarding Quantization Of The KV Cache #3

akshatsh49 opened this issue Feb 5, 2025 · 0 comments

Comments

@akshatsh49
Copy link

Hi,

Thank you for sharing the paper and the accompanying code—it’s been an insightful read!

I had a few questions regarding the implementation of the KV cache in Q-Hitter, particularly its size and quantization:

  1. Paper vs. Code Discrepancy:
    The pseudocode in the paper mentions that the KV values are quantized and stored in the KV cache. However, while reviewing the code (specifically modify_llama.py), it appears that the KV values are retained in fp16 format. The 4-bit reduced version of the tensors seems to be used only within the q_score function and is discarded afterward.

  2. Throughput Improvement:
    If the KV values are indeed stored in fp16 and not quantized in the cache, could you clarify where the throughput improvement originates? I’m particularly interested in understanding how the 4-bit quantization in the q_score function contributes to the overall performance gains.

Thank you for your time. I look forward to your response.

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

No branches or pull requests

1 participant