mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #5050] [Benchmark] RTX 3090 / IQ2_XS: exchange rotation ABBA and remaining CPU hotspots #2340
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#2340
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @AlanJager on GitHub (Nov 3, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/5050
What did you measure, or what went wrong
On one RTX 3090 / AVX2 VM, the existing
STRATA_EXCHANGE_ROTATE=1removed the RAM commit-copy hotspot and improved median decode by 9.13% for code and 7.01% for Chinese prose in a small, four-start ABBA. The residual CPU profile is dominated by doorbell polling, router lookahead and pool-worker polling. Repair correctness was variable in both arms, so this is a performance/diagnostic report with failed outputs included, not a claim of quality parity.Related discussions: #1922 (lookahead with fully resident experts), #921 (pool spin trade-offs, including the maintainer's 10+ pair requirement), and #4624 (
SPIN_US=0still paying the initial pause stage). This adds engine 0.1.55 data after removing commit memcpy, rather than opening another duplicate lookahead/spin bug or requesting a blanket default change.Environment and frozen controls
sm_86; NVIDIA 580.126.09; CUDA 12.8 source build, GCC 11.4, Release. No local engine/kernel changes.5.15.0-161-generic; Xeon Platinum 8260 VM, 32 guest vCPUs, AVX2 exposed, about 62.76 GiB visible RAM, no swap. Guest topology: eight virtual sockets × four cores, one NUMA node; this does not establish the physical NUMA layout.c62d5e3a15b40ea51c96aae9e8d36928965f53ab. This is a pinned result, not a fresh benchmark of today's main.43b39750bcee469d2a35d31997d2484755be46cb721abf9ede4ff816c89fb2f8.Qwen3.8-Flash-Next-GSQ-RCO-IQ2_XS, native GGUF pack, same two GGUF shards/MTP and same initial expert profile on every fresh start.pcie-frac=1; the counter is included below.spec=4, suffix draft=3; status reportsspec=6,mtp_max=4, equal across arms. Default lookahead and pool-spin settings were kept in both arms; their disable/short-spin options were not tested in this campaign.Common engine arguments (replace the file placeholders with the same local files; copy the frozen profile afresh before each start):
Common environment:
STRATA_ROUTE_TAIL_SKIP=0,STRATA_PREFILL_CPU_SHARE=0,OMP_NUM_THREADS=2,OPENBLAS_NUM_THREADS=2. Other inheritedSTRATA_*variables were cleared. A setsSTRATA_EXCHANGE_ROTATE=0; B sets it to1. The official sm_86 automatic switches were left as shipped.Method: unprofiled speed separate from CPU profiling
Fresh starts A → B → B → A, 14 serial HTTP requests per start, 56 total:
perf record.Greedy
temperature=0,top_p=0.95, seed20261013, reasoning effortnone, streaming. Prompt/conversation reuse disabled,cache_n=0checked. Four unprofiled samples per arm/workload come from only two engine starts, not four independent machines or starts. Changes below are ratios of arm medians, not medians of paired ratios. Free-generated texts/MTP/routing trajectories were not held token-identical.No perf, GPU profiler, periodic resource sampler or smaps scan ran during the unprofiled requests; lightweight
/procsnapshots were taken at request boundaries. Loading and offline perf decoding are excluded. This is a custom benchmark, not the standardstrata bench runprotocol.An earlier harness attempt retained seven unprofiled requests, then failed before its first perf capture because an output subdirectory was absent. That attempt and restoration were preserved; after fixing directory creation, the complete four-start campaign above was restarted. Those seven requests are excluded from these tables. No slow or failed model answers in the completed campaign were discarded.
Unprofiled results
Each measured code/prose request generated 512 tokens; engine-reported decode timing, client TTFT/E2E:
Code ranges separate; prose ranges overlap slightly. Code CPU-s/1k output tokens fell 8.98%; prose rose about 1.00%. Thus avoiding memcpy did not produce a uniform reduction in whole-request CPU cost. Only two starts per arm: these numbers do not justify a universal speedup/default recommendation.
All 16 unprofiled fixed-output samples (CPU routed entries are not distinct experts)
Memory trade-off
The model has three expert-block sizes: 1,177,600 / 1,305,600 / 1,510,400 bytes. With 96 exchange ordinals and no async bounce ordinals:
In the preceding same-build resource audit,
Pss_Shmemincreased by exactly this amount (17,229.582 → 17,456.926 MiB); GPU cache capacity was unchanged. General budget with N ordinals, b bounce-only ordinals, S=sum(distinct sizes), L=max(size):extra=(N-b)*(S-L). This describes buffer payload; metadata/driver overhead is additional. It is not a VRAM increase or a DRAM-bandwidth measurement.CPU perf attribution
Twelve
cpu-clock:ucaptures at 99 Hz, DWARF stack size 8 KiB, monotonic clock, zero lost samples. Each recorder attached to the engine PID/current threads with inheritance for new threads; HTTP-server CPU was outside that target. Control-pipe enable/disable acknowledgements bracketed each request. Record and counter passes were separate.Attribution below uses first streamed content → SSE end, excluding prefill and the first decode step before content was received. Percentages divide by sampled user CPU time across threads, not GPU time or request wall time. Recording measurably disturbed speed; only the unprofiled table above is a speed comparison.
The RAM-copy cost under
FileExpertSource::commit_exchangeswas:The no-copy branch is visible in commit_exchanges, and native rotation counters advanced in B. Zero sampled copies is supported by source/counters but does not measure sub-sample metadata cost. H2D/D2H and other process copies still occur.
The installed libc's exact debug package was unavailable and the Ubuntu build-ID symbol lookup returned 404. Original unnamed frames were retained. To identify the copy region, I cross-checked original MMAP2 addresses, runtime
memcpy/memmoveIFUNC selection (both at ELF offset0x1aedc0), the adjacentmemsetentry at0x1af9c0, disassembly, and the commit call chain. The derived IFUNC-region label is not an upstream debug-symbol name.With rotation enabled, code-request exclusive leaf shares (medians of two captures) were:
Verifier::runbf16_rows_dot_multi)These are symbol-based categories, not exact instruction-level accounting of every math operation. Original-binary
perf annotateon all four code captures places approximately 99.7–100% of samples within the Verifier::run function in its doorbell pause/check loop, and approximately 100% within ExpertPool::worker in its epoch pause/check loop. Those local-function percentages are different denominators from the table above; timer skid also prevents interpreting them as individual-instruction latency.Relevant pinned source: Verifier doorbell wait, worker parking loop, 20ms default, lookahead initialization.
Expert file-blob reads stayed at zero, with a full resident RAM complement, while file-tier lookahead continued to run. This is additional cost evidence relevant to #1922; I have not measured the effect of disabling it on this machine. CPU-clock sampling observes on-CPU spinning, not blocked/off-CPU wall time. Reducing spinning might save CPU without making the GPU finish sooner.
Hardware-counter passes used
{cycles:u,instructions:u}and separately{cache-references:u,cache-misses:u}; all counters were nonzero and reported 100% running time. Prose cache-misses/output-token medians were 603,813.82 → 398,779.22, but outputs/routing also varied. The VM exposes no uncore IMC, so I do not report DRAM bandwidth or infer PCIe bytes from those events.Repair quality: failures included
The repeated repair task implements
retry_delays(attempts, base, cap), preserves type/negative-input rules, and must handle 10,000 attempts without float-conversion overflow. A fixed 14-test grader checks those conditions. Every answer below naturally stopped within the 2,048-token cap:Unprofiled repair was 1/2 fully passing in each arm. Record was A 2/2 vs B 0/2; stat was A 2/2 vs B 2/2. These are repeated samples of one repair task, not a multi-task accuracy score. Failure examples: repeated list expansion/wrong result length (the large test hit the grader's memory bound), a leftover
passcausingvalto be unbound, integer-to-float overflow, and failure to cap the first element. System logs showed no new OOM/Xid.This does not establish that rotation caused a correctness regression: both unprofiled arms failed once, and trajectory/CPU fallback changed. It does mean these timings should not be read as a completed quality-parity validation. Fixed-prefix / A–A and stepwise-logit checks are still needed.
Exact workload fixtures and request settings
The code/prose fixtures below override their output cap to 512; repair uses 2048. Each fresh engine starts with the same code/prose warmups, then code/prose twice, repair, record code/prose/repair, stat code/prose/repair, and cache prose.
Suggested handling / next validation
I would first evaluate the existing opt-in controls, keeping the current defaults during measurement:
STRATA_LOOKAHEAD=0. Any automatic skip should depend on actual complete coverage, preserve file-backed/partial layouts, Foresight/statistics users and explicit overrides (as discussed in #1922).STRATA_POOL_SPIN_US, across CPU-light and CPU-positive workloads. CPU savings need wake-up/tail-latency checks; #921 includes opposite-regime regressions, and #4624 documents the remaining initial pause stage at zero.Would this be a useful additional data point for the existing discussions, and which validation would be most helpful next? The four-start rotation ABBA here is not the 10+ pair, multi-regime default-spin validation requested in #921. No proposed lookahead/spin-policy change has been implemented or benchmarked here, and I am not opening a PR with this report.
Reproduction status
Measured locally, at the pinned commit above. Raw requests, generated code, grades, perf.data, scripts, annotations and manifests are retained locally; the public text contains only synthetic workload fixtures and sanitized results. Written with AI assistance; numerical tables were checked programmatically against the saved records.