ds4 icon indicating copy to clipboard operation
ds4 copied to clipboard

q4 variant of GLM-5.3-Flash does not run on a Mac Studio with 512GB

Open mserrano11 opened this issue 3 months ago • 3 comments

When executing ds4-server to run the Q4 variant of GLM-5.3-Flash, the following message appears:

ds4: GLM memory guard refused ctx=1000000 compact_cap=1000000 before GLM graph allocation ds4: model map: 177.77 GiB ds4: graph cache/scratch: 18.14 GiB (full KV 2.75 GiB, compact DSA 11.15 GiB, scratch 4.25 GiB) ds4: required model+graph: 195.91 GiB; guard budget: 110.00 GiB (base 512.00 GiB, fraction 0.99, reserve 32.00 GiB, transient 0.00 GiB) ds4: GLM-5.3 has a fixed 110 GiB per-rank ceiling; use a smaller --ctx, tensor parallelism, or SSD streaming

The machine is a Mac Studio with 512 GB. I would guess that there is a hardcoded value suited for a Q2 version.

mserrano11 avatar Aug 28 '26 18:08 mserrano11

This is on the glm-5.3-flash branch, btw.

mserrano11 avatar Aug 28 '26 18:08 mserrano11

Duct-tape fix for now is to edit the ds4.c file and change 110 to 256 on the line that specifies glm53_max (currently line 40162).

Then make clean and make and it runs!

% git diff
diff --git a/ds4.c b/ds4.c
index 9d10303..dd007a7 100644
--- a/ds4.c
+++ b/ds4.c
@@ -40159,7 +40159,7 @@ static bool glm_graph_memory_guard_for_compact_cap(
         if (wired_budget > budget) budget = wired_budget;
     }
     if (ds4_model_is_glm53()) {
-        const uint64_t glm53_max = 110ull * 1024ull * 1024ull * 1024ull;
+        const uint64_t glm53_max = 256ull * 1024ull * 1024ull * 1024ull;
         if (budget > glm53_max) budget = glm53_max;
     }

Edit: Feels extremely slow when tools are enabled because of #783, but I'm really impressed with the quality!

links486 avatar Aug 28 '26 18:08 links486

The duct-tape fix allows for the Q4 version to run. Testing right now...

mserrano11 avatar Aug 28 '26 19:08 mserrano11