Skip to content

model: GraniteSWAForCausalLM / GraniteMoeSWAForCausalLM#25505

Draft
gabe-l-hart wants to merge 12 commits into
ggml-org:masterfrom
gabe-l-hart:GraniteSWAForCausalLM
Draft

model: GraniteSWAForCausalLM / GraniteMoeSWAForCausalLM#25505
gabe-l-hart wants to merge 12 commits into
ggml-org:masterfrom
gabe-l-hart:GraniteSWAForCausalLM

Conversation

@gabe-l-hart

Copy link
Copy Markdown
Collaborator

Overview

This Pull Request mirrors huggingface/transformers#47179 to support forthcoming Granite models that will incorporate interleaved Sliding Window Attention with Attention Sinks.

Additional information

  • Model weights are not available just yet, but they exist internally and will eventually appear here

  • Some of the models in this family will have per-layer RoPE / NoPE. There is adjacent work to support this in the Granite Switch PR (Granite-Switch Architecture #25107). For the sake of keeping this encapsulated, I replicated the function signature for llama_hparams.has_rope. The logic behind the answer is different than the Granite Switch logic, so this will need to be rectified depending on merge order.

  • This has been verified on internal checkpoints.

Requirements

AI Disclosure

AI was used to create this PR. I manually reviewed all outputs and authored all commits myself. See stats below:

git-ai-stats
╔══════════════════════════════════════════════════════════╗
║           GIT AI USAGE ANALYSIS                          ║
╚══════════════════════════════════════════════════════════╝

📊 COMMITS BY AGENT

--- Aggregate ---
Commits                        |      Count
---------------------------------------------
IBM Bob                        |          5
IBM Bob, OpenCode + Qwen3.6-35b |          2
---------------------------------------------
TOTAL                          |          7

📊 COMMITS BY USAGE TYPE

--- Aggregate ---
Commits                        |      Count
---------------------------------------------
none                           |          0
draft                          |          0
full                           |          7
---------------------------------------------
TOTAL                          |          7

📈 LINES OF CODE BY AGENT

--- Aggregate ---
Agent                     |    Commits |  Additions |  Deletions
------------------------------------------------------------
IBM Bob                   |          5 |         85 |          8
IBM Bob, OpenCode + Qwen3.6-35b |          2 |        415 |          0
------------------------------------------------------------
TOTAL                     |          7 |        500 |          8

📈 LINES OF CODE BY USAGE TYPE

--- Aggregate ---
Usage Type           |    Commits |  Additions |  Deletions
-------------------------------------------------------
none                 |          0 |          0 |          0
draft                |          0 |          0 |          0
full                 |          7 |        500 |          8
-------------------------------------------------------
TOTAL                |          7 |        500 |          8

@github-actions github-actions Bot added model Model specific conversion labels Jul 9, 2026
@pwilkin

pwilkin commented Jul 9, 2026

Copy link
Copy Markdown
Member

@gabe-l-hart and here I was about to ask you about https://huggingface.co/ibm-granite/granite-swash-2b/tree/main :) seems like at least one model from the new family made it through :)

@gabe-l-hart

Copy link
Copy Markdown
Collaborator Author

@pwilkin I didn't even catch that one, so it was even stealth within the house. I'll make sure everything is lined up for that model too (and get red tests green)

@gabe-l-hart

Copy link
Copy Markdown
Collaborator Author

The saga of Alex and Max is alive and well with granite-swash-2b:

model      : /Users/ghart/models/ibm-granite/granite-swash-2b/granite-swash-2B-BF16.gguf
ftype      : BF16
modalities : text

available commands:
  /exit or Ctrl+C     stop or exit
  /regen              regenerate the last response
  /clear              clear the chat history
  /read <file>        add a text file
  /glob <pattern>     add text files using globbing pattern



> Tell me a story about a developer and their dog
Once upon a time in a quaint little town, there lived a developer named Alex. Alex was an avid dog lover, and his dog, Max, was always by his side. Max was a golden retriever with a heart of gold and a spirit that could light up any room.

One sunny afternoon, while Alex was working on his latest project, he noticed that Max had been barking non-stop. He called his assistant, Sarah, over and asked if she had seen anything unusual. Sarah shrugged and said, "I don't know, maybe Max's hearing is a bit off today."
...

Branch: GraniteSWAForCausalLM
AI-usage: full (Bob, OpenCode + Qwen3.6-35b)
Signed-off-by: Gabe Goodhart <ghart@us.ibm.com>
Branch: GraniteSWAForCausalLM
AI-usage: full (Bob, OpenCode + Qwen3.6-35b)
Signed-off-by: Gabe Goodhart <ghart@us.ibm.com>
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 <ghart@us.ibm.com>
Branch: GraniteSWAForCausalLM
AI-usage: full (Bob)
Signed-off-by: Gabe Goodhart <ghart@us.ibm.com>
Branch: GraniteSWAForCausalLM
AI-usage: full (Bob)
Signed-off-by: Gabe Goodhart <ghart@us.ibm.com>
NOTE: This shadows the work done for Granite Speech
ggml-org#25107

Branch: GraniteSWAForCausalLM
AI-usage: full (Bob)
Signed-off-by: Gabe Goodhart <ghart@us.ibm.com>
Branch: GraniteSWAForCausalLM
AI-usage: full (Bob)
Signed-off-by: Gabe Goodhart <ghart@us.ibm.com>
Branch: GraniteSWAForCausalLM
AI-usage: none
Signed-off-by: Gabe Goodhart <ghart@us.ibm.com>
Branch: GraniteSWAForCausalLM
AI-usage: full (OpenCode + Qwen3.6-35b)
Signed-off-by: Gabe Goodhart <ghart@us.ibm.com>
Branch: GraniteSWAForCausalLM
AI-usage: none
Signed-off-by: Gabe Goodhart <ghart@us.ibm.com>
Branch: GraniteSWAForCausalLM
AI-usage: draft (OpenCode + Qwen3.6-35b)
Signed-off-by: Gabe Goodhart <ghart@us.ibm.com>
branch: GraniteSWAForCausalLM
AI-usage: full (OpenCode + Qwen3.6-35b)
Signed-off-by: Gabe Goodhart <ghart@us.ibm.com>
@gabe-l-hart
gabe-l-hart force-pushed the GraniteSWAForCausalLM branch from 7be415a to 94d2643 Compare July 14, 2026 19:00
@gabe-l-hart

Copy link
Copy Markdown
Collaborator Author

We also have an MoE variant up now: https://huggingface.co/ibm-granite/granite-swash-3b-a600m. Needed a few changes, but this is also supported now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

conversion model Model specific

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants