Skip to content
Open
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
49 changes: 49 additions & 0 deletions .github/ISSUE_TEMPLATE/bench-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Bench report
description: Post the report strata-poly --bench-report wrote on your PC, so the maintainers see where speed is left on hardware they do not have
title: "[Benchmark] bench report: "
labels: ["benchmark"]
body:
- type: markdown
value: |
The title must start with **[Benchmark]**. Add your GPU and model after it, for example `[Benchmark] bench report: RTX 3060 12 GB, Inkling 2 Mini IQ4_NL`.

Make the report with the settings you use every day. With the server stopped (it needs the GPU):

```
python polystrata.py bench-report --model <name> # about a minute after the model loads, more on a slow card
python polystrata.py bench-report --model <name> --long # adds one long conversation read up to your context
```

It writes `bench-report.json` and `bench-report.md` in the folder you run it from. They hold the GPU, CPU, RAM,
the engine's version, your settings, the speeds and where the GPU's time went, and no paths, user or host names,
serial numbers or prompts (the prompts are a fixed synthetic text). Read them before you post; `python tools/bench_reports.py
--check-privacy bench-report.json` checks them again.
- type: textarea
id: markdown
attributes:
label: The report (bench-report.md)
description: Paste the whole Markdown file.
render: markdown
validations:
required: true
- type: textarea
id: json
attributes:
label: The JSON (bench-report.json)
description: Attach the file (drag it here) or paste it. The tools compare reports from it.
validations:
required: true
- type: textarea
id: notes
attributes:
label: Anything else
description: What else ran on the PC, a laptop on battery, a changed power limit, other settings you tried.
- type: dropdown
id: reproduction-status
attributes:
label: Reproduction status
options:
- Measured locally
- Unconfirmed (I did not run it)
validations:
required: true
22 changes: 22 additions & 0 deletions docs/COMMUNITY_BENCHMARKS.md
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,28 @@ fast.
[Q2_0](bench-results/2026-11-17-community-rx-7600-xt-qwen3-8-flash-next-q2-0/README.md), `--kv int8 --kv-resident 32768`, `tools/strata_bench.py`: chat 22.1 / 11.3 tok/s
(8.3 to 30.9 and 4.6 to 42.9 over the runs), prompt 169 / 114 tok/s at 4K and 187 / 111 at 16K. The same PC's strata-poly models are in the table above.

## Post a bench report (strata-poly)

The engine of the models PolyStrata adds can write a report of its own: what your card, link, RAM and CPU measure,
the speeds with your settings, and where the GPU's time went. It shows the maintainers where speed is left on hardware
they do not have. Stop the server first (the report needs the GPU), then:

```
python polystrata.py bench-report --model <name> # quick: about a minute after the model loads (RTX 2070 Super), more on a slow card
python polystrata.py bench-report --model <name> --long # and one conversation read in chunks up to your context (about 6 minutes more at 128K)
```

