[PR #9121] [CLOSED] ml: let model specify rope configuration #18140

Closed
opened 2026-04-16 06:25:56 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/9121
Author: @BruceMacD
Created: 2/14/2025
Status: Closed

Base: mainHead: brucemacd/rope-config


📝 Commits (2)

  • eb08651 ml: let model specify rope configuration
  • c259747 ctxLen -> origCtxLen

📊 Changes

5 files changed (+104 additions, -28 deletions)

View changed files

📝 kvcache/causal_test.go (+1 -1)
📝 ml/backend.go (+37 -1)
📝 ml/backend/ggml/ggml.go (+12 -13)
📝 model/models/llama/model.go (+28 -7)
📝 model/models/mllama/model_text.go (+26 -6)

📄 Description

Add support for model-specific RoPE configuration parameters by:

  1. Creating a new RopeConfig struct to encapsulate all RoPE parameters
  2. Adding RopeType enum to specify different RoPE variants (Standard/NeoX)
  3. Extracting original context length from model config
  4. Refactoring RoPE() interface to use the new config struct
  5. Updating llama and mllama models to use new RoPE configuration

This change allows models to specify their RoPE implementation type and original context length, which is important for proper position embedding calculation and model compatibility.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/9121 **Author:** [@BruceMacD](https://github.com/BruceMacD) **Created:** 2/14/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `brucemacd/rope-config` --- ### 📝 Commits (2) - [`eb08651`](https://github.com/ollama/ollama/commit/eb086514daeaf0d5c1b7109b707f33d291dafc92) ml: let model specify rope configuration - [`c259747`](https://github.com/ollama/ollama/commit/c259747acb721831e0fd292b1281b1e191865519) ctxLen -> origCtxLen ### 📊 Changes **5 files changed** (+104 additions, -28 deletions) <details> <summary>View changed files</summary> 📝 `kvcache/causal_test.go` (+1 -1) 📝 `ml/backend.go` (+37 -1) 📝 `ml/backend/ggml/ggml.go` (+12 -13) 📝 `model/models/llama/model.go` (+28 -7) 📝 `model/models/mllama/model_text.go` (+26 -6) </details> ### 📄 Description Add support for model-specific RoPE configuration parameters by: 1. Creating a new `RopeConfig` struct to encapsulate all RoPE parameters 2. Adding `RopeType` enum to specify different RoPE variants (Standard/NeoX) 3. Extracting original context length from model config 4. Refactoring `RoPE()` interface to use the new config struct 5. Updating llama and mllama models to use new RoPE configuration This change allows models to specify their RoPE implementation type and original context length, which is important for proper position embedding calculation and model compatibility. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-16 06:25:56 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#18140