Open michael-heinrich opened 1 month ago
I see. Thanks! Could you submit a PR?
Thanks for this smart fix. @michael-heinrich : Do you see a similar workaround to provide backwards compatibility to awq/kernels as well for running VILA using AWQ & TinyChat?
This will help to run video inference demo on ancient GPUs faster ;-)
Refer: https://github.com/mit-han-lab/llm-awq/
At present, the installation of awq/kernels fails due to following error
Feature '.m16n8k16' requires .target sm_80 or higher
Thanks for this smart fix. @michael-heinrich : Do you see a similar workaround to provide backwards compatibility to awq/kernels as well for running VILA using AWQ & TinyChat?
This will help to run video inference demo on ancient GPUs faster ;-)
Refer: https://github.com/mit-han-lab/llm-awq/
At present, the installation of awq/kernels fails due to following error
Feature '.m16n8k16' requires .target sm_80 or higher
I will definitely look into it. Last night I already spent a few hours on getting the AWQ quants running, but no luck so far. From the source code / documentation of the transformers library, it appears to have AWQ support built in and with a few changes to the HF repo, I could partially load the AWQ checkpoint using the video inference demo. However, in the end the shapes of the tensors did not match. But maybe it's possible to load it like this. In the end, I was not sure that's even remotely the right direction. Transformers also allows to quantize a model when loading using bitsandbytes. That might work on an older card but would not have the accuracy of an AWQ quant.
Your version of transformers forces LlamaFlashAttention2 in the constructor of LlamaDecoderLayer in transformers/models/llama/modeling_llama.py which requires Ampere or newer to work. Just by using the old LlamaAttention class instead of LlamaFlashAttention2 here, I could make the video inference demo run on an ancient GTX1060 (even if it's very slow). The current main branch of transformers uses a mechanism to decide which is the best compatible attention for this purpose. If you don't want to backport that, you could use a very simple logic to decide which class to use here. Something like this:
`