Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ checkpoint. Public231 concurrency-1 latency for heads `1ba07d1`, `f968e576`,
| Kev-4B | [Pinned CPU export and Rust pointer head](recipe/kev/README.md); no worker or full-model parity yet ([#27](https://github.com/InferMatrixLab/system1-omni/issues/27)) |
| D3 (Decision 3.0) | [Python reference worker](recipe/d3/reference.md) on the checkpoint's pinned runtime; `choice`/`noul`/`score` over text, image and video state; author-run on A100 for text and media serving (see the integration and media PRs) |
| Vela 2.0 0.3B | [Python reference worker](recipe/vela/reference.md) on the checkpoint's pinned runtime; all five kinds (`choice`/`noul`/`score`/`span`/`set`) for text state; CPU FP32 validated (author-run, evidence in the integration PR) |
| Vela 2.0 0.8B hybrid | [Python reference worker](recipe/vela/reference.md) on the checkpoint's pinned runtime; same surface plus `span_heads`; [native library](recipe/vela/native.md) (bundle export, wire contract, processing, F32 heads); CPU FP32 parity recorded in the integration PR |
| Vela 2.0 0.8B hybrid | [Python reference worker](recipe/vela/reference.md) on the checkpoint's pinned runtime; same surface plus `span_heads`; [native Rust/CUDA text worker](recipe/vela/native.md#serve-the-08b-native-worker) (uniform-BF16 backbone, FP32 heads); CPU FP32 reference parity recorded in the integration PR |
| Vela 2.0 4B / 9B | Same worker and member registry as the 0.8B (one shared runtime); **historical 4B/9B validation** on an RTX 4090 48 GB is recorded in [the native recipe](recipe/vela/native.md), including frozen fixtures and CUDA executor parity. Full 4B/9B replay under the current strict span assertions remains unverified. |
| Clef-flash (9B) and Clef (27B) | [Rust `omni-clef` server](recipe/clef/reference.md) and pinned Python joint-schema executor on one persistent thread; text `choice`/`noul`/`score`. [Historical flash GPU run](recipe/clef/reference.md#controlled-migration-acceptance), with raw evidence lost after a host restart: three Public231 C1 rounds per HTTP path, 231/231 each, exact parity with frozen FLA configurations; concurrency/cancellation/child-exit checks. Fresh acceptance with durable artifacts is pending. 27B, media and a native joint head remain unverified or unimplemented |
| pplx-decider-v1.1-27b | [Python reference worker](recipe/pplx_decider/README.md) on the pinned checkpoint; `choice`/`noul`/`score` text plus up to four images. Lab L20X-labeled GPUs are the H200 target. Kept Public231 primary is `fcf5e2b`: 231/231, p50 87.782 ms, p95 291.183 ms, grouped-value FlashInfer with q and k packed before the L2 view (p50 −1.30%, p95 −1.56% versus `4b99b73` 88.942 / 295.797). `4b99b73` was p50 −4.20%, p95 −0.22% versus `ffae182` 92.844 / 296.458. Uncached all-sequence FlashInfer `3c72f02` is not the primary (p50 88.808 ms, p95 300.751 ms). Short-sequence FlashInfer `a50b9aa` missed its gate (p50 95.446 ms, p95 300.871 ms). cuDNN-first SDPA `0dcaa0ac` missed its gate (p50 138.501 ms, p95 332.859 ms). Fused gate-up `8b4ee326` missed its gate (p50 102.437 ms, p95 304.970 ms). Always-on dynamic compile `e36b32ed` missed the both-percentiles gate (p50 97.751 ms, p95 263.124 ms; p95 improved). The 512-token split `7e3b1be` missed its gate (p50 100.037 ms, p95 257.084 ms). Isolated-median compile `34ba5de` missed its gate (p50 97.084 ms, p95 256.679 ms; the 136-token probe was eager). The FlashInfer state-workspace ring `17a7b120` missed its gate (p50 89.165 ms, p95 295.723 ms). Always-on FLA residual RMSNorm `3afb472` missed its gate (p50 93.935 ms, p95 274.902 ms). Length-gated FLA residual RMSNorm `705ae089` missed its gate (p50 94.604 ms, p95 274.835 ms). `use_cp=auto` `a6f4d9a` missed its gate (p50 112.294 ms, p95 299.419 ms). Grouped-value `3ecdf5a` crashed in warmup (0/231, no p50 or p95). FLA fused gated RMSNorm `801ef7b` missed its gate (p50 89.172 ms, p95 274.790 ms). FLA `swiglu_fwd` `2bbbe4e` missed its gate (owner closeout p50 97.613 ms, p95 292.795 ms) and is not installed |
Expand Down
3 changes: 2 additions & 1 deletion docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ and candidate identity, usage, and response metadata outside the executor.
| Laya | One padded request: token IDs, true lengths, question types and ordered option markers; at most 16 questions, 512 tokens per row and 2048 markers. | Per-question FP32 option logits and two action logits copied back after GPU heads. | Calibrate and decode ordered `choice`, `score` and `noul` answers, usage and metadata. |
| JEMM | Ordered token IDs, three-axis positions, candidate counts and optional shared image patches for one complete request. | Per-question selected BF16 label logits copied back as FP32. | Apply checksum-covered text/image calibration and reconstruct ordered `choice`, `score` and `noul` answers and usage. |
| StartLux Instant 4B | One unpadded token-ID prompt per question, or per knockout group and then a final prompt, in request order. | FP32 letter logits from a CPU dot of the tied embedding rows at the last position. | Per-type temperature, none-check split, wide-choice residual, and ordered `choice`, `noul`, and `score` answers with token usage. |
| Vela 2.0 0.8B | One rendered request, with ordinary and span-window rows, question readout positions and span word offsets. | FP32 candidate logits and router/broad word-by-label logits from CUDA backbone readouts. | Aggregate span windows by question and word offset, calibrate and assemble the five typed question kinds, extensions and rendered-row usage. |
| Clef | The raw `systemone` body. Preparation stays in the pinned Python encoder. | One joint-schema forward on the executor process main thread. The Rust closure only exchanges a frame. | The checkpoint's `systemone_answer` object, forwarded with its HTTP status unchanged. |

Cua-S1 input collections are serial work. For both Open-Jev checkpoints,
Expand All @@ -172,7 +173,7 @@ retain original batch row counts; output/down GEMMs retain candidate lengths.
Request-local prefixes run as exclusive items. It restores question/candidate
grouping before normalization. Laya batches questions within one request. Shared runtime
admission precedes blocking dispatch: Cua-S1 admits one question forward at a
time; serial Open-Jev modes, Decider, Laya, StartLux Instant, and Clef admit one complete request. Clef's admitted work is the frame exchange with its executor process. StartLux runs each prompt inside that admission one at a time. Cua-S1's CPU letter projection
time; serial Open-Jev modes, Decider, Laya, StartLux Instant, Vela 0.8B, and Clef admit one complete request. Clef's admitted work is the frame exchange with its executor process. StartLux runs each prompt inside that admission one at a time. Cua-S1's CPU letter projection
stays outside admission; Open-Jev's scalar heads and Laya's GPU heads and
synchronized readback remain inside their request unit. Decider includes every
backbone row and CUDA head projection, synchronizes both streams and retires
Expand Down
2 changes: 1 addition & 1 deletion docs/supported-models.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Models that are being added are also tracked in issues labeled [new model](https
| OmniJev-4B v1.1 | [Native Rust/CUDA worker](../recipe/omnijev/native.md) on the shared Qwen3.5 vision and language path, eager | Contract, preparation, pixels, heads and finishing checked against the reference; no CPU inference | Compared with the reference on compute capability 8.9 for [140 answers](../recipe/omnijev/native.md#comparison-with-the-reference) | Not supported | Compute capability 8.0 or newer, CUDA toolkit to build, the export from `export.py` |
| D3 (Decision 3.0) | [Python reference worker](../recipe/d3/reference.md) on the checkpoint's pinned runtime — text, image and video state over `choice`/`noul`/`score`, with the deliberate transport differences documented in the recipe; the native worker is in progress ([#136](https://github.com/ThinkFlowLab/system1-omni/issues/136)) | Unverified | Author-run on NVIDIA A100 (sm_80): serving smoke and reference parity for text and media (exact decisions, max delta 0.0); evidence in the integration and media PRs. Owner: @MrDongsls. | Unverified | Python 3.12, the [pinned runtime requirements](../recipe/d3/requirements.txt), the [pinned package](https://huggingface.co/vllm-sr/d3) (~52 GB); [media budgets and the 64 MiB total request cap](../recipe/d3/reference.md) |
| Vela 2.0 0.3B | [Python reference worker](../recipe/vela/reference.md) running the checkpoint's pinned runtime | **CPU FP32 validated** (author-run, x86 WSL2, 24 cores): startup with all-kind warmup, the four example requests plus five synthetic rejections, and exact-match reference parity against the pinned upstream server on all nine (four 200s byte-equal incl. key order, agreed 422/413); byte-identical frontend forwarding; evidence in the integration PR. Owner: @MrDongsls. | Unverified (bf16-autocast is an untested deployment option) | Not supported | Python 3.12, the [pinned requirements](../recipe/vela/requirements.txt), the [pinned package](https://huggingface.co/vllm-sr/Vela-2.0-0.3B) (1.24 GB FP32 weights; ~4.4 GB with ONNX/assets) |
| Vela 2.0 0.8B hybrid | [Python reference worker](../recipe/vela/reference.md) running the checkpoint's pinned runtime (same wire layer as 0.3B); [native library](../recipe/vela/native.md) — bundle export, wire contract, processing, F32 heads and CUDA executor (no HTTP worker) | Same surface as 0.3B plus the `span_heads` field (router/broad dispatch); **CPU FP32 parity** (author-run; evidence in the integration PR) | Serving unverified; native executor parity author-run on sm_120 and on one RTX 4090 48 GB / sm_89 / CUDA 13.2 profile (4/4, worst drift 0.3297); the earlier 24 GB / CUDA 13.0 profile remains unrerun after the fixed-GEMM change | Not supported | Python 3.12, the [pinned requirements](../recipe/vela/requirements.txt), the [pinned package](https://huggingface.co/vllm-sr/Vela-2.0-0.8B) (2.02 GB shard + 4.5 MB broad head; ~3 GB FP32 parameters) |
| Vela 2.0 0.8B hybrid | [Python reference worker](../recipe/vela/reference.md) running the checkpoint's pinned runtime (same wire layer as 0.3B); [native Rust/CUDA text worker](../recipe/vela/native.md#serve-the-08b-native-worker) — bundle gate, processing, FP32 heads and typed responses | Same surface as 0.3B plus the `span_heads` field (router/broad dispatch); **CPU FP32 parity** (author-run; evidence in the integration PR) | Native serving uses uniform BF16 plus FP32 heads; executor logit parity author-run on sm_120 and on one RTX 4090 48 GB / sm_89 / CUDA 13.2 profile (4/4, worst drift 0.3297); the earlier 24 GB / CUDA 13.0 profile remains unrerun after the fixed-GEMM change | Not supported | Python 3.12, the [pinned requirements](../recipe/vela/requirements.txt), the [pinned package](https://huggingface.co/vllm-sr/Vela-2.0-0.8B) (2.02 GB shard + 4.5 MB broad head; ~3 GB FP32 parameters) |
| Vela 2.0 4B / 9B | [Python reference worker](../recipe/vela/reference.md) on the checkpoint's pinned runtime, same wire layer and member registry as the 0.8B (one runtime, shared byte-identical across the decoder members); the [native library](../recipe/vela/native.md) exports and gates them with the same member-parameterized stack (widths derived from tensor shapes) | Historical 4B/9B validation is recorded in the native recipe; full head/response replay under the current strict span assertions remains unverified | Historical CUDA executor parity was recorded on sm_89; the current 0.8B SM89 fixed-GEMM replay is documented separately in the native recipe | Not supported | Python 3.12, the [pinned requirements](../recipe/vela/requirements.txt), the pinned 4B (`d6923941`, ~9.7 GB, 3 shards) or 9B (`068425bb`, ~17.9 GB, 5 shards) package |
| Clef-flash (9B) | [Rust `omni-clef` server](../recipe/clef/reference.md) with a pinned Python executor on one persistent thread; text `choice`/`noul`/`score`, non-thinking prompt, 16384-token limit | 18 Rust lifecycle/serving and 36 Python contract tests; pinned tokenizer fixture; no CPU inference | [Historical author-run results](../recipe/clef/reference.md#controlled-migration-acceptance) on NVIDIA L20X (PyTorch capability 9.0, nvidia-smi 8.9): three C1 rounds per HTTP path, 231/231 each, exact 693-pair response parity under frozen FLA configurations; concurrency, cancellation recovery and child exit checked. Raw evidence and frozen caches were lost after a host restart; new acceptance with durable artifacts is pending. Recorded latency and the failed cache-control experiment remain in the recipe | Not supported | Python 3.12, [tested dependencies](../recipe/clef/requirements.txt), Rust `omni-clef`, pinned flash snapshot (~19.1 GB) |
| Clef (27B) | Same `omni-clef` server and text contract as Clef-flash, selected with `--variant clef` | Contract tests only; no inference | Not run | Not supported | Same stack; pinned `Cloudflare/clef` snapshot (~55.0 GB). Weights and joint-head config differ from flash |
Expand Down
4 changes: 2 additions & 2 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ nav:
- LFM2.5-350M choice worker: recipe/lfm2/README.md
- D3 reference worker: recipe/d3/reference.md
- Vela 2.0 reference workers: recipe/vela/reference.md
- Vela 2.0 decoder native library: recipe/vela/native.md
- Vela 2.0 native decoder and 0.8B CUDA worker: recipe/vela/native.md
- Clef reference worker: recipe/clef/reference.md
- pplx-decider reference worker: recipe/pplx_decider/README.md
- Vela 2.0 0.8B native library: recipe/vela/native.md
- Vela 2.0 0.8B native CUDA worker: recipe/vela/native.md
- Contributing: CONTRIBUTING.md
2 changes: 1 addition & 1 deletion recipe/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ For a first real decision, follow the [complete CPU walkthrough](../docs/getting
five SystemOne question kinds (`choice`/`noul`/`score` plus the `span`/`set`
extensions) through the Python worker and the Rust frontend on CPU FP32;
or a decoder member (0.8B `326b01d8`, 4B `d6923941`, 9B `068425bb`) behind its own 10-file gate.
- [Vela 2.0 decoder native library](vela/native.md): export the pinned-bundle
- [Vela 2.0 native decoder and 0.8B CUDA worker](vela/native.md): export the pinned-bundle
manifest gate, wire contract and token-level processing for the decoder
members (0.8B, 4B and 9B), checked against frozen fixtures; serving stays
with the reference Python worker.
Expand Down
79 changes: 73 additions & 6 deletions recipe/vela/native.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Vela 2.0 decoder native library
# Vela 2.0 native decoder and 0.8B CUDA worker

This recipe belongs to `omni-vela-native` at
[`src/models/vela/native/`](../../src/models/vela/native/). The 0.3B
Expand All @@ -13,8 +13,10 @@ program, member-parameterized): the exported-bundle gate, the wire
contract, the token-level processing, the F32 heads (widths derived
from the tensors' shapes) and scoring, and backbone execution on CUDA
through the shared qwen3_5 crate — all mirrored from the pinned
runtime and checked against frozen fixtures. This is a library; the
HTTP worker is the [reference recipe](reference.md)'s Python worker.
runtime and checked against frozen fixtures. The Rust HTTP worker serves
the **0.8B text model** through the same processor and CUDA executor.
Use the [Python reference recipe](reference.md) for reference serving and
for the other decoder members.
The recorded fixtures and parity evidence below are the 0.8B's (CPU
FP32 recordings). Historical 4B/9B runs on an RTX 4090 48 GB (sm_89,
CUDA 13.2 toolkit) recorded exact-match plans and native executor
Expand Down Expand Up @@ -271,6 +273,71 @@ small-case logit results; they do not replace complete GPU typed-answer or
native HTTP acceptance. Test wall time includes repeated bundle hashing and
is not serving latency.

## Serve the 0.8B native worker

From the repository root, export the 0.8B bundle with `--bf16-out`, save
the manifest digest printed by the exporter, and build the SM89 Qwen CUDA
library as above. The worker loads the expanded export, including its
`bf16/` directory, and keeps one CUDA model on the first visible device.
Build and launch the Rust worker and optional pass-through frontend:

```sh
bash src/backends/cuda/qwen3_5/build.sh /absolute/path/to/worker-library 89
cargo build --locked --release -p omni-vela-native -p omni-jev
export VELA_NATIVE_BUNDLE=/absolute/path/to/vela08-native
export VELA_NATIVE_MANIFEST_SHA256='paste-digest-printed-by-the-exporter'
export VELA_CUDA_LIB=/absolute/path/to/worker-library/libqwen3_5_cuda.so
VELA_NATIVE_BIND=127.0.0.1:8000 target/release/omni-vela-native
```

In another shell:

```sh
curl --fail http://127.0.0.1:8000/ready
jq '.request' tests/vela/fixtures/native-plan-Vela-2.0-0.8B-example-request.json |
curl --fail-with-body http://127.0.0.1:8000/v1/systemone \
-H 'Content-Type: application/json' --data-binary @-

OMNI_JEV_BIND=127.0.0.1:8080 OMNI_JEV_BACKEND_URL=http://127.0.0.1:8000 \
target/release/omni-jev
# Send the same POST to http://127.0.0.1:8080/v1/systemone.
```

The worker binds after bundle verification and a real warmup. `/health`
and `/ready` are direct worker endpoints. The Rust frontend forwards
`/health` and `/v1/systemone`; its backend request timeout is 60 seconds.
Keep the unauthenticated worker on a trusted interface. The native worker
accepts JSON bodies up to 8 MiB and returns the Vela error detail envelope.
It handles text and structured JSON state for Choice, Noul, Score, Span
and Set. Media and requests for other model IDs are outside its envelope.

All ordinary and window rows are planned before CUDA dispatch. The
worker admits one complete request at a time. It runs the pinned BF16
backbone per readout and computes the candidate, router and broad heads
in FP32. Only span blocks run in the window rows. Those rows carry
their ordinary row's question and head attribution. Span logits are
aggregated by original word offsets before calibration and response
finishing. Usage sums rendered ordinary and window row lengths, with
zero generated tokens. A disconnected client cannot release an executing
request's admission before its CUDA work returns.

Run the original CPU tests and opt-in checks above separately. The
complete GPU capture uses the same executor and finisher as HTTP:

```sh
# JSON array of [case-name, absolute-path-to-request-json] pairs
export VELA_PIPELINE_CASES=/absolute/path/to/cases.json
export VELA_PIPELINE_OUTPUT=/absolute/path/to/new-output-directory
cargo test --release --locked -p omni-vela-native --test vela_native_pipeline \
-- --ignored --nocapture
```

Capture output includes the actual token plan, raw per-row head logits
and complete typed response. Compare against separately frozen paired
reference outputs. The recorded 0.35 replay gate covers raw logits.
The existing CPU response gate covers finishing on frozen reference
readouts. Complete GPU typed numeric acceptance needs its own criterion.

## Scope and limits

- Each completed ordinary row and span-window row must contain at most
Expand Down Expand Up @@ -299,6 +366,6 @@ is not serving latency.
token-level processing, F32 heads, scoring and span decoding, the
SystemOne response finishing, and backbone execution through the
shared crate (full-sequence per readout position, fixed-GEMM replay).
- Not implemented: the HTTP worker around the library, long-span GPU
parity on the windowed case, and measured serving latency. No
performance claims are made.
- The native HTTP binary supports the 0.8B text profile. No serving
latency, throughput, or other decoder member's native HTTP evidence
is claimed here.
Loading