-
Notifications
You must be signed in to change notification settings - Fork 31
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
[BugFix]add int8 cache dtype when using attention quantization #128
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: angazenn <[email protected]>
Signed-off-by: angazenn <[email protected]>
Signed-off-by: angazenn <[email protected]>
# dtype string to torch.dtype. Hence we have to move these codes to here. | ||
from vllm.utils import STR_DTYPE_TO_TORCH_DTYPE | ||
self.cache_config.cache_dtype = 'int8' | ||
STR_DTYPE_TO_TORCH_DTYPE['int8'] = torch.int8 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does vllm originally has entrypoints to resgister custom quant types into STR_DTYPE_TO_TORCH_DTYPE? If not, maybe we need to make this an issue to vllm? @wangxiyuan please check this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, we can create a pr to vllm later.
Currenlty. for this kind of change(Monkey patch), please move it to the patch module.
CI failed due to the test path update in vLLM, will fix in #124 |
Signed-off-by: angazenn <[email protected]>
Signed-off-by: angazenn <[email protected]>
STR_DTYPE_TO_TORCH_DTYPE is defined in vllm.utils:
Hence we need to update both cache_dtype and STR_DTYPE_TO_TORCH_DTYPE.
self
of layer. When initializing ascend attention quant method,num_heads
,head_size
,num_kv_heads
are required. However, in the codes of Attention.init from vLLM, these member variables are set after initialization of quant method. Hence we have to move these codes ahead of quant method.