[GH-ISSUE #5050] [Benchmark] RTX 3090 / IQ2_XS: exchange rotation ABBA and remaining CPU hotspots #2340

Closed
opened 2026-11-04 01:58:33 +07:00 by bsakaguchi · 0 comments
Owner

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=1 removed 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=0 still 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

  • One RTX 3090, 24 GiB, sm_86; NVIDIA 580.126.09; CUDA 12.8 source build, GCC 11.4, Release. No local engine/kernel changes.
  • Ubuntu 22.04.4, Linux 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.
  • Engine 0.1.55, measured commit c62d5e3a15b40ea51c96aae9e8d36928965f53ab. This is a pinned result, not a fresh benchmark of today's main.
  • Same executable in both arms, SHA256 43b39750bcee469d2a35d31997d2484755be46cb721abf9ede4ff816c89fb2f8.
  • Model: original 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.
  • Actual GPU expert cache: 13,503 slots / 18,530 MiB, arena 16,461 MiB, identical in all four starts. Official 16 staging slots, 7 pool workers. CPU fallback entries remained nonzero despite pcie-frac=1; the counter is included below.
  • Requested spec=4, suffix draft=3; status reports spec=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):

--serve --pack <IQ2_XS_PACK>
--native <GGUF_SHARD_1> --ple-gguf <GGUF_SHARD_2>
--expert-profile <FRESH_COPY_OF_FROZEN_PROFILE>
--expert-cache 18432 --prefill 2048
--spec 4 --spec-min-p 0.5 --mtp <SAME_MTP_DIRECTORY> --suffix-draft 3
--max-context 32768 --kv int8 --ple-io ram
--pcie-frac 1 --pcie-mode kernel --pool-workers 7 --aux-cpus auto
--adapt-every 4 --adapt-swaps 96 --adapt-decay 0.7 --adapt-async 0
--prompt-cache 0 --conversation-cache-mib 0 --resident-experts

Common environment: STRATA_ROUTE_TAIL_SKIP=0, STRATA_PREFILL_CPU_SHARE=0, OMP_NUM_THREADS=2, OPENBLAS_NUM_THREADS=2. Other inherited STRATA_* variables were cleared. A sets STRATA_EXCHANGE_ROTATE=0; B sets it to 1. 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:

  1. Two 512-token warmups (code and prose).
  2. Two repetitions of each 512-token workload without perf, then one repair request with a 2,048-token cap.
  3. Separate requests for code/prose/repair under perf record.
  4. Separate requests for code/prose/repair under grouped cycles/instructions counting.
  5. One prose request under grouped cache-reference/cache-miss counting.

Greedy temperature=0, top_p=0.95, seed 20261013, reasoning effort none, streaming. Prompt/conversation reuse disabled, cache_n=0 checked. 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 /proc snapshots were taken at request boundaries. Loading and offline perf decoding are excluded. This is a custom benchmark, not the standard strata bench run protocol.

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:

Workload A tok/s median (range) B tok/s median (range) Change TPOT ms/token A→B TTFT s A→B E2E s A→B Engine CPU-s/1k output tokens A→B
Code 133.15 (131.7–135.2) 145.30 (141.4–151.7) +9.13% 7.511 → 6.886 0.311 → 0.315 4.147 → 3.828 13.93 → 12.68
Chinese prose 96.35 (93.9–98.6) 103.10 (97.8–109.2) +7.01% 10.382 → 9.701 0.306 → 0.323 5.610 → 5.279 20.45 → 20.65

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)
group,id,output_tokens,decode_tps,tpot_ms,ttft_s,e2e_s,cpu_s_per_ktoken,cpu_routed_entries
0-A,r1-decode-0,512,132.2,7.564,0.310229376074858,4.169868486002088,13.867187500000004,11
0-A,r1-decode-2,512,98.6,10.144,0.2994468039833009,5.482559937983751,19.72656249999999,21
0-A,r2-decode-0,512,135.2,7.395,0.3117559179663658,4.085138307069428,13.789062500000004,6
0-A,r2-decode-2,512,94.7,10.556,0.3099104680586606,5.704010070068762,20.97656249999999,20
1-B,r1-decode-0,512,142.2,7.035,0.31552838697098196,3.90342166996561,12.71484375000001,2
1-B,r1-decode-2,512,97.8,10.227,0.32222125597763807,5.547170259989798,20.332031249999993,12
1-B,r2-decode-0,512,151.7,6.594,0.2842730740085244,3.648345442954451,12.519531249999993,6
1-B,r2-decode-2,512,109.2,9.16,0.28697407396975905,4.9659525259630755,17.285156250000004,11
2-B,r1-decode-0,512,141.4,7.071,0.31350816204212606,3.9223885550163686,12.753906250000002,2
2-B,r1-decode-2,512,102.4,9.767,0.323453082004562,5.313072647084482,21.777343749999996,30
2-B,r2-decode-0,512,148.4,6.737,0.32667030906304717,3.7528046941151842,12.636718749999998,3
2-B,r2-decode-2,512,103.8,9.635,0.32387711701449007,5.245545277022757,20.976562500000004,23
3-A,r1-decode-0,512,131.7,7.593,0.3100235681049526,4.184537398046814,13.984375000000007,11
3-A,r1-decode-2,512,98.0,10.208,0.3012308340985328,5.5167514301138,19.921874999999993,21
3-A,r2-decode-0,512,134.1,7.458,0.3176286129746586,4.123216146952473,14.003906250000018,6
3-A,r2-decode-2,512,93.9,10.652,0.3128270440502092,5.755740714026615,21.2109375,20

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:

