Repository navigation
Feat/edge0 strata mac - #214
Conversation
Restore metal/ from Strata f1933b1 and apply the Metal latent Q4 handoff patch; add the Metal launch templates (edge0-145b-metal.json, edge0-120b-metal.json) with their prepare step, tools/mtp_gguf.py to rebuild mtp-q2_0.gguf from the released mtp/ folder, contract 5, and the macOS build in EDGE0.md.
Export of the development repository: the metal device and its option limits, the per-device template and the prepare step, contract 5, and the desktop app finding the edge0-infer in Contents/Resources of its macOS bundle.
Platforms and the Apple M2 Ultra measurements in the README and the model page, the desktop app section and CONTRIBUTING name macOS too, and the download badge names Windows and macOS.
…of Edge0 Chat package.sh fetch downloads the pinned inputs, build packs Edge0 Chat.app with edge0-infer, edge0-strata and its Python runtime inside Contents/Resources offline, and verify checks the zip and optionally serves one prompt.
|
Thank you for restoring Metal support! 🚀
What context size is supported at the moment? Are those improvements planned? |
Thanks! On Metal the default context is 32K, but it is not a hard limit. The desktop app currently starts the model with that fixed default, while the CLI lets you set it yourself, e.g. We tested 128K on a Mac Studio (Apple M2 Ultra, 192 GB) with Edge0 145B: a 127K-token prompt with a fact placed near the beginning was answered correctly, prefill averaged about 760 tok/s (about 168 s in total), and the engine process peaked at about 32 GB of memory. Notarization and official MLX weights are not available yet; we'll consider both for future releases. Until then, the first launch of the app needs Privacy & Security > Open Anyway, and on macOS the models run on the Metal engine directly from the released Q3_K folders. |
What & why
Edge0 145B and Edge0 120B ran only on Linux and Windows with an NVIDIA GPU. This PR runs them on macOS (Apple Silicon) with Metal, through
edge0-infer serve/chatand the Edge0 Chat desktop app, and adds a script that builds the macOS package of Edge0 Chat.metal/from Strataf1933b1and apply the Metal latent Q4 handoff patch; add the Metal launch templatesedge0-145b-metal.json/edge0-120b-metal.json,tools/mtp_gguf.py(rebuildsmtp-q2_0.gguf, the MTP file the Metal engine reads, from the releasedmtp/folder), contract 5, and "Build (macOS, Apple Silicon)" inEDGE0.md. The releasedEdge0-{145B,120B}-q3kfolders are used as they are; no weights are re-exported.metal(also the default).cudais accepted only on Linux and Windows,metalonly on macOS.metal,duaccepts onlyq4,ple-ioonlydirect, and-fp4folders are rejected, all before anything starts.<name>-metal.jsonon Metal).mtp-q2_0.ggufinto the model folder on the first start; later starts leave it in place./statusand the logs name the real device.edge0-inferinContents/Resourcesof its macOS app bundle.package.sh fetch | build | verify.fetchdownloads the pinned inputs.buildpacks offline:Edge0 Chat.appwithedge0-infer, edge0-strata (Metal) and its Python runtime insideContents/Resources, signed ad hoc, asedge0-chat-<version>-macos-arm64.zip.verifychecks the package and can serve one prompt with a model.Linux and Windows behavior is unchanged. The patch's edits to shared engine sources are inside
STRATA_GPU_METAL, and the CUDA templates are unchanged.Not in this PR: Q8 D/U and NVFP4 on Metal, 128K context on Metal, notarization.
Area
edge0-infer/)edge0-infer/tools/assets/)edge0-infer/examples/)docs/)edge0-strata/,scripts/package/, README)How was it tested?
edge0-infer (development repository): L0–L2 161/161 on macOS. New L1 cases cover the macOS / Linux / Windows rules. New L2 cases with a fake engine cover the prepare step, the Metal limits and
/status. Desktop app Rust tests 29/29.Mac Studio, Apple M2 Ultra 192 GB, macOS 27.0.1:
edge0-strata built from a clean checkout as
EDGE0.mddescribes.moe_mm_parity1280 and 1792 PASS. The patch'sverify_metal_latent.py14/14 for each model.mtp_gguf.pyoutput vs the originalmtp-q2_0.gguf: 21 tensors byte-identical; 10 Q8_0 tensors with 0 blocks different from the engine's own quantization.Original vs converted MTP, 4 fixed prompts at temperature 0, both models: identical answers and identical accepted drafts per prompt.
Through
edge0-infer, from a folder withoutmtp-q2_0.gguf, both models:chat,/v1/responses,/v1/messagesand thinking all answer.Speed with
strata_bench.pythrough the proxy (4K prefill / 16K prefill / chat decode / agent decode, tok/s):The docs use the model-card figures.
Desktop app: both models load and chat.
Package (
package.sh):verifypasses:mtp-q2_0.gguf; the bundled Python generated it, byte-identical to the one above;Regression:
serveanswers.Checklist
ctest --preset cpu -L "L0|L1"passes locally inedge0-infer/(engine changes)edge0-infer/docs/testing.md)