It writes `bench-report.json` and `bench-report.md`: probes (H2D pinned and pageable, D2H, GPU memory, RAM read on
all threads, the CPU experts' dot kernel), then prompts of 302, 2,048 and 8,192 tokens of a fixed synthetic English text (the same on every PC) with 128 tokens answered
after each (greedy), each with its event profile and an "Explain" section that holds every phase against the probes.
The files have no paths, user or host names, serial numbers or prompts. With `--layer-split` the profile is the first card's stream alone. Post them with the **Bench report** issue form;
`python tools/bench_reports.py --check-privacy bench-report.json` checks a file, and `python tools/bench_reports.py
*.json` puts several reports in one table per card and flags the ones far from the same card's others.

`STRATA_PROFILE=1` in the server's environment profiles normal use the same way, at no extra wait: after every request
the engine writes the session's profile, by phase and by context length, to `strata-profile.json` in its working
folder (`STRATA_PROFILE_OUT` names another file), and a line to the log.

## Run the standard benchmark

```sh
Expand Down
5 changes: 4 additions & 1 deletion docs/SETTINGS.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ A number or a word is set like any environment variable, for example `STRATA_KVA
(`terminal/strata-<model>.json`), which the server passes to the engine. The Strata project's Terminal writes it there with
`strata launch --set NAME=value`.

## Switches you can turn on (347)
## Switches you can turn on (350)

Off unless you set them. The last column says where each one is described.

Expand Down Expand Up @@ -277,6 +277,9 @@ Off unless you set them. The last column says where each one is described.
| `STRATA_PREFILL_ROUTED_STREAM_DEPTH` | on / off | NVIDIA and AMD | [DETAILS.md](DETAILS.md) |
| `STRATA_PREFILL_STREAM_ALL` | on / off | Intel Arc | [INTEL.md](INTEL.md) |
| `STRATA_PRIMARY_DEVICE` | number | NVIDIA and AMD | [SECOND_GPU.md](SECOND_GPU.md) |
| `STRATA_PROFILE` | on / off | NVIDIA and AMD | [COMMUNITY_BENCHMARKS.md](COMMUNITY_BENCHMARKS.md) |
| `STRATA_PROFILE_EVERY` | number | NVIDIA and AMD | - |
| `STRATA_PROFILE_OUT` | text | NVIDIA and AMD | [COMMUNITY_BENCHMARKS.md](COMMUNITY_BENCHMARKS.md) |
| `STRATA_PROMPT_ATTN_IMMA` | on / off | NVIDIA and AMD | [DETAILS.md](DETAILS.md) |
| `STRATA_PROMPT_DIRECT` | on / off | NVIDIA and AMD | [QUANTS.md](QUANTS.md) |
| `STRATA_PW_WITH_BATCH` | on / off | NVIDIA and AMD | [DETAILS.md](DETAILS.md) |
Expand Down
48 changes: 47 additions & 1 deletion engine/cmake/strata_poly.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,42 @@
# builds the products llama.cpp's way instead (its MMQ kernels, its flash-attention kernel from its headers and the GDN
# adapter that needs them), from a llama.cpp checkout given as -DSTRATA_GGML_DIR: an override kept for two releases.

# --bench-report names the commit the engine was built from: -DSTRATA_GIT_COMMIT=<id> when given (a build host that
# copies the tree without .git passes its own: rbuild does), else git's at configure time, else a COMMIT file beside
# engine/ (a source package can carry one), else "unknown".
set(STRATA_GIT_COMMIT "" CACHE STRING "the commit --bench-report names (empty: git describe at configure time)")
function(strata_poly_commit src)
set(_commit "${STRATA_GIT_COMMIT}")
if(NOT _commit)
find_package(Git QUIET)
if(GIT_FOUND)
execute_process(COMMAND ${GIT_EXECUTABLE} describe --always --dirty --abbrev=10
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} OUTPUT_VARIABLE _out RESULT_VARIABLE _rc
OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET)
if(_rc EQUAL 0 AND _out)
set(_commit "${_out}")
endif()
endif()
endif()
if(NOT _commit AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../COMMIT")
file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/../COMMIT" _lines LIMIT_COUNT 1)
if(_lines)
list(GET _lines 0 _commit)
endif()
endif()
if(NOT _commit)
set(_commit "unknown")
endif()
string(REGEX REPLACE "[^A-Za-z0-9._+-]" "" _commit "${_commit}") # a short id, nothing that needs quoting
set_property(SOURCE ${src} APPEND PROPERTY COMPILE_DEFINITIONS "STRATA_GIT_COMMIT=\"${_commit}\"")
endfunction()

macro(strata_poly)
if(STRATA_BUILD_TESTS)
# --bench-report's JSON, Markdown, explain section and privacy scrub, from figures of the test's own (no card)
add_executable(poly_bench_report_test src/poly/bench_report_test.cpp src/poly/bench_report.cpp)
target_include_directories(poly_bench_report_test PRIVATE include)
add_test(NAME poly_bench_report_test COMMAND poly_bench_report_test)
add_executable(glm_conversations_test src/poly/conversations_test.cpp src/poly/spill.cpp)
add_test(NAME glm_conversations_test COMMAND glm_conversations_test)
add_executable(poly_guesses_test src/poly/guesses_test.cpp src/spec/draft_policy.cpp)
Expand Down Expand Up @@ -205,8 +239,20 @@ if(STRATA_BUILD_POLY AND STRATA_NATIVE_EXPERTS AND (STRATA_ENABLE_CUDA OR STRATA
add_executable(strata-poly src/poly/main.cpp src/poly/engine.cpp src/poly/expert_card.cpp src/poly/glm5next.cpp src/poly/qwen35.cpp
src/poly/gemma4.cpp src/poly/deepseek4.cpp src/poly/lfm2moe.cpp src/poly/flint.cpp
src/poly/kolibri1.cpp src/poly/laguna.cpp src/poly/inkling2.cpp src/poly/inkling2_pictures.cpp src/poly/inkling2.cu src/poly/cpu_experts.cpp src/poly/kernels.cu src/poly/kernels_dsv4.cu
src/poly/spill.cpp src/core/conversation_memory.cpp src/core/conversation_file.cpp)
src/poly/spill.cpp src/core/conversation_memory.cpp src/core/conversation_file.cpp
src/poly/bench_report.cpp src/poly/bench_probe.cpp src/poly/bench_kernels.cu)
target_include_directories(strata-poly PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include ${_strata_gpu_include_directories})
strata_poly_commit(src/poly/bench_report.cpp)
# the profiler's launch counter (src/poly/launch_count.cpp): the runtime's launch call wrapped at link time, Linux
# only (elsewhere the profile counts the recordings' kernel nodes alone)
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
target_sources(strata-poly PRIVATE src/poly/launch_count.cpp)
if(STRATA_ENABLE_HIP)
target_link_options(strata-poly PRIVATE "LINKER:--wrap=hipLaunchKernel")
else()
target_link_options(strata-poly PRIVATE "LINKER:--wrap=cudaLaunchKernel" "LINKER:--wrap=cudaLaunchKernelExC")
endif()
endif()
# the driver's virtual memory calls: the attention caches grow with the conversation; on HIP they are HIP's
# memory management calls, which the HIP runtime itself provides (hip_compat/cuda.h)
if(STRATA_ENABLE_HIP)
Expand Down
Loading
Loading