copy payload   = 96 × max(size) = 138.28125 MiB
rotate payload = 96 × sum(distinct sizes) = 365.625 MiB
extra payload  = 227.34375 MiB of host pinned RAM

In the preceding same-build resource audit, Pss_Shmem increased 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:u captures 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_exchanges was:

Workload A estimated CPU ms, two starts A share of sampled user CPU B commit-copy samples, two starts
Code 676.77 / 1414.14 7.55% / 12.00% 0 / 0
Prose 1313.13 / 1141.41 9.85% / 9.75% 0 / 0
Repair 1767.68 / 1161.62 5.94% / 8.62% 0 / 0

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/memmove IFUNC selection (both at ELF offset 0x1aedc0), the adjacent memset entry at 0x1af9c0, 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:

CPU activity Sampled user-CPU share
Verifier::run 40.68%
CPU router lookahead (bf16_rows_dot_multi) 28.54%
Pool dispatch/worker 22.57%
CUDA host runtime/driver 2.97%
Recognized CPU expert-math leaves 0.06%
Cache-management leaves 0.06%

These are symbol-based categories, not exact instruction-level accounting of every math operation. Original-binary perf annotate on 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:

Start No perf Record Counter stat
0-A 14/14 (769 tokens, stop) 14/14 (1313 tokens, stop) 14/14 (822 tokens, stop)
1-B 10/14 (1015 tokens, stop) 13/14 (586 tokens, stop) 14/14 (307 tokens, stop)
2-B 14/14 (499 tokens, stop) 12/14 (308 tokens, stop) 14/14 (520 tokens, stop)
3-A 11/14 (566 tokens, stop) 14/14 (503 tokens, stop) 14/14 (312 tokens, stop)

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 pass causing val to 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.

{
  "generation": {
    "temperature": 0,
    "top_p": 0.95,
    "seed": 20261013,
    "reasoning_effort": "none",
    "stream": true,
    "max_tokens": 512
  },
  "code_messages": [
    {
      "role": "user",
      "content": "连续输出一个大型Python标准库项目的源代码,从配置解析、HTTP客户端、缓存、重试、并发执行器到单元测试,写至少200个函数,每个函数包含文档字符串和错误处理。直接从代码开始,持续写到输出上限,不要总结,不要省略。"
    }
  ],
  "prose_messages": [
    {
      "role": "user",
      "content": "写一份非常详细的中文数据库故障排查手册,覆盖锁等待、事务隔离、索引、慢查询、复制、备份、磁盘、网络与容量规划。每节含命令、案例和分析,需要至少一万字。直接开始正文,持续写到输出上限,不要总结。"
    }
  ],
  "repair_max_tokens": 2048,
  "repair_messages": [
    {
      "role": "user",
      "content": "请实现 Python 3 函数 retry_delays(attempts, base, cap),只输出一个python代码块。attempts是非负整数;base和cap是非负数。返回长度attempts的列表,第i项=min(cap,base*2**i),i从0开始。如果attempts是bool或非整数,抛TypeError;attempts<0或base<0或cap<0,抛ValueError。必须能处理attempts=10000,base=0.5,cap=4,不发生浮点溢出。无需sleep,不得导入第三方库。"
    },
    {
      "role": "assistant",
      "content": "```python\ndef retry_delays(attempts, base, cap):\n    if isinstance(attempts, bool) or not isinstance(attempts, int):\n        raise TypeError(\"attempts must be a non-negative integer\")\n    if attempts < 0:\n        raise ValueError(\"attempts must be non-negative\")\n    if base < 0:\n        raise ValueError(\"base must be non-negative\")\n    if cap < 0:\n        raise ValueError(\"cap must be non-negative\")\n    \n    result = []\n    for i in range(attempts):\n        value = min(cap, base * (2 ** i))\n        result.append(value)\n    return result\n```"
    },
    {
      "role": "user",
      "content": "以下是你的代码实际运行的失败结果,请修复,保持原函数签名与题目规则,只输出Python代码块:\n[{\"name\": \"large\", \"passed\": false, \"error\": \"OverflowError('int too large to convert to float')\"}]"
    }
  ]
}

Suggested handling / next validation

I would first evaluate the existing opt-in controls, keeping the current defaults during measurement:

  1. In the fully resident/zero-expert-file-read regime, compare default lookahead against 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).
  2. Compare the current 20ms pool policy with a shorter 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.
  3. Keep the GPU doorbell protocol unchanged while testing those controls. Any future backoff/notification work needs its own CPU/GPU dependency and timeout validation.

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.

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=1` removed 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=0` still 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 - One RTX 3090, 24 GiB, `sm_86`; NVIDIA 580.126.09; CUDA 12.8 source build, GCC 11.4, Release. No local engine/kernel changes. - Ubuntu 22.04.4, Linux `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. - Engine **0.1.55**, measured commit **`c62d5e3a15b40ea51c96aae9e8d36928965f53ab`**. This is a pinned result, not a fresh benchmark of today's main. - Same executable in both arms, SHA256 `43b39750bcee469d2a35d31997d2484755be46cb721abf9ede4ff816c89fb2f8`. - Model: original `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. - Actual GPU expert cache: **13,503 slots / 18,530 MiB**, arena **16,461 MiB**, identical in all four starts. Official **16 staging slots**, **7 pool workers**. CPU fallback entries remained nonzero despite `pcie-frac=1`; the counter is included below. - Requested `spec=4`, suffix draft=3; status reports `spec=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): ```text --serve --pack <IQ2_XS_PACK> --native <GGUF_SHARD_1> --ple-gguf <GGUF_SHARD_2> --expert-profile <FRESH_COPY_OF_FROZEN_PROFILE> --expert-cache 18432 --prefill 2048 --spec 4 --spec-min-p 0.5 --mtp <SAME_MTP_DIRECTORY> --suffix-draft 3 --max-context 32768 --kv int8 --ple-io ram --pcie-frac 1 --pcie-mode kernel --pool-workers 7 --aux-cpus auto --adapt-every 4 --adapt-swaps 96 --adapt-decay 0.7 --adapt-async 0 --prompt-cache 0 --conversation-cache-mib 0 --resident-experts ``` Common environment: `STRATA_ROUTE_TAIL_SKIP=0`, `STRATA_PREFILL_CPU_SHARE=0`, `OMP_NUM_THREADS=2`, `OPENBLAS_NUM_THREADS=2`. Other inherited `STRATA_*` variables were cleared. A sets `STRATA_EXCHANGE_ROTATE=0`; B sets it to `1`. 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**: 1. Two 512-token warmups (code and prose). 2. Two repetitions of each 512-token workload without perf, then one repair request with a 2,048-token cap. 3. Separate requests for code/prose/repair under `perf record`. 4. Separate requests for code/prose/repair under grouped cycles/instructions counting. 5. One prose request under grouped cache-reference/cache-miss counting. Greedy `temperature=0`, `top_p=0.95`, seed `20261013`, reasoning effort `none`, streaming. Prompt/conversation reuse disabled, `cache_n=0` checked. 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 `/proc` snapshots were taken at request boundaries. Loading and offline perf decoding are excluded. This is a **custom benchmark**, not the standard `strata bench run` protocol. 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: | Workload | A tok/s median (range) | B tok/s median (range) | Change | TPOT ms/token A→B | TTFT s A→B | E2E s A→B | Engine CPU-s/1k output tokens A→B | | --- | --- | --- | --- | --- | --- | --- | --- | | Code | 133.15 (131.7–135.2) | 145.30 (141.4–151.7) | +9.13% | 7.511 → 6.886 | 0.311 → 0.315 | 4.147 → 3.828 | 13.93 → 12.68 | | Chinese prose | 96.35 (93.9–98.6) | 103.10 (97.8–109.2) | +7.01% | 10.382 → 9.701 | 0.306 → 0.323 | 5.610 → 5.279 | 20.45 → 20.65 | 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. <details><summary>All 16 unprofiled fixed-output samples (CPU routed entries are not distinct experts)</summary> ```csv group,id,output_tokens,decode_tps,tpot_ms,ttft_s,e2e_s,cpu_s_per_ktoken,cpu_routed_entries 0-A,r1-decode-0,512,132.2,7.564,0.310229376074858,4.169868486002088,13.867187500000004,11 0-A,r1-decode-2,512,98.6,10.144,0.2994468039833009,5.482559937983751,19.72656249999999,21 0-A,r2-decode-0,512,135.2,7.395,0.3117559179663658,4.085138307069428,13.789062500000004,6 0-A,r2-decode-2,512,94.7,10.556,0.3099104680586606,5.704010070068762,20.97656249999999,20 1-B,r1-decode-0,512,142.2,7.035,0.31552838697098196,3.90342166996561,12.71484375000001,2 1-B,r1-decode-2,512,97.8,10.227,0.32222125597763807,5.547170259989798,20.332031249999993,12 1-B,r2-decode-0,512,151.7,6.594,0.2842730740085244,3.648345442954451,12.519531249999993,6 1-B,r2-decode-2,512,109.2,9.16,0.28697407396975905,4.9659525259630755,17.285156250000004,11 2-B,r1-decode-0,512,141.4,7.071,0.31350816204212606,3.9223885550163686,12.753906250000002,2 2-B,r1-decode-2,512,102.4,9.767,0.323453082004562,5.313072647084482,21.777343749999996,30 2-B,r2-decode-0,512,148.4,6.737,0.32667030906304717,3.7528046941151842,12.636718749999998,3 2-B,r2-decode-2,512,103.8,9.635,0.32387711701449007,5.245545277022757,20.976562500000004,23 3-A,r1-decode-0,512,131.7,7.593,0.3100235681049526,4.184537398046814,13.984375000000007,11 3-A,r1-decode-2,512,98.0,10.208,0.3012308340985328,5.5167514301138,19.921874999999993,21 3-A,r2-decode-0,512,134.1,7.458,0.3176286129746586,4.123216146952473,14.003906250000018,6 3-A,r2-decode-2,512,93.9,10.652,0.3128270440502092,5.755740714026615,21.2109375,20 ``` </details> ### 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: ```text copy payload = 96 × max(size) = 138.28125 MiB rotate payload = 96 × sum(distinct sizes) = 365.625 MiB extra payload = 227.34375 MiB of host pinned RAM ``` In the preceding same-build resource audit, `Pss_Shmem` increased 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:u` captures 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_exchanges` was: | Workload | A estimated CPU ms, two starts | A share of sampled user CPU | B commit-copy samples, two starts | |---|---:|---:|---:| | Code | 676.77 / 1414.14 | 7.55% / 12.00% | 0 / 0 | | Prose | 1313.13 / 1141.41 | 9.85% / 9.75% | 0 / 0 | | Repair | 1767.68 / 1161.62 | 5.94% / 8.62% | 0 / 0 | The no-copy branch is visible in [commit_exchanges](https://github.com/Niko1221/Strata/blob/c62d5e3a15b40ea51c96aae9e8d36928965f53ab/src/core/expert_source.cpp#L4342-L4376), 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`/`memmove` IFUNC selection (both at ELF offset `0x1aedc0`), the adjacent `memset` entry at `0x1af9c0`, 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: | CPU activity | Sampled user-CPU share | |---|---:| | `Verifier::run` | 40.68% | | CPU router lookahead (`bf16_rows_dot_multi`) | 28.54% | | Pool dispatch/worker | 22.57% | | CUDA host runtime/driver | 2.97% | | Recognized CPU expert-math leaves | 0.06% | | Cache-management leaves | 0.06% | These are symbol-based categories, not exact instruction-level accounting of every math operation. Original-binary `perf annotate` on 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](https://github.com/Niko1221/Strata/blob/c62d5e3a15b40ea51c96aae9e8d36928965f53ab/src/core/verify.cpp#L3193-L3240), [worker parking loop](https://github.com/Niko1221/Strata/blob/c62d5e3a15b40ea51c96aae9e8d36928965f53ab/src/kernels/cpu/pool.cpp#L974-L1035), [20ms default](https://github.com/Niko1221/Strata/blob/c62d5e3a15b40ea51c96aae9e8d36928965f53ab/include/strata/kernels/cpu/pool.hpp#L282), [lookahead initialization](https://github.com/Niko1221/Strata/blob/c62d5e3a15b40ea51c96aae9e8d36928965f53ab/src/program/generate.cpp#L7730-L7768). 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: | Start | No perf | Record | Counter stat | | --- | --- | --- | --- | | 0-A | 14/14 (769 tokens, stop) | 14/14 (1313 tokens, stop) | 14/14 (822 tokens, stop) | | 1-B | 10/14 (1015 tokens, stop) | 13/14 (586 tokens, stop) | 14/14 (307 tokens, stop) | | 2-B | 14/14 (499 tokens, stop) | 12/14 (308 tokens, stop) | 14/14 (520 tokens, stop) | | 3-A | 11/14 (566 tokens, stop) | 14/14 (503 tokens, stop) | 14/14 (312 tokens, stop) | 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 `pass` causing `val` to 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. <details><summary>Exact workload fixtures and request settings</summary> 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. ```json { "generation": { "temperature": 0, "top_p": 0.95, "seed": 20261013, "reasoning_effort": "none", "stream": true, "max_tokens": 512 }, "code_messages": [ { "role": "user", "content": "连续输出一个大型Python标准库项目的源代码,从配置解析、HTTP客户端、缓存、重试、并发执行器到单元测试,写至少200个函数,每个函数包含文档字符串和错误处理。直接从代码开始,持续写到输出上限,不要总结,不要省略。" } ], "prose_messages": [ { "role": "user", "content": "写一份非常详细的中文数据库故障排查手册,覆盖锁等待、事务隔离、索引、慢查询、复制、备份、磁盘、网络与容量规划。每节含命令、案例和分析,需要至少一万字。直接开始正文,持续写到输出上限,不要总结。" } ], "repair_max_tokens": 2048, "repair_messages": [ { "role": "user", "content": "请实现 Python 3 函数 retry_delays(attempts, base, cap),只输出一个python代码块。attempts是非负整数;base和cap是非负数。返回长度attempts的列表,第i项=min(cap,base*2**i),i从0开始。如果attempts是bool或非整数,抛TypeError;attempts<0或base<0或cap<0,抛ValueError。必须能处理attempts=10000,base=0.5,cap=4,不发生浮点溢出。无需sleep,不得导入第三方库。" }, { "role": "assistant", "content": "```python\ndef retry_delays(attempts, base, cap):\n if isinstance(attempts, bool) or not isinstance(attempts, int):\n raise TypeError(\"attempts must be a non-negative integer\")\n if attempts < 0:\n raise ValueError(\"attempts must be non-negative\")\n if base < 0:\n raise ValueError(\"base must be non-negative\")\n if cap < 0:\n raise ValueError(\"cap must be non-negative\")\n \n result = []\n for i in range(attempts):\n value = min(cap, base * (2 ** i))\n result.append(value)\n return result\n```" }, { "role": "user", "content": "以下是你的代码实际运行的失败结果,请修复,保持原函数签名与题目规则,只输出Python代码块:\n[{\"name\": \"large\", \"passed\": false, \"error\": \"OverflowError('int too large to convert to float')\"}]" } ] } ``` </details> ### Suggested handling / next validation I would first evaluate the **existing opt-in controls**, keeping the current defaults during measurement: 1. In the fully resident/zero-expert-file-read regime, compare default lookahead against `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). 2. Compare the current 20ms pool policy with a shorter `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. 3. Keep the GPU doorbell protocol unchanged while testing those controls. Any future backoff/notification work needs its own CPU/GPU dependency and timeout validation. 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.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#2340
No description provided.