[PR #3114] [CLOSED] Optimize strata m5 max metal rope scaling 3378619349143257926 #4461

Closed
opened 2026-11-07 15:36:13 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/3114
Author: @WillkTech
Created: 10/19/2026
Status: ❌ Closed

Base: main ← Head: optimize-strata-m5-max-metal-rope-scaling-3378619349143257926


📝 Commits (4)

  • 2205e5e Add Metal stubs for new CUDA kernels and compat shims
  • e905e47 Add Mac setup notes and Jules optimization plan
  • 1ee7e5d Optimize Strata for Mac: wire RoPE YaRN on Metal & memory guard
  • 08b4955 Optimize Strata for Mac: wire RoPE YaRN on Metal & memory guard

📊 Changes

15 files changed (+5397 additions, -48 deletions)

View changed files

➕ Jules_plan.md (+4962 -0)
📝 docs/MAC.md (+1 -1)
➕ mac_readme.md (+146 -0)
📝 metal/CMakeLists.txt (+1 -0)
📝 metal/include/metal_compat/cuda_runtime.h (+28 -1)
📝 metal/setup_mac.py (+11 -5)
➕ metal/src/engine/rope_table.h (+48 -0)
📝 metal/src/engine/setup_host.cpp (+6 -31)
📝 metal/src/engine/stubs.cpp (+23 -5)
📝 metal/src/engine/window.cpp (+17 -5)
➕ metal/tests/rope_parity.cpp (+110 -0)
📝 src/core/conversation_memory.cpp (+20 -0)
📝 src/core/conversation_memory_test.cpp (+8 -0)
📝 src/program/generate.cpp (+9 -0)
📝 tools/test_setup_mac.py (+7 -0)

📄 Description

Optimizes Strata for Apple Silicon (M5 Max 128GB):

  • Wires RoPE YaRN scaling into Metal decode window table (cs_) in metal/src/engine/window.cpp via header-only helper metal/src/engine/rope_table.h.
  • Adds <algorithm> include in metal/tests/rope_parity.cpp testing unscaled, linear, and YaRN RoPE tables against float64 reference math.
  • Implements macOS host memory probe in src/core/conversation_memory.cpp using host_statistics64 with page calculation matching arena_budget.h.
  • Adds Metal guardrails for unsupported explicit --kv formats (q4_0, k8v4) in src/program/generate.cpp.
  • Updates metal/setup_mac.py context laddering (supporting 262144 and 524288) with automatic RoPE YaRN resolution.
  • Reconciles mac_readme.md and docs/MAC.md configuration details.
  • Verified with C++ parity tests (rope_parity, conversation_memory_test) and Python setup unit tests (test_setup_mac.py, test_setup_rope.py).

🔄 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/Niko1221/Strata/pull/3114 **Author:** [@WillkTech](https://github.com/WillkTech) **Created:** 10/19/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `optimize-strata-m5-max-metal-rope-scaling-3378619349143257926` --- ### 📝 Commits (4) - [`2205e5e`](https://github.com/Niko1221/Strata/commit/2205e5e9b9a5bacbcc9bcb5a624daadf08d8ee12) Add Metal stubs for new CUDA kernels and compat shims - [`e905e47`](https://github.com/Niko1221/Strata/commit/e905e47f7f7be2485600197ce006fdce5eb0d6c5) Add Mac setup notes and Jules optimization plan - [`1ee7e5d`](https://github.com/Niko1221/Strata/commit/1ee7e5d3e694aebf341ba736290db2ee1fc22f99) Optimize Strata for Mac: wire RoPE YaRN on Metal & memory guard - [`08b4955`](https://github.com/Niko1221/Strata/commit/08b495504c12d4ed5c89bc2cf264a50841d49770) Optimize Strata for Mac: wire RoPE YaRN on Metal & memory guard ### 📊 Changes **15 files changed** (+5397 additions, -48 deletions) <details> <summary>View changed files</summary> ➕ `Jules_plan.md` (+4962 -0) 📝 `docs/MAC.md` (+1 -1) ➕ `mac_readme.md` (+146 -0) 📝 `metal/CMakeLists.txt` (+1 -0) 📝 `metal/include/metal_compat/cuda_runtime.h` (+28 -1) 📝 `metal/setup_mac.py` (+11 -5) ➕ `metal/src/engine/rope_table.h` (+48 -0) 📝 `metal/src/engine/setup_host.cpp` (+6 -31) 📝 `metal/src/engine/stubs.cpp` (+23 -5) 📝 `metal/src/engine/window.cpp` (+17 -5) ➕ `metal/tests/rope_parity.cpp` (+110 -0) 📝 `src/core/conversation_memory.cpp` (+20 -0) 📝 `src/core/conversation_memory_test.cpp` (+8 -0) 📝 `src/program/generate.cpp` (+9 -0) 📝 `tools/test_setup_mac.py` (+7 -0) </details> ### 📄 Description Optimizes Strata for Apple Silicon (M5 Max 128GB): - Wires RoPE YaRN scaling into Metal decode window table (`cs_`) in `metal/src/engine/window.cpp` via header-only helper `metal/src/engine/rope_table.h`. - Adds `<algorithm>` include in `metal/tests/rope_parity.cpp` testing unscaled, linear, and YaRN RoPE tables against float64 reference math. - Implements macOS host memory probe in `src/core/conversation_memory.cpp` using `host_statistics64` with page calculation matching `arena_budget.h`. - Adds Metal guardrails for unsupported explicit `--kv` formats (`q4_0`, `k8v4`) in `src/program/generate.cpp`. - Updates `metal/setup_mac.py` context laddering (supporting 262144 and 524288) with automatic RoPE YaRN resolution. - Reconciles `mac_readme.md` and `docs/MAC.md` configuration details. - Verified with C++ parity tests (`rope_parity`, `conversation_memory_test`) and Python setup unit tests (`test_setup_mac.py`, `test_setup_rope.py`). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 15:36:13 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#4461
No description provided.