2026-11-27 16:20 UTC

ToshLLM fork reports faster RX 580 Metal inference, still behind Linux

state: expiredheat: lowuncertainty: mediumrelevance: mediumlocal-inference amd-gpu metalgraydini

What is this?

A developer using the name graydini reports a ToshLLM fork with Metal-kernel tuning for older AMD Polaris GPUs, including the RX 580. ToshLLM is an open-source local-inference app for Intel Macs with AMD GPUs; the upstream project is credited to Engelbert Delgado. The fork’s README reports one RX 580, one quantized 9B model and four-run benchmark medians: prompt processing rose from 100.5 to 167.5 tokens/s and generation from 22.4 to 26.7 tokens/s, versus 206.6 and 29.2 tokens/s on the same card under Linux/RADV. The Reddit author separately describes improvement from about 17 to up to 29 tokens/s on a different model, so that figure should not be conflated with the README benchmark. Results are self-reported and limited; broader reproduction is not supplied.

Why it matters

This is a focused but useful example of software kernels extending the life and local-AI usefulness of older, inexpensive hardware. The reported gains could make local inference more practical for Polaris owners on macOS, while the remaining Linux performance gap and narrow test mean the result is not evidence of parity across cards or workloads. The broader implication is that open-source, hardware-specific optimization can widen access to local models without new GPUs or cloud services.

Current assessment

New evidence: graydini’s fork README gives a more specific comparison than the initial Reddit post: on an RX 580 with Ornith-1.5-9B-heretic-Q4_K_M, four repetitions of a stated llama-bench configuration yielded 167.5 prompt and 26.67 generation tokens/s, against 100.5/22.4 for the upstream engine without this branch’s work and 206.6/29.2 for official llama.cpp on the same card under Linux/RADV. The README attributes gains to Polaris-specific Metal changes, including fp32 accumulation in tiled prefill matmul, wave64 decode optimizations, vectorized reads, shape-specific kernels and fused operations. These are project-reported measurements, explicitly limited to one card, one model and one branch, not independent validation. The Reddit author’s claim of up to 29 tokens/s refers to Ornith 9B in their post and should remain distinct from the README’s 26.7 tokens/s result for its named checkpoint. The README also states that ToshLLM is beta and that older-GPU support is still being validated with testers. A web search surfaces earlier discussion that RX 580 support was not initially available, but does not independently confirm this fork’s release or benchmark. Track for additional hardware/model reproduction and clarify the fork’s release status; if sustained, the work could improve local-inference access for owners of aging AMD Macs and Hackintosh systems, though it does not yet show Metal matching Linux/RADV.

Measured heat

no measured readings yet — the hourly heat pass fills this in

How the heat travelled

11-03 06:26 (minted)⭐ origin echo-reconstructedA ToshLLM fork reports RX 580 Metal benchmarks of 167.5 prompt-processing and 26.7 generation tokens per second, compared with 100.5 and 22.
graydini on github (echo) · attributed from reddit.post.1xml01c · published time unknown
—
11-03 05:51first on r/LocalLLaMA · published · lag ?RX580(Polaris AMD) on a MAC with near Vulkan performance!
opUserZero
—
11-03 05:51amplified on r/LocalLLaMA 👑reddit.post.1xml01c
opUserZero
peak 6 · 3 comments · 101% of case engagement
11-03 06:23our radar first saw it · lag ?discovery anchor: reddit.post.1xml01c—

Evidence (2) — ⭐ canonical anchor

sourceobjectauthorscorecomments
🟠 redditRX580(Polaris AMD) on a MAC with near Vulkan performance!
LocalLLaMA
Retrieved article excerpt

Open article · Retrieved 2026-11-03T06:25:45.068484+00:00

# gfx803 / Polaris Metal performance fork

Work on **Apple's Metal driver for AMD Polaris (GCN 4, `gfx803`)**, carried as a fork of
[engeldlgado/toshllm](https://github.com/engeldlgado/toshllm) — which is upstream, credited below,
and not this project's name or claim. Host of record: an RX 580 (36 CUs, 8 GB) under macOS 12 on an
Intel Xeon box, with the same card measured under Linux/RADV for comparison.

One checkpoint (`Ornith-1.5-9B-heretic-Q4_K_M`), one `llama-bench` request, medians of four
repetitions on a quiet, warmed card:

| build | pp512 | tg128 |
| --- | --- | --- |
| upstream engine, none of this branch's work | 100.5 | 22.4 |
| **this branch** | **167.5** | **26.67** |
| same card, Linux/RADV, official llama.cpp | 206.6 | 29.20 |

Build it from `vendor/llama.cpp` (`make -C build-static llama-server`); read
`patches/llama/metal/0052-*.patch` for what the engine carries, and the note in the commit that
introduced it for the one series defect still open.

## Polaris performance work (RX 580 / `gfx803`) 🧪

> ⚠️ One card, one model, one branch. Measured on an **AMD Radeon RX 580 (GCN 4 / `gfx803`, 36 CUs,
> 8 GB)** with `Ornith-1.5-9B-heretic-Q4_K_M` (5.23 GiB, q4\_K weights + q6\_K output/FFN-down),
> Flash Attention on and a q4\_0 KV cache. Not reproduced on any other card or driver.

`llama-bench -ngl 99 -fa 1 -ctk q4_0 -ctv q4_0 -b 2048 -ub 1024 -pg 512,128 -r 4 -t 10`, on a quiet
and warmed card, base and tuned alternated in one session:

| build | pp512 | tg128 |
| --- | --- | --- |
| upstream engine, no Polaris work | 100.5 | 22.4 |
| this branch | **167.5** | **26.7** |
| same card under Linux/RADV, official llama.cpp | 206.6 | 29.2 |

So **+66.7% prefill and +19.0% decode** over what this branch started from, with 19% of prefill and
8.7% of decode still to give before the Metal path matches Linux on identical silicon.

**The kernel changes that got there.**

- **Float accumulators in the tiled prefill matmul.** GCN4 round-trips a half-precision product
  through the register file on every accumulate step; accumulating in fp32 is worth **+22%** on its
  own — the largest single change in the whole effort.
- **One wavefront per tile, eight output columns per lane, two loads prefetched** in that same
  tile: 2.03 → 2.97 TFLOP/s standalone at `12288×4096`. Reordering the panel loads and splitting the
  tile-order dependency added a further few percent in situ.
- **16-byte vectorised activation reads in the wave64 decode mat-vec**, four `float4` instead of
  sixteen scalars — the shape RADV's shader emits — for **+6.6% decode** at the same traffic.
- **Decode geometry chosen per shape and type**: rows per group and lanes per block are not one
  constant. q4\_K wants sixteen lanes and four rows at the FFN widths, q6\_K wants four rows and eight
  rows at different row counts, and the wave64 kernels are separate entry points from the wave32
  ones rather than the same code with a different warp size.
- **Fusions on the decode path**: swiglu, RMS-norm and norm-add folded into the q4\_K mat-vec itself
  (worth +3.7%, +1.7% and +1.4% respectively when switched back off to measure), and a dispatch-fusion
  pass over the tail of tiny elementwise kernels that a decode token issues several hundred of.
- **A wave64 flash-attention path** covering quantized KV, plus shared-dequant multi-column mat-vec
  kernels so a batched step reads and unpacks each weight block once instead of once per column.
- **Alignment and architecture probed, never assumed.** Cards older than Vega return the aligned
  bytes for a dword read on a word boundary, so the fast unaligned path is granted only to hardware
  measured to tolerate it, by `amdgpu_gfx<N>` ISA target where the OS reports one and by device name
  where it does not. Unknown hardware stays correct rather than fast.

---

# Upstream: ToshLLM

The remainder of this file is the upstream README, kept
intact and unedited for attribution and for how the engine is built and
packaged.

# ToshLLM

**Run large language models locally on Intel Macs with AMD GPUs.**

Native macOS app · Metal acceleration · No cloud, no accounts, no per-token costs

[Build & Release](https://github.com/engeldlgado/toshllm/actions/workflows/build.yml)
[License: GPL-3.0](https://github.com/graydini/toshllm/blob/polaris_perf/LICENSE)
[Platform](https://github.com/graydini/toshllm#requirements)
[Status: Beta](https://github.com/engeldlgado/toshllm/issues)
[Sponsor](https://github.com/graydini/toshllm#support-the-project)
[DOI](https://doi.org/10.5281/zenodo.21908524)

### [⬇️ Download the latest release](https://github.com/engeldlgado/toshllm/releases/latest) · [📝 Changelog](https://github.com/graydini/toshllm/blob/polaris_perf/CHANGELOG.md)

*[Versión en español más abajo](https://github.com/graydini/toshllm#toshllm-en-espa%C3%B1ol)*

[ToshLLM home screen — hardware detection and model recommendations](https://github.com/graydini/toshllm/blob/polaris_perf/Assets/home.jpg)

---

## What is ToshLLM?

ToshLLM lets you run modern open LLMs **entirely on your own Mac** — your chats never leave the machine, there are no accounts, and there's nothing to pay per token.

Most local-LLM tools on macOS only target Apple Silicon. Intel Macs with discrete AMD GPUs — including Hackintosh builds — get left behind: the stock engines produce **corrupted output** on AMD dGPUs and read model weights over PCIe at a fraction of the possible speed.

**ToshLLM fixes that.** It bundles `llama.cpp` built with AMD-specific patches and wraps it in a polished native SwiftUI app — so a card like the RX 6700 XT goes from unusable to genuinely fast:

|  | Stock llama.cpp on AMD dGPU | ToshLLM |
| --- | --- | --- |
| Output | corrupted | correct |
| Qwen3-8B generation | 0.6–2.6 t/s | **~61 t/s** |
| Qwen3.6-35B (MoE) generation | unusable | **~29 t/s**, flat on long runs |

It opens, detects your hardware, and recommends models that will actually run well — no guesswork.

## Features

- **Native chat** — multiple persistent conversations, full Markdown with code-copy, regenerate, system prompt, live tokens/sec, file attachments, conversation forking and per-message metrics
- **Agent tools and MCP** — the model can read, edit and run files and commands with per-step permission, run JavaScript in a sandbox, and use tools from external Model Context Protocol servers you connect
- **Symbolic math (SymPy)** — optional exact math tools for the model: simplify, solve equations and systems, derivatives, integrals, limits, series, differential equations, matrices, Laplace and Fourier transforms, and checking that two expressions are equivalent or that a solution holds. The runtime ships inside the app, nothing else to install; off by default, in chat settings under Agents ([details](https://github.com/graydini/toshllm/blob/polaris_perf/helpers/tosh-sympy/README.md))
- **Scientific computing (NumPy and SciPy)** — optional numerical tools for the model: definite integrals without a closed form, roots, optimization and curve fitting, differential equations over an interval, linear algebra on decimal matrices, FFT and filters, and statistics. The model sends an operation and its numbers, never code. Same bundled runtime, its own switch, off by default ([details](https://github.com/graydini/toshllm/blob/polaris_perf/helpers/tosh-scientific/README.md))
- **Math answers you can check** — with either math tool set on, the engine runs the turn itself: a calculation has to go through a tool or a question back, every call is checked against your message, and the answer only states numbers from your message or from a validated result. The app's chat, the web chat and any OpenAI client that sends `X-Tosh-Agent: on` get the same agent, also from another computer; requests that bring their own tools get the model as it is ([how to call it](https://github.com/graydini/toshllm/blob/polaris_perf/helpers/tosh-sympy/README.md#four-ways-to-reach-the-tools))
- **GPU speech and subtitle studio** — Whisper.cpp transcribes microphone dictation into one clean paragraph, while the Audio workspace can disable Silero VAD, use Whisper.cpp's native defaults or tune it with calibrated profiles, previews audio or video with a synchronized editable transcript, preserves recoverable original and translated tracks, keeps Chat translation consistent with context and a glossary, and exports SRT, VTT, TXT, JSON or a captioned MOV; nothing leaves the Mac
- **Vision** — attach images (or paste a screenshot with Cmd+V) and vision-capable models describe them; the matching projector (`mmproj`) is paired automatically
- **Image generation (beta)** — a local text-to-image studio (stable-diffusion.cpp on the same AMD Metal stack): text-to-image and image-to-image, with a model catalog sized to your VRAM, a live preview of the image forming, and an **upscaler** that takes your own photos too (x2/x4, batches, and a drag-to-compare view)
- **Model manager** — a curated catalog with **per-model VRAM/RAM estimates for *your* hardware**, plus Hugging Face browsing sorted by trending, downloads, likes or last update, downloads with live progress, and a flag when a repo re-publishes a model you already have
- **MoE-aware** — automatic `--n-cpu-moe` calculation so 35B-class Mixture-of-Experts models run well on 12 GB GPUs
- **Speculative decoding, automatic and lossless** — MTP engages by itself on models that ship the head, and DFlash uses a small per-model draft when one is downloaded; both size themselves to your VRAM, back off on content where drafting doesn't pay, and never change the output
- **Bundled engine** — official llama.cpp with the **AMD Flash Attention kernel** on by default, so attention runs on the GPU instead of falling back to the CPU (see the [research note](https://github.com/graydini/toshllm#research-amd-gpus-on-metal))
- **Benchmarks** — measure prompt/generation speed per configuration, with history and side-by-side comparison charts
- **OpenAI-compatible API** — use it at `http://127.0.0.1:8080`, with optional local-network access and Bonjour discovery; can also serve embeddings for local RAG clients
- **Router mode** — one server that auto-loads whichever model each OpenAI-compatible request names, no restart between models; external clients and the built-in chat switch on the fly
- **Multiple servers** — run several independent engine instances at once from the Dashboard, each with its own model, GPU, port and profile; serve different models side by side or pin one model per GPU
- **Multi-GPU and eGPU** — split a model across all your GPUs or an exact set of cards (validated on dual-GPU setups); external GPUs run at full speed with VRAM-resident weights
- **Every parameter explained** — bilingual tooltips and built-in docs (English/Spanish)
- **Profiles, menu bar mode, auto-start** — save full configurations and switch with one click

### In testing 🧪

These are new and still being validated — enable them in Settings, but expect rough edges:

- **Dynamic MoE (off by default)** — for Mixture-of-Experts models that do not fit in VRAM: the most used experts stay in VRAM, the rest in RAM, sized for your context and for the memory the Mac has free right now, and the model is not loaded when nothing fits safely. On an RX 6700 XT it reads prompts nearly twice as fast as the standard offload on Qwen3.6-35B-A3B and generates about 50% faster. Off, MoE models use the standard offload as before. [How it works](https://github.com/graydini/toshllm#dynamic-moe-experimental-off-by-default).
- **Video generation (experimental, first cut)** — a Video mode next to Chat and Images, on the same stable-diffusion.cpp engine, with Wan 2.1/2.2, LTX-2 and HunyuanVideo. Read this before downloading 7 GB: a few seconds of video take minutes, 49 frames at 480p already fill a 12 GB card, and **only Wan 2.1 1.3B fits one at all** — the others ask for 24 GB or more. Asking for more frames or more pixels than fit fails instead of degrading. The clip comes
opUserZero63
🟧 echo.github ⭐A ToshLLM fork reports RX 580 Metal benchmarks of 167.5 prompt-processing and 26.7 generation tokens per second, compared with 100.5 and 22.graydini——

Interpretation history

Decision trace