Skip to content

glm53 vulkan: clamp SiLU*Up in the shared gate_up shader - #1566

Merged
JustVugg merged 1 commit into
JustVugg:devfrom
gyanu2507:fix/glm53-vk-swiglu-clamp-on-dev
Sep 18, 2026
Merged

JustVugg merged 1 commit into
JustVugg:devfrom
gyanu2507:fix/glm53-vk-swiglu-clamp-on-dev

Conversation

@gyanu2507

@gyanu2507 gyanu2507 commented Sep 16, 2026

Copy link
Copy Markdown

Fixes #1520

CPU and Metal already cap silu(gate)*up with the checkpoint swiglu_limit. The Vulkan fused kernel (qmatmul_gate_up.comp) did the unclamped product, so GLM-5.3 output depended on which experts were tier-resident.

The limit rides in the gate_up push constants per dispatch (PCGU). limit <= 0 stays unclamped, which is the correct value for GLM-5.2 / colibri.c on the same shader. glm53 publishes m->c.swiglu_limit after coli_vk_init. Source contract in c/tests/test_glm53_vulkan_clamped_source.py.

CPU and Metal already cap that product. The Vulkan path used
the same qmatmul_gate_up.comp without a limit, so GLM-5.3
decode could NaN on fp16 overflow. limit<=0 stays unclamped
for GLM-5.2, per dispatch.

Fixes JustVugg#1520
@JustVugg
JustVugg merged commit 46296d5 into JustVugg:dev Sep 18, 2026
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants