2026-11-26 16:13 UTC

GLM-Vx builds a framework-free GLM-5.3 prototype; GPU and parity remain unproven

state: expiredheat: mediumuncertainty: mediumrelevance: mediumglm-serving vx-kernels ptx-compilation local-inferencevx-langZ.ai

What is this?

GLM-Vx is an experimental, from-scratch serving engine for GLM-5.3. Its authors say it avoids vLLM, SGLang, Transformers and PyTorch in the serving path, using Python for orchestration and Vx kernels for computation. The evidence supports a CPU prototype and an NVIDIA GPU backend whose kernels compile to PTX; it does not establish that the GPU backend has run successfully or performs well. The project reports limited full-checkpoint CPU tests, but also substantial numerical parity failures and says automatic release promotion is blocked.

Why it matters

A useful example of how far a small team can take a model-specific inference stack without relying on familiar serving frameworks: GLM-Vx has a tested CPU prototype, a small HTTP completion API, and an experimental GPU path. But it is not yet a practical alternative to established engines. The GPU path has not been verified on hardware, full-model validation still has substantial numerical mismatches, and no comparable performance results are reported. For now, it is most interesting to systems enthusiasts following custom kernels and model-serving infrastructure, not as a recommendation for running GLM-5.3.

Current assessment

The project describes GLM-Vx as a from-scratch GLM-5.3 inference engine: Python handles checkpoint I/O and serving orchestration, while Vx kernels perform computation without vLLM, SGLang, Transformers, or PyTorch in the serving path. The supplied project page reports that the full mixed-bit GGUF checkpoint ran through all 78 base-decoder layers on CPU and generated two tokens matching an independent llama.cpp CPU reference; that baseline took about 34 minutes and used 32.2 GB peak memory, so it is evidence of a limited end-to-end run, not usable speed. Newer implementation evidence includes a GPU backend that compiles kernels to PTX, but execution and performance on an NVIDIA GPU remain unverified. The project also reports matching 306 discrete official checks while failing 112 of 308 frozen numerical checks, with automatic release promotion blocked. A separate batched run matched the project's own scalar Vx trace across 1,898 checks, which supports consistency with that baseline but not independent model parity. The tiny model and its benchmarks use random weights and do not establish trained-model quality or serving performance. The main significance is as an experimental, inspectable route to model-specific kernels and serving without the usual frameworks; users seeking reliable or fast GLM-5.3 inference should treat the project as research, pending independent correctness checks, real-GPU validation, and matched benchmarks against established engines. The HTTP API is a completion subset, and the server has no authentication or TLS, so it should not be exposed directly to a network.

Measured heat

no measured readings yet β€” the hourly heat pass fills this in

How the heat travelled

10-20 17:09⭐ origin directly observedSelf-contained GLM-5 serving stack: Just Vx kernels compiled to PTX
adityazero on hacker news
β€”
10-20 17:09amplified on hacker news πŸ‘‘hn.story.50169493
adityazero
peak 1 Β· 0 comments Β· 105% of case engagement
10-20 19:30our radar first saw it Β· +2.4hdiscovery anchor: hn.story.50169493β€”

Evidence (1) β€” ⭐ canonical anchor

sourceobjectauthorscorecomments
🟧 hn ⭐Self-contained GLM-5 serving stack: Just Vx kernels compiled to PTX
Retrieved article excerpt

Open article Β· Retrieved 2026-10-20T21:31:11.703652+00:00

# GLM-Vx

An experimental, from-scratch GLM-MoE-DSA inference engine using **real compiled
Vx numerical kernels**. Python handles checkpoint IO, tensor storage, model
orchestration, request scheduling and HTTP. The serving path does not use vLLM, SGLang, Transformers or
PyTorch. An optional validation environment runs the pinned official model. NumPy supplies storage and an explicit test
oracle; the `vx` backend never silently falls back to NumPy matrix operations.

