ds4 icon indicating copy to clipboard operation
ds4 copied to clipboard

Segfault (exit 139) when --imatrix-out is combined with --role coordinator

Open datanerdie opened this issue 3 months ago • 0 comments

Collecting a routed-MoE imatrix over the distributed path crashes with SIGSEGV.

# worker (giro)
./ds4 --metal -m <flash-mxfp4-0731.gguf> --role worker --layers 21:output --ctx 32768 \
      --coordinator 172.16.0.11 1234

# coordinator (llama)
./ds4 --metal -m <flash-mxfp4-0731.gguf> --role coordinator --layers 0:20 \
      --listen 172.16.0.11 1234 --ctx 32768 \
      --imatrix-dataset gguf-tools/imatrix/dataset/rendered_prompts.txt \
      --imatrix-out /tmp/imx_probe.dat --imatrix-max-tokens 20000

Coordinator output ends at:

ds4: restricting metal model map to layers 0:20+output (46 spans, 71.70 GiB tensor span)
ds4: memory: KV 0.61 GiB + buffers 0.25 GiB + resident model 71.70 GiB = 72.56 GiB planned
ds4: collecting routed-MoE imatrix from gguf-tools/imatrix/dataset/rendered_prompts.txt (model=DeepSeek V4 Flash, layers=43, experts=256, ctx=32768, chunk=4096)

then exits 139 (SIGSEGV). No imatrix file is written. Both halves load fine and the worker registers normally; the crash happens once collection starts.

Environment: 2× M4 Max 128 GB over Thunderbolt, Metal, 6747e77, Flash 0731 MXFP4 GGUF, split 0:20 / 21:output.

ds4_distributed.c has no imatrix references, so I assume collection was simply never wired for the distributed path — that is entirely reasonable. The report is only that it crashes instead of refusing, which is easy to mistake for a hardware or OOM problem. A check like the existing --dist-activation-bits requires --role coordinator guard would make it obvious.

Workaround for anyone hitting this: collect solo. On a 128 GB machine the 145 GB MXFP4 quant needs --ssd-streaming, which runs at ~137 t/s, so 1.5M calibration tokens takes roughly 3 hours versus ~50 minutes had the split worked. Not urgent, but imatrix collection is a prefill-only workload and therefore close to the ideal case for pipeline parallelism — the prefill speedup measured on this pair is 1.6-1.7x.

datanerdie avatar Aug 05 '26 05:08 datanerdie