mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #2509] [CLOSED] [Needs Testing on Multi-GPU, Nvidia, AMD, Intel, MacOS] Web Engine tab: GPU switches for the user's vendor + in-page restart/save #4084
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#4084
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?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/2509
Author: @bsorensen110
Created: 10/14/2026
Status: ❌ Closed
Base:
main← Head:feature/web-engine-tab📝 Commits (2)
f65a77bserve: Engine tab - the GPU speed/feature switches for the user's vendor, with in-page restart6743cdeserve: PR #2509 Copilot review - all 11 findings fixed📊 Changes
9 files changed (+3592 additions, -7 deletions)
View changed files
➕
docs/ALL_OPTIONS.md(+1512 -0)➕
docs/GPU_OPTIONS.md(+814 -0)➕
serve/engine_options.py(+486 -0)📝
serve/runconfig.py(+105 -1)📝
serve/server.py(+114 -2)📝
serve/test_runconfig.py(+397 -1)📝
serve/web/app.css(+19 -1)📝
serve/web/app.js(+119 -2)📝
serve/web/index.html(+26 -0)📄 Description
Needs Testing on Multi-GPU and AMD, Intel, MacOS — the detection, catalog, and restart paths are designed to work on Linux, Windows, and macOS, and are unit-tested for all of them, but the only real hardware exercised here is a single AMD card (Radeon AI PRO R9700, gfx1201, Linux). NVIDIA, Intel, Apple Metal, and multi-GPU layer splits are proven by mocks/tests only.
What this adds
A web Engine tab that shows only the speed/feature switches relevant to the GPU(s) the user actually runs, lets them edit and save those switches into the run config, and restarts the engine from the page so the new env/args take effect. Plus a human/AI-readable reference of every switch grouped by GPU manufacturer.
docs/GPU_OPTIONS.md— every env var, engine CLI flag, and setup/CLI option grouped by manufacturer (NVIDIA, AMD, Intel, Apple Metal, cross-vendor, CPU-only), each with what it changes, its gate, and recommended use.docs/ALL_OPTIONS.md— the master inventory the catalog is generated from (engine flags, server CLI, installer CLI tables).serve/engine_options.py— the Engine tab's catalog: 351 env switches + 30 engine CLI args (tunable + experimental tiers; debug/internal stay reference-only), plus vendor/arch detection.serve/runconfig.py— new catalog-allowlisted config keys:env.NAME,arg.--flag(int/float, bounds-checked),argflag.--flag,argstr.--flag,argenum.--flag.serve/server.py—GET /engine-options,POST /restart, andService._spawn_from(cfg)which rebuilds the engine spawn (exe, args, env, cwd, log) from the saved config, so a restart picks up what the page saved.serve/web/— the Engine tab: scope header (amd · gfx1201 · strata-<model>.json), search, experimental toggle, grouped rows with description/gate, save, and a restart banner that appears only when a restart would change the spawn.How GPU detection works (cross-platform by construction)
No OS-specific hardware APIs — deliberately. The tab needs the GPU the engine uses, not the GPUs the OS enumerates:
backendkey is the primary signal:cuda→nvidia,hip→amd,sycl→intel,metal→apple.gfx\d{3,4},sm_\d{2,3},compute capability X.Y(two-digit majors included, e.g.12.0→sm_120),Arc …,Apple M… Pro/Max/Ultra.nvidia + amdin the scope header.This works identically on Linux, Windows, and macOS because it reads the config and the engine's log — no WMI/
system_profiler//sysbranches, no driver-dependent libraries, no extra permissions.Safety
runconfig.check(); unlisted names, control characters, oversized values, out-of-bounds numbers, and bad enum choices are refused./restart,/unload,/load,/configaccept JSON only from Strata's own page (Origin/CSRF check) — a cross-site form POST gets 403./restartreturns 409 ({"status": "busy"}) at once and changes nothing; it does not wait for the turn.restart_supported()is false for mock/replica setups, which get an honest 400.Nonevalue means "engine default": the key is removed from the config (including setup-written flags like--kv).os.replace).Tests
Full serve suite on top of current
main: 451/451 OK (serve.test_runconfig serve.test_server serve.test_lifecycle serve.test_security serve.test_frontend serve.test_monitor serve.test_slots serve.test_replicas).New coverage: catalog sanity; vendor mapping for all four backends; arch regexes (gfx, sm_ incl.
sm_120, compute capability, Arc, Apple M); multi-GPU union (detect_archs,detect_vendors, mixednvidia + amdscope over HTTP, no duplicate keys); Apple Metal options + config save round-trip; env/arg round-trips incl. float args (--spec-min-p 0.65); refusals (bounds, enums, types); restart guarded (evil Origin 403, mock 400, busy 409 with config untouched); Metal-config restart rebuilds the spawn with the saved env.Verified / not verified
backend: metal+Apple M4 Prostartup line →applescope, Metal switches shown, AMD/NVIDIA hidden, save round-trip), mixed NVIDIA+AMD split, mock restart paths.creationflags) is not exercised.Reproduce
Known limitations
backendkey alone.metal/setup_mac.py) are documented indocs/GPU_OPTIONS.mdbut are bootstrap choices, not live engine env/args, so they are not Engine-tab-editable.serve/engine_options.pyis generated from the inventory indocs/ALL_OPTIONS.md; regenerate after upgrades (the generator lives in the contributor's tooling, not in this repo).🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.