**Current status: tested CPU prototype plus an explicit NVIDIA GPU kernel/backend path.**
The GPU path compiles to PTX; actual GPU execution and optimal performance remain
unverified. See [GPU implementation and run instructions](https://github.com/vx-lang/glm-vx/blob/main/gpu/README.md).
The full trained GLM-5.3 mixed-bit GGUF checkpoint has executed on CPU through
all 78 base-decoder layers, generating **β€œLet me”** from a six-token abbreviated
chat prefix. Both tokens match an independent llama.cpp CPU reference. This
original baseline smoke took about 34 minutes and 32.2 GB peak RSS; it is not a complete
answer or a practical-speed result. See [actual model evidence](https://github.com/vx-lang/glm-vx/blob/main/docs/gguf-evidence/real-chat-summary.json).
The latest [implementation report](https://github.com/vx-lang/glm-vx/blob/main/docs/OPTIMIZATION-PROGRESS.md) adds packed
Vx kernels, batched prefill, prompt reuse and compiler candidate search. Its full
trained official comparison matches all 306 discrete checks but fails 112 of
308 frozen numerical checks. **Automatic release promotion remains blocked.**
The included tiny model has deterministic random weights and is for testing mechanics only.

The [October 4–5 engine audit](https://github.com/vx-lang/glm-vx/blob/main/docs/ENGINE-AUDIT-20261004.md) adds corrected DSA
configuration defaults and cache identities, SIMD across independent output rows,
fused packed GGUF batches with fixed-stride activation tiles, and a fused GPU
index-score kernel. The new full trained two-token batched run matches the saved
scalar Vx trace bit-for-bit across 1,898 checks, including both complete vocabulary
outputs. This proves preservation of that baseline, not independent official parity.

[Serving research and prioritized roadmap](https://github.com/vx-lang/glm-vx/blob/main/docs/SERVING-RESEARCH.md) reviews GLM-specific
provider work, papers, X discussions and their applicability to this engine.

## Run

Prerequisites: Linux x86-64, Python 3.10+, C linker, working Vx v0.0.2 and LLVM 22.
See [Vx installation](https://vxlang.org/docs/getting-started.html).

```
python3 -m venv .venv
.venv/bin/pip install -e '.[test]'
VXC=/path/to/vxc kernels/build.sh
.venv/bin/python -m glm_vx.server --tiny --backend vx
```

On the implementation machine the isolated compiler is already available:

```
cd /srv/nanocodex/workspace/glm-vx
VXC=/srv/nanocodex/workspace/vx-toolchain/bin/vxc kernels/build.sh
.venv/bin/python -m glm_vx.server --tiny --backend vx
```

```
curl http://127.0.0.1:8000/v1/completions \
  -H 'Content-Type: application/json' \
  -d '{"prompt":[1,2,3],"max_tokens":8,"stream":true}'
```

`/health` reports backend and capacity; `/v1/models` lists the local model.
`/v1/completions` accepts one nonempty token-ID prompt or a string when a local
`--tokenizer tokenizer.json` is provided. Greedy sampling is the default; finite
nonnegative temperature and an optional seed support reproducible sampling.
Unknown options are rejected. This is a **completion API subset**, not a claim
of complete OpenAI chat/tool-call compatibility. SSE emits exact token IDs;
decoded text is returned in the final event to avoid corrupting split UTF-8/BPE
pieces. Final `token_ids` contains the complete output, while earlier events
contain one delta ID each. Clients must not concatenate the final full list again.

The service binds loopback by default. It has no authentication or TLS; place a
suitable gateway in front before exposing it to a network.

## Quantized full-model CPU path

[GGUF setup and limitations](https://github.com/vx-lang/glm-vx/blob/main/docs/GGUF.md) describes the full GLM-5.3 IQ1\_S
checkpoint, memory-mapped loading, bounded expert decoding and CPU generation.
The earlier tiny-model benchmarks remain synthetic; they are not trained-model
performance evidence.

[Correctness gates and Vx performance audit](https://github.com/vx-lang/glm-vx/blob/main/docs/CORRECTNESS-AND-PERFORMANCE.md)
records the remaining parity work and an isolated compiler optimization experiment.
The [implemented trace gate and current failures](https://github.com/vx-lang/glm-vx/blob/main/docs/PARITY-PROGRESS.md) now
include full trained-weight layer/logit comparisons and independent codec checks.
[CPU prefill/decode handoff](https://github.com/vx-lang/glm-vx/blob/main/docs/DISAGGREGATION.md) runs distinct worker processes
with validated cache transfer; it is not yet an HTTP worker pool or GPU speedup.

## GPU implementation

[GPU code](https://github.com/vx-lang/glm-vx/blob/main/gpu/README.md) adds coalesced F32/FP8 projection, fused residual/RMSNorm,
warp/block reductions, split online-softmax compressed MLA, and a CUDA Driver API
runtime. Use `--backend vx-gpu` for the explicitly hybrid serving adapter.
The [original CPU report](https://github.com/vx-lang/glm-vx/blob/main/REPORT.md) remains a baseline, not a GPU benchmark.

## Serving performance

[Implemented optimizations and current evidence](https://github.com/vx-lang/glm-vx/blob/main/docs/OPTIMIZATION-PROGRESS.md)
cover packed GGUF kernels, SIMD batched prefill, exact heap selection, prefix
reuse, official eager validation and an explicit tensor-core GEMM path.

The [HTTP load benchmark and measurements](https://github.com/vx-lang/glm-vx/blob/main/benchmarks/README.md) track client
TTFT, inter-token gaps, request latency and throughput with mixed prompt lengths.
Prefill skips unused vocabulary heads, GPU MLP intermediates stay on-device,
and decode-first scheduling bounds total prefill work per round.
`--decode-prefill-tokens` (default 4) trades prompt progress for smoother decode.
Measured CPU streaming improvements carry a long-prompt TTFT tradeoff; no GPU
throughput claim is made.

## Implementation

- `kernels/kernels.vx`: float32 matvec, RMSNorm, LayerNorm, interleaved RoPE,
  stable softmax, SwiGLU, sigmoid router with correction bias, top-k and attention.
- `glm_vx/model.py`: dense and sparse blocks, selected routed experts plus shared
  experts, absorbed MLA decode, compressed request-local KV, full/shared DSA
  indexer selection, official expert reduction order and causal sequential decode.
- `glm_vx/prefill.py`: opt-in layer-wise batched prefill with grouped experts.
- `kernels/packed.vx`: fused GGUF unpack-and-dot for all trained checkpoint formats.
- `glm_vx/checkpoint.py`: lazy read-only safetensors mmap with checked headers,
  BF16/F16/F32/FP8 E4M3FN decoding and block scales. No remote code execution.
- `glm_vx/scheduler.py`: decode-first interleaving, bounded optional batched prefill,
  prompt-plus-output token admission, cancellation, failure isolation and cleanup.
  Disconnect detection is cooperative between model forwards (socket polling
  every 250 ms); keep the TCP connection open until the reply. Shutdown raises
  an explicit timeout if a forward is still running, leaving weights open.
  Optional bounded prefix snapshots reuse prompt state; this is CPU serving,
  not a paged GPU KV allocator.
- `glm_vx/server.py`: bounded HTTP handlers, JSON completion and SSE transport.

## Validation and measurement

```
.venv/bin/python -m pytest tests kernels/test_backend.py -q
.venv/bin/python kernels/test_kernels.py
OPENBLAS_NUM_THREADS=1 PYTHONPATH=. .venv/bin/python scripts/benchmark.py \
  --requests 2 --prompt 8 --tokens 8 --output benchmark.json
```

The benchmark verifies matching greedy outputs first, excludes one-token warmup,
then reports scheduler throughput and per-request time to first token on the
**tiny random model**. It does not measure full-model quality or GPU throughput.
See `REPORT.md` for the measured results and exact validation scope.

## Full checkpoint and remaining work

`--checkpoint DIRECTORY --tokenizer DIRECTORY/tokenizer.json` is an experimental
CPU path for a locally supplied checkpoint. It does not download weights.
Config/header validation and synthetic loader tests are not full-checkpoint
validation. Float32 dequantization is not numerically identical to a production
FP8 activation-quantized GEMM path. Metadata and source revisions are recorded in
`metadata/sources.json` and `docs/model.md`.

The available machine has no detected NVIDIA GPU, about 93 GiB RAM and roughly
326 GiB disk free at initial inspection. The original FP8 checkpoint is about
756 GB and does not fit on this disk. The 216.7 GB mixed-bit GGUF checkpoint was
downloaded in full and all six shard SHA256 hashes verified. No GPU hardware
was rented or provisioned.

To deliver an optimized production engine still requires: actual GPU validation
and tuning, packed/fused GPU prefill, MTP, FP8 GEMM and quantized activation
parity, paged/distributed KV sharing, tensor/expert parallel collectives,
GPU topology-specific placement, trained-checkpoint logits/generation parity,
and throughput/latency benchmarks against established engines on matching
hardware and workloads. β€œOptimal” cannot be established from this CPU prototype.
adityazero10

Interpretation history

Decision trace