Traceary

Catalog / llama.cpp

b10514

6 days agoaddedfixedremovedOriginal notes

model : GraniteSWAForCausalLM / GraniteMoeSWAForCausalLM (#25505)

  • feat(convert): Add conversion for GraniteSWAForCausalLM

Branch: GraniteSWAForCausalLM AI-usage: full (Bob, OpenCode + Qwen3.6-35b) Signed-off-by: Gabe Goodhart [email protected]

  • feat(llama): Add granite_swa support

Branch: GraniteSWAForCausalLM AI-usage: full (Bob, OpenCode + Qwen3.6-35b) Signed-off-by: Gabe Goodhart [email protected]

  • feat(conversion): Add conversion infra for rope_pattern array

NOTE: There is other work also targeting this, so this may be removed depending on merge order.

Branch: GraniteSWAForCausalLM AI-usage: full (Bob) Signed-off-by: Gabe Goodhart [email protected]

  • fix(conversion): Fix SWA pattern logic and support for non-rope layers

Branch: GraniteSWAForCausalLM AI-usage: full (Bob) Signed-off-by: Gabe Goodhart [email protected]

  • feat(conversion): Add support for GraniteMoeSWA

Branch: GraniteSWAForCausalLM AI-usage: full (Bob) Signed-off-by: Gabe Goodhart [email protected]

  • feat: Add llama_hparams::has_rope and arch constants

NOTE: This shadows the work done for Granite Speech https://github.com/ggml-org/llama.cpp/pull/25107

Branch: GraniteSWAForCausalLM AI-usage: full (Bob) Signed-off-by: Gabe Goodhart [email protected]

  • feat: Add support for per-layer rope determination

Branch: GraniteSWAForCausalLM AI-usage: full (Bob) Signed-off-by: Gabe Goodhart [email protected]

  • style: Fix failing flake8 for extra newlines

Branch: GraniteSWAForCausalLM AI-usage: none Signed-off-by: Gabe Goodhart [email protected]

  • test: Write out SLIDING_WINDOW_PATTERN in llama-model-saver

Branch: GraniteSWAForCausalLM AI-usage: full (OpenCode + Qwen3.6-35b) Signed-off-by: Gabe Goodhart [email protected]

  • fix(convert): Fix missing registration for GraniteMoeSWAForCausalLM

Branch: GraniteSWAForCausalLM AI-usage: none Signed-off-by: Gabe Goodhart [email protected]

  • fix: Load MoE params as optional

Branch: GraniteSWAForCausalLM AI-usage: draft (OpenCode + Qwen3.6-35b) Signed-off-by: Gabe Goodhart [email protected]

  • feat: Handle MoE params in conversion

branch: GraniteSWAForCausalLM AI-usage: full (OpenCode + Qwen3.6-35b) Signed-off-by: Gabe Goodhart [email protected]

  • style: Remove unnecessary newline

AI-usage: none Signed-off-by: Gabe Goodhart [email protected]

  • fix: Remove unnecessary tensor additions to GRANITE architecture

Branch: GraniteSWAForCausalLM AI-usage: none Signed-off-by: Gabe Goodhart [email protected]

  • fix: Correctly handle naming for ffn gate inp

Branch: GraniteSWAForCausalLM AI-usage: none Signed-off-by: Gabe Goodhart [email protected]

  • fix: Always default hparams.rope_pattern to 1s

This isn't strictly necessary, but it will allow other models to rely on hparams.has_rope(il) without needting to prepopulate.

Branch: GraniteSWAForCausalLM AI-usage: none Signed-off-by: Gabe Goodhart [email protected]

  • feat: Move to has_rope for all granite model architectures

Now that we have a proper hparam for this, it's better to use it and not require a hacky fallback in the hparam method itself.

Branch: GraniteSWAForCausalLM AI-usage: none Signed-off-by: Gabe Goodhart [email protected]

  • feat: No hacky rope_finetuned fallback in has_rope

Branch: GraniteSWAForCausalLM AI-usage: none Signed-off-by: Gabe Goodhart [email protected]

  • fix: Fully remove rope hparam filling in granitemoe

There are no granitemoe models that use NoPE (it's not actually used in the layer building below), so this was just dead code.

Branch: GraniteSWAForCausalLM AI-usage: none Signed-off-by: Gabe Goodhart [email protected]

  • fix: Save out rope_pattern in model-saver

Branch: GraniteSWAForCausalLM AI-usage: none Signed-off-by: Gabe Goodhart [email protected]

  • fix: Set hparams.rope_finetuned for round trip

Since the value is read from rope_finetuned, we need to persist it when the model is saved with the saver.

Branch: GraniteSWAForCausalLM AI-usage: none Signed-off-by: Gabe Goodhart [email protected]

  • fix: Code review cleanup

Signed-off-by: Gabe Goodhart [email protected] Co-authored-by: Sigbjørn Skjæret [email protected]

Co-authored-by: Sigbjørn Skjæret [email protected]

  • refactor: Keep gate/up fused for MoE path

Branch: GraniteSWAForCausalLM AI-usage: full (Claude + Sonnet 5) Signed-off-by: Gabe Goodhart [email protected]

  • fix: Skip GRANITE_SWA in model saver

https://github.com/ggml-org/llama.cpp/pull/25505#discussion_r3773175651

Keeping is_swa_impl in the saver can break other models.

Branch: GraniteSWAForCausalLM AI-usage: none Signed-off-by: Gabe Goodhart [email protected]

  • add sliding window pattern for model in test

  • style: Fix indentation

Branch: GraniteSWAForCausalLM AI-usage: none Signed-off-by: Gabe Goodhart [email protected]

  • fix: Fix \r\n

Thanks Claude!

Branch: GraniteSWAForCausalLM AI-usage: none Signed-off-by: Gabe Goodhart [email protected]

  • feat: Keep shared expert fused

Branch: GraniteSWAForCausalLM AI-usage: full (Claude + Sonnet 5) Signed-off-by: Gabe Goodhart [email protected]

  • style: More indentation fixes

Signed-off-by: Gabe Goodhart [email protected]

Co-authored-by: Sigbjørn Skjæret [email protected]


Signed-off-by: Gabe Goodhart [email protected] Co-authored-by: Sigbjørn Skjæret [email protected]

Website:

Attestations:

macOS/iOS:

Linux:

Android:

Windows:

openEuler:

  • DISABLED
  • openEuler x86 (310p)
  • openEuler x86 (910b, ACL Graph)
  • openEuler aarch64 (310p)
  • openEuler aarch64 (910b, ACL Graph)

UI: