Skip to content

[Bug] MiniMax-M3.1 GGUF on Apple Silicon: NVFP4 CPU fallback despite 61/61 layers offloaded to GPU #15409

Closed

Description

@leftbankvines

Environment

Where are you using Unsloth?

  • Unsloth desktop application
  • Unsloth web UI (unsloth studio)
  • Unsloth CLI
  • Python package or notebook
  • Colab or Kaggle

Operating system and version: macOS 27.0.1, build 26A434, arm64.

GPU model(s) and accelerator backend: Apple M3 Ultra Mac Studio, 512 GiB unified memory, 32 CPU cores; llama.cpp Metal backend.

Versions:

  • Installed Python packages: unsloth==2026.10.8, unsloth_zoo==2026.10.8.
  • Measured reproduction: b11871-mix-ec42614; the server log records build 11871, commit 1645769f7, AppleClang 21.0.0.21000101.
  • Currently installed: b11876-mix-ec42614; llama-server --version reports 0.7.0-dev (build 11876, commit 468ad5824).
  • The throughput numbers below are from b11871, not a new benchmark of b11876. Source inspection confirms that the installed b11876 still rejects NVFP4 matrix operations on Metal.
  • Desktop shell version was not reliably captured; the package and backend versions above were read directly.

What happened?

MiniMax-M3.1-Flash now loads and answers, but generation is only approximately 8.3-8.6 tok/s. The log reports 61/61 layers offloaded to GPU, while almost all expert-weight storage is CPU-mapped. The Metal backend explicitly returns false for NVFP4 matrix operations.

This appears to be an unsupported GPU-operation / CPU-fallback limitation, rather than the earlier M3.1 missing-indexer-tensor loading issue. It is particularly confusing because the run guide supplies macOS/Metal build instructions without making this quant-specific limitation clear.

Steps to reproduce:

  1. Download all seven shards of unsloth/MiniMax-M3.1-Flash-GGUF, UD-Q8_K_XL. This is the tested model revision.
  2. Load through Studio with one parallel slot, approximately 65K context (actual log: 65280), f16 KV cache, flash attention enabled, speculative decoding off, and GPU offload enabled. The load includes the BF16 vision projector, but the measured requests are text-only.
  3. Send a text prompt and inspect generation timing and model-buffer placement.

An initial run with Auto settings used four slots and 1M context and warned that it was falling back to dense attention. The measurements below are from the subsequent single-slot load, with kv_unified = 'false' and without that dense-attention warning. Correcting that configuration did not resolve the slow generation.

Expected behavior:

Either the selected quant's expert matrix operations execute efficiently on Metal, or Studio and the Mac guide clearly disclose that these tensors will execute on CPU despite a full-layer-offload summary, and identify the recommended compatible export/backend.

Actual behavior:

The model generates valid-looking text, but only at 8.3-8.6 tok/s, with approximately 218.71 GiB CPU-mapped versus 22.57 GiB Metal-mapped model buffers. No per-kernel profiler trace was collected; the CPU-fallback diagnosis is based on the actual buffer placement together with the backend's explicit operation rejection.

Model and operation involved:

GGUF text inference with unsloth/MiniMax-M3.1-Flash-GGUF:UD-Q8_K_XL, approximately 259.1 GB across seven shards. Despite the Q8 label, the loader reports 171 NVFP4 tensors; the routed experts retain native NVFP4.

Diagnostics and logs

Desktop application / model-specific logs

Relevant excerpts from the measured single-slot server load; private paths, credentials and prompt content are omitted:

common_params_print_info: build 11871 (1645769f7) with AppleClang 21.0.0.21000101 for Darwin arm64 (Compiled by the Unsloth team)
device_info:
  - MTL0    : Apple M3 Ultra (475136 MiB, 475135 MiB free)
  - CPU     : Apple M3 Ultra (524288 MiB, 524288 MiB free)
llama_model_loader: - type nvfp4:  171 tensors
print_info: file type   = BF16
load_tensors: offloaded 61/61 layers to GPU
llama_context: n_seq_max             = 1
llama_context: n_ctx                 = 65280
llama_context: n_ctx_seq             = 65280
llama_context: flash_attn            = enabled
llama_kv_cache:       MTL0 KV buffer size =  7650.00 MiB
llama_kv_cache:       MTL0 KV buffer size =  1912.50 MiB
srv load_model: initializing, n_slots = 1, n_ctx_slot = 65280, kv_unified = 'false'
spec common_specu: no implementations specified for speculative decoding

prompt eval time =   24574.43 ms /  1367 tokens (   17.98 ms per token,    55.63 tokens per second)
       eval time =   51953.48 ms /   446 tokens (  116.75 ms per token,     8.57 tokens per second)

prompt eval time =     796.51 ms /    29 tokens (   27.47 ms per token,    36.41 tokens per second)
       eval time =   62484.56 ms /   520 tokens (  120.39 ms per token,     8.31 tokens per second)

Aggregating only the log's load_tensors: ... model buffer size lines gives:

Buffer Number of entries Sum (MiB) Sum (GiB)
CPU_Mapped 172 223960.50 218.71
MTL0_Mapped 173 23110.48 22.57

These are model-buffer allocations, not a measurement of system-wide RAM use.

Source evidence

The installed source, also visible in upstream b11876, ggml-metal-device.m lines 1512-1524, contains:

if (!has_simdgroup_reduction ||
    op->src[0]->type == GGML_TYPE_NVFP4 ||
    op->src[0]->type == GGML_TYPE_TQ1_0) {
    return false;
}

Both MUL_MAT and MUL_MAT_ID use this helper.

Additional context

  • Unsloth's MiniMax-M3.1-Flash local guide explicitly supplies macOS instructions and points to ggml-org/llama.cpp PR #31192.
  • This is not simply a missing M3.1 model-support patch: the installed b11876 mixed release includes Unsloth PR #320, pinned to 822be707b23345b291f3042defa7508aa813cc4b. The installed MiniMax model and conversion files were compared with the current upstream PR #31192; the differences in those two files were comments, not executable code.
  • Q4 is not an obvious workaround: a header-only inspection of all six tensor-bearing UD-Q4_K_XL shards at revision b17b7f5 also found 171 NVFP4 routed-expert weight tensors. Q4 has not been runtime-tested here; no Q4 throughput claim is being made.
  • Related upstream work: Metal NVFP4 support PR #20456, currently open. This is background, not a claim that its current implementation covers this model's routed-expert operations.
  • A related fallback on another model was reported in ggml-org/llama.cpp issue #30610, where NVFP4 projections were CPU-bound on an M3 Ultra. That is a different architecture and not an M3.1 performance prediction.

Could you confirm the intended efficient Apple Silicon path for these M3.1 exports? In particular:

  1. Is Metal support for the native NVFP4 expert operations planned, or is there an existing compatible route we have missed?
  2. Could Studio expose an explicit unsupported-operation / CPU-fallback warning and clarify the full-layer-offload summary?
  3. Could the macOS guide identify this limitation or point to an export with Metal-supported expert tensor types?

Thank you. The model is clearly promising; the request is for an accurate compatibility indication and a supported path, not a particular guaranteed tok/s figure.

Activity

  1. debojyoti-dev commented on Oct 26, 2026

    @debojyoti-dev
    Contributor

    I'm working on this. I'll start with the Studio side: detect GGUFs whose weights llama.cpp can't run on Metal (NVFP4 today) and show a clear CPU fallback warning instead of the misleading full-offload picture.

  2. Lyxot commented on Oct 29, 2026

    @Lyxot
    Collaborator

    Fixed in unslothai/llama.cpp#330 unslothai/llama.cpp#331. Please update llama.cpp inside Unsloth.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions