Prerequisites
Feature Description
Add support for GLM 5.2, which makes use of sparse attention acceleration by skipping top-k index calculation for some layers
Motivation
GLM 5.2 is currently the top ranked open weights model.
Possible Implementation
The main change since 5.1 seems to be the sparse sparse attention, specifically the index_skip_topk_offset: 3 and index_topk_freq: 4 which signal that the sparse attention is only recalculated every 4 layers after the first 3, while in GLM 5.1 it was calculated every layer. A indexer_types: [...] is provided, but seems to just codify the offset+freq.
(I would figure this is being worked on, but I couldn't find any discussion, PR, or issue so I figured I would make one. If no one is actually looking into it, I could give it a shot at some point today.)
Prerequisites
Feature Description
Add support for GLM 5.2, which makes use of sparse attention acceleration by skipping top-k index calculation for some layers
Motivation
GLM 5.2 is currently the top ranked open weights model.
Possible Implementation
The main change since 5.1 seems to be the sparse sparse attention, specifically the
index_skip_topk_offset: 3andindex_topk_freq: 4which signal that the sparse attention is only recalculated every 4 layers after the first 3, while in GLM 5.1 it was calculated every layer. Aindexer_types: [...]is provided, but seems to just codify the offset+freq.(I would figure this is being worked on, but I couldn't find any discussion, PR, or issue so I figured I would make one. If no one is actually looking into it, I could give it a shot at some point today.)