model: add dots3-note - #27060
Conversation
| const bool has_swa = swa_type != LLAMA_SWA_TYPE_NONE; | ||
|
|
||
| const layer_filter_cb filter_mla_full = [&](int32_t il) { | ||
| if (filter_mla && !filter_mla(il)) { | ||
| return false; | ||
| } | ||
|
|
||
| return !(has_swa && model.hparams.is_swa(il)); | ||
| }; | ||
|
|
||
| const layer_filter_cb filter_mla_swa = [&](int32_t il) { | ||
| if (filter_mla && !filter_mla(il)) { | ||
| return false; | ||
| } | ||
|
|
||
| return model.hparams.is_swa(il); | ||
| }; | ||
|
|
There was a problem hiding this comment.
CC @fairydreaming @ggerganov , I think adding SWA to DSA cache is not too invasive, do you think it's ok to keep this change as-is?
There was a problem hiding this comment.
@ngxson From my understanding SWA in Dots3 is for non-DSA layers (they are ordinary MLA layers that don't use lightning indexer at all), so the cleanest solution that follows other memory classes would be probably to create llama_kv_cache_dsa_iswa class that would combine llama_kv_cache_dsa instance for DSA layers and llama_kv_cache instance for SWA layers.
There was a problem hiding this comment.
that makes sense, I moved the logic to a new llama_kv_cache_dsa_iswa, PTAL: d9de2b2
|
I think this PR is ready to be reviewed as-is 2 follow-up PRs planned: multimodal (see xsn/dots3-note...xsn/dots3-note-mtmd) and MTP support (TODO) |
* text: conversion * init impl * address review comments * fix rope * move to a new llama_kv_cache_dsa_iswa
* text: conversion * init impl * address review comments * fix rope * move to a new llama_kv_cache_dsa_iswa
Implement `seq_token_count` for the new upstream `llama_kv_cache_dsa_iswa` wrapper. Fixes: 5a32f7b ("model: add dots3-note (ggml-org#27060)") Signed-off-by: JenySadadia <jeny.sadadia@collabora.com>
Implement `seq_token_count` for the new upstream `llama_kv_cache_dsa_iswa` wrapper. Fixes: 5a32f7b ("model: add dots3-note (ggml-org#27060)") Signed-off-by: JenySadadia <jeny.sadadia@collabora.com>
Implement `seq_token_count` for the new upstream `llama_kv_cache_dsa_iswa` wrapper. Fixes: 5a32f7b ("model: add dots3-note (ggml-org#27060)") Signed-off-by: JenySadadia <jeny.sadadia@collabora.com>
Implement `seq_token_count` for the new upstream `llama_kv_cache_dsa_iswa` wrapper. Fixes: 5a32f7b ("model: add dots3-note (ggml-org#27060)") Signed-off-by: JenySadadia <jeny.sadadia@collabora.com>
Implement `seq_token_count` for the new upstream `llama_kv_cache_dsa_iswa` wrapper. Fixes: 5a32f7b ("model: add dots3-note (ggml-org#27060)") Signed-off-by: JenySadadia <jeny.sadadia@collabora.com>

Overview
Support https://huggingface.co/dots-studio/dots3-note-prev
Ref HF impl: huggingface/transformers#47844
So far, the biggest change is DSA + SWA, so the
llama-kv-cache-dsahad to be extendedAdditional information
This PR was tested with a slice (3 layers, 16 experts) from the real weight. Other configs and tokenizer stay unchanged
Logits validation (passed --> good/acceptable NMSE):
TODO:
llama-kv-cache-dsais okRequirements