mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #666] [CLOSED] setup, serve: the image encoder's device as its own role (--vision-device) #2754
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#2754
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/666
Author: @hireymage
Created: 10/3/2026
Status: ❌ Closed
Base:
main← Head:vision-device📝 Commits (10+)
cc97fcdsetup: AMD layer splits with --gpus (every chosen card a supported AMD arch; the engine compiled for each)e9e2ba3pinned (#243 follow-up): the shared-memory-budget cap on the sliced pin is opt-in (STRATA_ARENA_PIN_GIB=auto) - by default the arena pins as in 0.1.30; on this 64 GB PC the cap pinned 26 instead of 30 GiB and cost ~20% prompt speed and 2-4% IQ3_S decodecacffa9CS-T speed: the file tier fetched in parallel, PCIe planning without file reads, a partial pin of the RAM tier, bit-exact AVX2 multi-token kernels for Q4_K / Q5_1 / Q8_0 experts, decode-only tier statsa348c7aMerge branch 'f-131-srv' into r131-q4b93a00cMerge branch 'f-q4-on242' into r131-q48f5148cCS-T: the partial pin at most 24 GiB (STRATA_PARTIAL_PIN_GIB), the Q4_K/Q5_1/Q8_0 multi-token kernels from two tokens on5ffda19CS-T: the GGUF-in-place prefetch asks Windows for all of a layer's missed slices at once (PrefetchVirtualMemory)ed6c124#253: the 8 GiB arena pin cap only under WDDM; STRATA_ARENA_PIN_GIB; the split's prompt chunk steps down450149d--split-skip-if-fits (opt-in): an auto split runs on the main card alone when it holds every profiled expert + KV6926e0bMerge branch 'f-131-amd' into r131-amd📊 Changes
8 files changed (+315 additions, -30 deletions)
View changed files
📝
docs/AI_SETUP.md(+3 -1)📝
docs/DETAILS.md(+18 -0)📝
docs/MULTI_GPU.md(+6 -0)📝
serve/server.py(+20 -7)📝
serve/test_server.py(+27 -0)📝
setup.py(+98 -20)📝
tools/test_setup_choices.py(+131 -0)📝
tools/vision/CMakeLists.txt(+12 -2)📄 Description
What
A third placement role for the picture encoder, beside the engine's GPUs (
--vision-device):--vision-device auto— a spare card (the one with the most VRAM) when one exists, else the engine's main card as before;--vision-device cpu— the pictures read on the CPU (#304's path);--vision-device 1/cuda:1— pinned to a card, numbered like nvidia-smi (the same numbering the engine's device report uses);Why this shape
The image encoder is not in the engine:
strata-visionis a process of its own, and the engine reads the embeddings it wrote from the disk. So the placement lives at the layer that owns the vision compute, and the implementation reuses what is already merged rather than adding a parallel mechanism:cuda_devicein the"vision"config — this branch writes that same key, andvision_env()does the rest (CUDA_VISIBLE_DEVICES, PCI-bus order) unchanged.--vision-device cpusimply routes into the existing--vision cpupath.servestates the placement at start-up (the image encoder runs on GPU 1 (its own card)).Cross-card, the handoff is by construction the same as every existing vision run: the
.sveembeddings go through the disk, so no card-to-card path is involved on any mix of GPUs, and P2P is never required.Nothing changes when the flag is absent; no engine (C++) code is touched.
Testing
tools/test_setup_choices.py: 10 new tests for the flag (auto/cpu/card/share/missing-card/refusals) — 41 green;serve/test_server.py: the new start-up role line — 119 green.cuda_device: 1the encoder's VRAM lands on GPU 1 alone (GPU 0 delta 0 MiB, GPU 1 +1192 MiB through the serve path), the second encode of the same image hits the disk cache, and the CPU run produces the same-size output. Pascal is affected only by proxy — no engine code changed.Docs
docs/AI_SETUP.md,docs/DETAILS.md(0.1.38 paragraph) anddocs/MULTI_GPU.mddescribe the flag and the placement rules.Follow-up in this PR: the encoder on Vulkan or SYCL GPUs (
--vision-backend vulkan|sycl)The image encoder is its own llama.cpp process, so unlike the engine it can run on a GPU whose backend the engine
doesn't speak.
--vision-backend vulkanbuildsstrata-visionfor Vulkan (any Vulkan GPU, an Intel or AMD iGPUincluded) and
--vision-backend syclfor Intel GPUs through oneAPI; the device is named through that backend's ownvariable and its own device list:
--vision-backend--vision-device's numbers come fromCUDA_VISIBLE_DEVICESnvidia-smivulkanGGML_VK_VISIBLE_DEVICESvulkaninfo --summarysyclONEAPI_DEVICE_SELECTOR="level_zero:N"sycl-ls(dGPUs first, iGPUs at the end)tools/vision/CMakeLists.txtgains the two backend options (one GPU backend at a time), the config keeps"backend"in"vision", and changing the backend rebuilds the encoder.--vision-device autois refused with anon-CUDA backend: these backends number devices differently than nvidia-smi, so name the device.
Validation limits: no Intel iGPU was available to test on. The Vulkan build+pin path was validated on a 2x GTX
1080 Ti rig as a proxy (Vulkan encoder,
GGML_VK_VISIBLE_DEVICESpinning to card0/card1, VRAM placement vianvidia-smi); the SYCL path is unit-tested only.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.