Repository navigation
Conversation
…he isolation --api-keys FILE reads named customer keys; they reach only the chat APIs and /v1/models. Cached conversation states are tagged with the key that made them and reused only by it. --usage-log appends one JSON line per answered request, --max-waiting answers 503 with Retry-After past the queue limit, --max-tokens caps reply length, GET /health answers without a key, and a reply stops when its client disconnects. docs/HOSTING.md covers keys, TLS behind a proxy, systemd, billing from the usage log and several GPUs.
GpuModel::load_slots keeps N sequences on one GPU, each with its own KV cache, DeltaNet state and saved-state copy (allocated before the expert plan). step_rows runs one forward over the next token of up to 4 slots; its rows are bit-exact against step() for the same expert placement (slots_match_single, CUDA and Vulkan, GPU and CPU experts). serve --parallel N runs each request on its own thread. The model thread prefills one prompt at a time in the free slot that holds the longest matching prefix of the same key, and batches the decode steps of the held slots, oldest first. A panic on the model thread now ends the process instead of hanging it. MTP is off with more than one slot. 35B Q2_K_XL on an RTX 3060, ctx 4096: 90 tok/s total with --parallel 1 and 4 requests, 139 with 2, 164 with 4 (41 each), 149 with 8. docs/HOSTING.md covers the option, its memory cost and the numbers.
A long prompt no longer stops every stream for its whole prefill. After each prefill chunk the decoding slots run for as long as the chunk took, so the prompt and the streams share the GPU evenly (prefill_with / prefill_cached_with take a hook; the single-request path passes a no-op). The scheduler state moves into a Sched struct that the main loop and the hook share. A 10K-token prompt arriving while 3 requests stream (35B Q2_K_XL, RTX 3060, --parallel 4): the longest pause of a stream drops from 6.5 s to 2.2 s with the calibrated 4096 chunk (0.7 s with --chunk 1024), and the prompt's first token comes after 10.2 s instead of 6.5 s. slots_match_single checks that decode steps between prefill chunks change neither the decoded slot nor the prefilled one.
step_rows returns each row's argmax and copies a row's logits back only when asked, so greedy requests no longer copy a full logits row per token. A request alone on a --parallel 4 server decodes 105 tok/s instead of 101 (106 with --parallel 1); 4 requests 168 tok/s in total.
load_split takes the slot count; each part keeps the KV cache and recurrent state of its own layers for every slot, use_slot switches all parts, and step_rows passes the batched hidden rows from part to part as pass() does. The cards still take their layers in turn, so the gain is the batching. slots_match_single also runs on a split (the same GPU twice), bit-identical on CUDA and Vulkan.
…led ones A client that closed the connection near the end of a stream had received almost all of the reply, but nothing was logged, so it could not be billed. Such requests now get a line with finish "cut" and the tokens decoded so far; requests that failed on the server get finish "error".
Adding or removing a customer no longer needs a restart, which would cut the replies being generated. A file that does not parse, or one with no keys (which would leave the server open), keeps the old keys. A key's id for its cached conversations now comes from the key itself instead of its line, so a reordered file gives no key another key's conversations.
Anthropic clients ask it for the size of a prompt before they send it. The count is of the prompt as the model sees it, template and tools included, so it equals input_tokens of the same /v1/messages request.
systemctl stop or restart cut every reply in progress. Now new requests (and /health) get 503 with Retry-After while the current ones finish, so a load balancer can move traffic and servers can be restarted one at a time. HOSTING.md: TimeoutStopSec, and nginx retrying a 503 on another server.
Admin key only, answered while a reply is generated, like /api/stats: up, slots, busy, waiting, uptime, request and token totals, VRAM, and expert cache hits and misses for MoE models. HOSTING.md gains a scrape example and no longer says the requests in a pass share their expert weights: only the dense and shared-expert weights are read once, the routed ones per request.
Queued chats started in arrival order, so one customer who sent many requests at once held back every other customer's. The waiting chat whose key holds the fewest slots now goes first, the oldest among those. Without --api-keys every request has the same owner and the order is unchanged. Measured with --parallel 2: six requests from one key, then one from another; the lone request finished last before and third now.
Counted in the connection thread once the request is read, so a key over the cap gets 429 with Retry-After and rate_limit_error before it takes a place in the queue; the place is freed when the reply ends. The admin key is not counted. Set below --max-waiting, one customer can no longer fill the queue and leave the others with 503.
…the proxy The proxy section still said Strata answers in arrival order and needs nginx limit_conn per key; --max-per-key and the fair slot queue now cover that. Also: cutting off a prepaid key, and the usage line's time is when the request started (the struct comment said finished).
A client that gave up while its request waited kept its place in the queue and under --max-per-key, and its prompt was then prefilled for nobody. Under --parallel the waiting request now watches its connection every 250 ms and the scheduler drops it; a prefill whose client left during it frees its slot again. Without --parallel the request is dropped when its turn comes. Such requests are not in the usage log. Stress test, --parallel 4 --max-per-key 4, three keys, 40 requests with random client timeouts: 22 answered 429 and 5 completed before, 10 and 11 now; busy and waiting return to 0 and every key is answered afterwards.
…lot and is logged The request thread gave up its reply channel as soon as the client left. A result sent in that moment was dropped with the channel, and its slot stayed held for good. The thread now flags the chat and waits on: the model drops it while it is queued, or sends its slot once the prefill ran. Such a prefill is logged as cut, with all its prompt tokens, instead of not at all.
- A request that panics under --parallel still gives back its waiting and live counts, so the model thread can switch models and stop. - The key lock is no longer held while a 429 is written (a slow client could stall the key reload and, behind it, every new request). - --max-per-key 0 is refused at start instead of answering 429 to everyone. - The key file's time is taken before it is read, so an edit in between is reloaded. - The key file is reloaded after the connection is counted, so the SIGTERM watcher waits for a connection that stalls in the reload.
…fuse an empty key file The model thread now returns once SIGTERM came and the accepted requests are answered, so the routing profile is saved as on a model switch and the next start places the experts as well. The watcher thread still exits a server with no model or one loading, 3 s later. A key file with no keys and no admin key left the server open at start; it is refused, as on reload.
… the README The quick start runs as the service user, so it can read the key file, and calibrates with the server's --ctx and --kv; the key update keeps the file the service user's. --max-waiting counts every open connection; /health gets 503 when full or stopping; the drain runs the queued requests too and saves the profile; the 30 s limit is per read and bodies need Content-Length; nginx failover gets max_fails=0. README: max_tokens, stop, n and thinking.
Without --parallel, a 401 or 400 waited in the queue behind the reply being generated, so a scan for keys held queue places. The connection thread now refuses them as soon as the request is read; handle keeps its own checks for keys that change meanwhile.
…request A request waiting for a slot counted as busy, so strata_busy could exceed the slots, and its prefill_ms included the wait. The scheduler now sends when the prefill began. The usage log fields prefill_ms and decode_ms are documented.
Without --parallel, GET / waited for the reply being generated (about 4 s in a test). The connection thread now serves it, with the same Host check when the server has no keys.
SDKs and chat front ends list the models often, and without --parallel the list waited for the reply being generated. A model still loading is listed, since its chats wait for the load.
…issue RustingStudio#21); CI builds Linux and Windows on push
… b12191 with MoE cache
…, quality table in BENCHMARKS
is_default_model compared the whole path with DEFAULT_MODEL, so on any machine where the reference GGUF is not at that path the default-model checks were skipped (the 0.05 tolerance of gpu_forward_matches_cpu_reference, the type coverage counts in tests/kernels.rs, the shapes in tests/quant.rs and tests/gguf.rs). A copy named Qwen3.6-35B-A3B-UD-Q2_K_XL.gguf under STRATA_MODEL now counts as the default model. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Full test suite on CUDA and Vulkan (185 passed, 0 failed on each card), bench numbers, the Vulkan shared-memory preflight, and a note on a driver hang in vkDestroyDevice that parallel tests can hit on NVIDIA 615.71.09. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A100, A30, L40S and H100: tested rows, results, and default-model test checks by file name
…epSeek-V4.1-Flash Bench before and after `calibrate` on each card for three Qwen3.6-35B-A3B files, plus DeepSeek-V4.1-Flash-1017 IQ2_XXS generate on an A100 and an H100 NVL. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…8-bf16-deepseek docs: calibrated A100/A30/L40S/H100 runs (Q2_K_XL, Q8_0, BF16) and DeepSeek-V4.1-Flash
…a, A100 40 GB results; GTX 1080 Ti does not run Tested rows and calibrated benchmarks for eight cards on a second cluster, the kernel tests that need STRATA_VK_F16_TRUNC=1 on Turing as well as Volta, and what happens on a GTX 1080 Ti (neither backend runs). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014eNPMupWL2tifApEBfcCgi
gemm_f's h2 packed with packFloat2x16(f16vec2(..)), which the NVIDIA Volta and Turing Vulkan drivers truncate toward zero. Build the pairs from rh (software round-to-nearest) and packHalf2x16, so the f16 GEMM sees the same operands as CUDA's __float2half on every device. This removes the STRATA_VK_F16_TRUNC test escape hatch and makes the cross-backend GEMM check strict again. It also merges the duplicate V100 rows and fixes the 2080 Ti resident-expert range from RustingStudio#27.
gemm_f's h2 packed with packFloat2x16(f16vec2(..)), which the NVIDIA Volta and Turing Vulkan drivers truncate toward zero. Build the pairs from rh (software round-to-nearest) and packHalf2x16, so the f16 GEMM sees the same operands as CUDA's __float2half on every device. This removes the STRATA_VK_F16_TRUNC test escape hatch and makes the cross-backend GEMM check strict again. It also merges the duplicate V100 rows and fixes the 2080 Ti resident-expert range from RustingStudio#27.
525a976 to
ea4c8a8
Compare
|
Thanks, this is a really useful report. I pushed a fix to your branch: gemm_f now rounds f16 GEMM inputs in software (rh + packHalf2x16), so the Volta/Turing truncation is gone — STRATA_VK_F16_TRUNC and the test workaround are deleted. Also merged the duplicate V100 rows and fixed the 2080 Ti resident range. CI passes and the Vulkan kernel suite passes on an RTX 3060.
|
|
Thanks for the fix. Re-ran on 1. Test suite: all four cards pass without the variable.
2. Vulkan prefill is 2-6% slower with the software conversion. Same bench as in the doc (Q2_K_XL,
The pp 4096 ranges do not overlap on any of the three, and CUDA on the same nodes is unchanged, so it is the shader and not the node. The calibrated MTP run on the V100 shows the same -2.9% at pp 4096 (1597.7 -> 1551.9). Decode is not affected. The V100 32 GB bench is still queued. Whether 2-5% of Vulkan prefill on Turing/Volta is worth a specialization constant is your call; I can re-measure if you add one. 3. sm_61: PR coming separately (early "requires sm_70" error and the 4. Bigger models: fair point. Q8_0 (37.8 GB) and BF16 (71.1 GB), the same files as in |
…cards RTX 2080 Ti, Quadro RTX 6000 and both V100s pass 185 tests at ea4c8a8 with the variable unset. Vulkan prefill at pp 4096 is 2-5% lower than at f47e370 on the same nodes. Q8_0 bench on A100 40 GB, A40, RTX 4500 Ada, Quadro RTX 6000, RTX 2080 Ti and V100 16 GB. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014eNPMupWL2tifApEBfcCgi
|
Pushed One correction to my comment above: the Quadro RTX 6000 re-run landed on another card of the same node, and CUDA pp 4096 moved +1.2% there, so its -1.8% on Vulkan is not evidence by itself. The RTX 2080 Ti (-5.0%) and V100 16 GB (-2.8%) hold: CUDA on those nodes moved by 0.0% and +0.1%. Q8_0 in short (CUDA, pp 4096,
Still queued: Q8_0 on the RTX A6000 and V100 32 GB, the V100 32 GB bench re-run, and BF16 on the five larger cards (the first shard is still downloading). The sm_61 change is #28. |
|
@yugt I also worried about DeepSeekV4.1 1017 performance and it's popular big local MoE model so could you rerun on the same nodes, page cache warm, with as many cores as the scheduler gives (ideally 32) and a budget sweep near the card limit? A100 80 GB: STRATA_DS_GPU=1 STRATA_DS_PROF=1 STRATA_DS_GPU_EXPERTS=60,64,68,70 Same prompt and -n 128. Please report, per budget: end-to-end tok/s, VRAM hit rate, expert/attention ms, and read_bytes so we know the cache is warm. If you can, add a llama.cpp baseline on the same node/file/prompt (--cpu-moe, current build) so we know what the target is. |
|
@yugt I don't know what you do and why you have so much GPUs and etc. but what do you think if I will try to bring RustingStrata closer to vLLM, so people like you can use it to sell API and maybe it will be even better then vLLM, I just want to know if you need this and if yes, then I will try to make it |
* feat(cuda): Volta tensor cores in prefill attention (M2-T2) Move `attn_prefill_t`'s QK^T and PV products from the emulated `mma.m16n8k16` to `mma.sync.aligned.m8n8k4` (SASS HMMA.884) on sm_70, under `#if __CUDA_ARCH__ < 800 && GEMM_TC`, with the per-lane mapping already proven by `gemm_q` in M2-T1. - QK^T: A = Q rows `8*j + t + 4*hi`, B = K row `8*(4*ng + c) + t + 4*hi`, eight `mma884` per 16-deep k step; accumulators `s2[ng][j][4*p4 + 2*p2 + e]` are a view of the existing `float s[FA_BK/8][4]`. - softmax: rows `8*j + (t&1) + 2*p2 + 4*hi`, keys `8*(4*ng + c) + (t&2) + 4*p4 + e`, row max/sum across the eight lanes of the row with `__shfl_xor_sync(.., 2/4/8)`; `mT`/`lT` hold the lane's four rows, `lT` reduced once after the last tile. - PV: P staged into a warp-private 64 x (FA_BK + 8) half tile appended after `vs` in `fa_sm` (`__syncwarp()` publishes it), A read as two `ld_s32`, B from the transposed V tile as four `ld.shared.u16`; accumulators `o2[j][grp][...]` are a view of the existing `float o[HD/8][4]`. - store loop mirrors `gemm_q`'s sm_70 loop; the key/dim loops are written over `FA_BK/32` and `HD/32` groups for M2-T3. The shared-memory request grows by the 5120 B staging tile (max 72704 B at hd = 256, below the 96192 B opt-in) in `attn_prefill_m` and `dyn_shmem_need`, with the asserted numbers updated. `STRATA_GEMM_FMA` (`GEMM_TC`) now selects the fallback for the prefill GEMM *and* attention. Additive-only in kernels.cu: the `m16n8k16` path stays verbatim in the `#else` branch, the sm_80 preprocessed source is byte-identical and the sm_70 FMA variant is source-identical to v100. * docs: M2-T2 prefill attention tensor-core numbers (V100) Append the dated M2-T2 block: the m8n8k4 mapping used by `attn_prefill_t`, the `attn_prefill_matches_decode` and `kv_q8` relative errors on both the tensor-core and the `STRATA_GEMM_FMA` build, the bench table (prefill 2045.3 / 2795.3 / 2263.7 tok/s against 833.6 / 1030.7 / 489.2 for the FMA build, decode unchanged), the `nsys` per-kernel comparison (`attn_prefill_256` 6.124 ms vs 70.760 ms per launch, -91.3 %; total kernel time -64.6 %), and the no-new-`Xid` statement.
Eight more NVIDIA cards from a second Slurm cluster, each benchmarked before and after
calibrateon CUDA and Vulkan, plus the test suite, and one card that does not run. Docs only.Runs at
f47e370,Qwen3.6-35B-A3B-UD-Q2_K_XL.gguf, one GPU per job with 8 cores and 48 GB RAM,cargo testwith--test-threads=1.pp 4096 prefill / decode, tok/s ("MTP off" is the calibrated run with
--mtp 0; "calibrated" uses the MTP thatcalibratechose):cargo testThe cards sit in hosts with different CPUs, so compare within a row. The model fits in VRAM everywhere except the 2080 Ti (8213-8712 experts resident, hit rate 99.7-99.9%).
Two things I ran into
1. Four Vulkan kernel tests fail on Turing too, not only on the V100. On the RTX 2080 Ti, the Quadro RTX 6000 and both V100s,
f16_weight_uploads_as_f32,gemm_matches_reference_for_every_type,gemv_partial_superblocks_and_q2_0andvulkan_type_matrixfail with relative errors around 5e-4. WithSTRATA_VK_F16_TRUNC=1all four cards pass 185 of 185. The two Turing cards report cooperative matrices (f16 and int8) and run driver 615.71.09, the same driver on which the Ampere and Ada cards pass without the variable. So the truncating f16 conversion is not specific to the Volta driver; the comment attests/kernels.rs:339says it is. The Turing and V100 Vulkan rows say "Runs, test suite passes withSTRATA_VK_F16_TRUNC=1" and note that the variable only changes what the tests expect.2. A GTX 1080 Ti (Pascal, driver 580.95.05) runs on neither backend.
--backend vulkan:no usable Vulkan device 0 (0 usable; NVIDIA GeForce GTX 1080 Ti: missing shaderFloat16).--backend cudawith NVRTC 12.6: the startup line iscuda device 0: NVIDIA GeForce GTX 1080 Ti, sm_61 (Volta, m8n8k4), thenNVRTC compile of kernels.cu failedwithdefault_program(2321): error: identifier "__nanosleep" is undefined.The README said "Pascal and older use Vulkan" and
SUPPORTED_GPUS.mdsaid "Use--backend vulkan; not tested"; both now say what happens on this card, and the README's Vulkan requirements listshaderFloat16.cargo teston that card reports 185 passed only because every GPU test skipped (no usable Vulkan device, and that job had no NVRTC loaded), so I did not count it as tested.Would you like a small separate PR for this: an early "sm_61 is not supported" error for devices below sm_70 instead of the NVRTC compile failure and the "Volta" label? I have not written it.
What is not in here
STRATA_VK_F16_TRUNC=1runs got the variable throughsbatch --export=ALL; the logs do not echo it. Three of the four reruns landed on another node of the same card type than the run without it (the Quadro RTX 6000 was the same node).vkDestroyDevicehang from A100, A30, L40S and H100: tested rows, results, and default-model test checks by file name #24.Full tables (mean, min-max of 3 repetitions), what
calibratechose, hosts and startup lines are indocs/more-nvidia-results.md.🤖 Generated with Claude Code
https://claude.ai/code/session_014eNPMupWL2tifApEBfcCgi