Files
leleka/docs/experiments/2026-10-03-gpu-resident-rows.md
T
Pavlo Ratushnyi 4013e0c9bd
Desktop foundation / core (ubuntu-latest) (push) Failing after 28s
Desktop foundation / core (macos-latest) (push) Canceled after 0s
Desktop foundation / core (windows-latest) (push) Canceled after 0s
Linux / verify (push) Canceled after 0s
Linux / keyless-cuda (push) Canceled after 0s
Linux / static-cuda-package (push) Canceled after 0s
Linux / hosted-cuda-package (push) Canceled after 0s
Linux / linux-static-cli (push) Canceled after 0s
Linux / linux-cli-container (push) Canceled after 0s
Linux / release-cli (push) Canceled after 0s
Import tracked Strata Next source snapshot
2026-10-05 18:15:08 +02:00

4.2 KiB
Raw Blame History

Resident KAR rows on RTX 5090, 2026-10-03

Setup

This isolated CUDA experiment measured the proposed compressed-VRAM geometry for a real Qwen3.8-Flash-Next IQ3_S PLE partition. Hardware was the Linux RTX 5090, NVIDIA driver 595.91.07, CUDA 13.2. The selected level-2 record was per_layer_token_embd.weight#strata-part-001-of-002 in the private v4 archive described in the paired report. The benchmark binary was rebuilt from this repository's pinned libkar plus the strata-kar-gpu-smoke --rows extension. The archive was opened with payload CRC verification before timing. Data and executable builds remain outside Git on the Linux host.

The command was:

strata-kar-gpu-smoke MODEL.kar 'per_layer_token_embd.weight#strata-part-001-of-002' 2 100 --rows 4096 42

It admitted one compressed level prefix to VRAM, uploaded 4,096 deterministic row IDs, warmed the CUDA decoder, then measured 100 repeats of the same rows. The result was:

Measure Result
Record shape 200,000,000 rows × 160 values
Compressed record resident in VRAM 10,000,000,016 bytes
Compressed bytes per row 50.0
Original IQ4_NL bytes per row 90
Initial reserve 497.54 ms
Decoded output 655,360 F32 values (2,621,440 bytes)
Warm CUDA decode median 0.00512 ms
Output FNV-1a 64 4c459b6ac39d3431

For this partition, the compressed GPU representation uses about 44.4% less space per row than its original IQ4_NL table (50 versus 90 bytes), before GPU allocator overhead. The fast warm decoder shows that a resident compressed record can supply selected rows cheaply. This does not measure archive admission frequency, replacement policy, row-ID transfer per request, host page faults, matrix multiplication, or agent throughput. The 10 GB record competes directly with the existing expert and KV caches on a 32 GB card. The timed batch reused the same row IDs, so a varying-request benchmark is still needed. The full archive does not fit on the card. No serving code used this GPU output, and the batch checksum was not independently compared to CPU reconstruction; the previous single-row CPU/CUDA parity check covers the underlying decoder only. These limits prevent a performance or model-quality claim for the runtime.

Follow-up: changing row IDs and independent batch parity

The same RTX 5090 and archive were used with a rebuilt smoke binary (CUDA 12.8.1 toolkit, driver API 13.2). The --rows-ple mode uses the deterministic row generator from Strata's CPU PLE probe. For 4,096 random rows, level 2, seed 42, and 100 warm repeats, the resident decoder's complete F32 output checksum was 00cc55a3da2ef31b, identical to the independent CPU KAR gather's checksum on the same rows. This closes the batch parity gap in the first measurement. The native IQ4_NL gather's different checksum is expected because KAR level 2 is lossy; full-model quality has a separate gate.

--rows-ple-vary then replaced every row ID before each timed repeat, using pinned host memory for the ID upload. The host generated the next ID batch outside the timed CUDA events. Each invocation verified the archive payload CRCs, staged the 10,000,000,016-byte prefix once, and ran 100 repeats. The medians below are CUDA-event times in microseconds, not request latency:

Rows per batch ID upload Resident decode Upload + decode
16 2.912 3.200 6.048
4,096 3.136 5.632 8.704

The 4,096-row fixed-ID parity run had a 4.512 µs warm decode median. The changing-ID result includes the different memory access pattern but still excludes PLE projection, cache admission and eviction, host ID generation, competing expert/KV cache pressure, and the rest of inference. Its final-batch checksum (571247f5d41f34ae) is not compared with the CPU probe's first batch. The 16-row changing-ID final checksum was c4bf921377ba537e. No inference speedup or full-model quality result follows from these numbers.

Next: implement a bounded resident cache, measure expert/KV displacement, wire the decoded rows into the PLE consumer, then run paired inference and agent quality gates. Keep the native profile available for rollback.