mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
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#1122
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 @frankwang1130 on GitHub (Oct 16, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/2797
Strata version, GPU, OS:
0.1.44.1· AMD Radeon RX 7900 XTX 24 GB (gfx1100, ROCm 7.2.3,HIP) · Linux 7.0.0-38-generic, Intel B760M D5 (no AVX-512), 20 CPUs, 62.6 GB RAM
Summary. On Linux + HIP (RX 7900 XTX, gfx1100, engine 0.1.44.1, stock config) the default
--ple-io directPLE read path delivers ~950 random 4 KiB reads/s (3.7 MiB/s) while aprompt chunk is read, so layer 1 of one chunk never finishes inside the 60 s watchdog and the
engine aborts itself (exit -6,
server.pyrestarts it, clients see 503). Five occurrences intwo engine sessions.
The drive is not the limit, and it is not the Windows unbuffered path. The model GGUF is on a
non-rotational NVMe, and a standalone process reading the same file with the same random
4 KiB
O_DIRECTpattern reaches 70,406 IOPS / 275 MiB/s / 0.22 ms, measured at the block layer(
/sys/block/nvme0n1/stat), not in userspace. That run overlapped the engine's stalled window:while the engine's 16 pool threads sat in state
Dand/proc/<pid>/ioadvanced at ~3.7 MiB/s, asecond process doing identical reads on the same file still got 45–91k IOPS.
The startup probe gives a false all-clear. On this machine the boot probe prints
(above the 15,000 rows/s bar in
generate.cpp:3314), so no warning is printed. But that is ~36xwhat the same process, same
PleReader, sameDirectFilepool delivers later at runtime. Theprobe measures 4096 rows in ~0.12 s at boot, before the GPU work and the CPU expert pool exist; it
does not predict the prompt path.
Environment
STRATA_*env set)nvme0n1p4, NTFS mounted withntfs3, rotational=0,the 44.9 GB GGUF is heavily fragmented (
filefragshows many extents)--ple-ggufpointing at the same shard as--native--prefill auto --spec 4 --mtp ... --max-context 262144 --kv q4_0 --vision --vram-reserve-mib 1024 --pool-workers 9 --conversation-cache-mib 4096 ...--ple-ioleft at the default (direct);STRATA_IO_THREADSunsetWhat the engine logs
Stages seen across the five stalls:
layer 1 of the prompt chunk from token 0,... from token 8104,and one
waiting for the GPU (attention, router) at layer 1. VRAM was never low (743–912 MiB free),so this is not the #2065 card-full class.
dmesghas no I/O errors, no timeouts, no hung-taskwarnings;
nvme_core.io_timeoutis 30.Measurements (2026-10-17, same day, same machine, same file)
/sys/block/nvme0n1/statple_direct_rows_per_s,generate.cpp:1778/proc/<pid>/iosampled every second; 16 threads in DThe per-read latency is ~76x worse inside the engine than from a standalone process on the same file.
Three things I think are wrong, independent of the root cause
The #1407 I/O allowance can never engage for this read pattern.
generate.cpp:9640treats thefile tier as busy only when
majflt + (read_bytes >> 20)grows by >= 16 in one second. A PLEgather is a large number of small random 4 KiB reads: at ~950 reads/s that is ~4 MiB/s, and the
whole run had 7 major page faults. So the allowance (up to
STRATA_WATCHDOG_IO_S, default 600 s)never starts and the engine is guaranteed to abort at 60 s even when it is making steady I/O
progress. #1425 asked "should an I/O-bound prompt read be able to trip the 60 s no-progress
watchdog?" and this looks like the answer is: it cannot be helped today, by construction. A read
counter (reads/s or reads outstanding) would catch this shape; MiB/s does not.
STRATA_IO_THREADSis capped at 16 on Linux butple_inflightdefaults to 256. On POSIX eachpool thread does one blocking
pread, so the thread count is the queue depth(
direct_file.cpp:319,io_threads(16)), whilegenerate.cpp:402defaultsple_inflightto 256and comments that 64 "left the SSD half idle". So 256 jobs are queued and only 16 can ever reach
the drive.
docs/INTEL.mdalready documents 16 -> 64; the default still disagrees with thecomment that justifies it.
Neither documented mitigation is usable on a 64 GB machine running IQ3_S.
--ple-io mmapneeds page cache for a 28.8 GB table and
--ple-io ramneeds 28.8 GB of RAM, but the expert arenais already 46.84 GiB resident (and pinned via
cudaHostRegister), leaving 8768 MiB available.So the log's advice (
#605: --ple-io ram,--ple-io mmap) cannot be followed, and there is nosupported workaround for this configuration.
Questions
expected, or is something in the request path (the
aux_cpuspinning that switches on per request,or
--nativemmap and--ple-io directsharing one GGUF file onntfs3) serialising the reads?the watchdog allowance?
--ple-io directonntfs3specifically? All the earlierreports I could find (#1425, #1629, #2040, #1407) are Windows, ext4, or loop devices.
What I did not test
ntfs3from the engine's ownread path. That is the cheapest next test and I can run it.
/sys/block/nvme0n1/statduring a stall. That single measurement splits the tworemaining hypotheses: device IOPS ~950 means the requests reach the drive and are slow there;
device IOPS ~0 with 16 threads still in
Dmeans they are stuck above the drive. I can reproduceand capture this, plus
gdb -p <pid>backtraces for the 16 blocked threads.#2065); I am not claiming them here.
Related
#1425 (closed for 0.1.42; the maintainer invited a 0.1.44 re-report), #1629, #1407, #2040, #1984,
#605.
@mmhorda commented on GitHub (Oct 16, 2026):
Same card here (7900 XTX, gfx1100, 0.1.44.1, ROCm, Linux), but I don't see this. Posting in case it helps narrow things down before you move filesystems.
My log has 8 of these aborts with the identical stage line ("reading the prompt (batched): layer N of the prompt chunk from token X"), and every single one reports
threads waiting on the disk (state D): 0 of 71. Yours has 16 of 37 sitting in blk_io_schedule. So mine aren't I/O-bound at all — VRAM was 414-754 MiB free when the request began, which puts them in the #2065 bucket you excluded.The direct PLE path also runs at full speed here. A standalone 4 KiB O_DIRECT read of the same 46 GB shard with 16 threads gets 53k IOPS / 208 MiB/s, and while a live 23K fresh prompt was being read I sampled the block layer at 1 Hz: the engine itself was doing 4.0 KiB reads at 20-50k IOPS, 0.08 ms each. So the gap you see between the probe (34,667 rows/s) and runtime (~950) doesn't happen here — probe reads 33-62k and runtime is the same range.
One thing I did catch, though: three consecutive seconds of that trace dropped to 744/753/841 IOPS at 4 KiB, which is right at your ~950 floor, then recovered. So the mechanism is here too, it just doesn't sustain for 60 s.
Your reading of the #1407 gate is right, incidentally. file_tier_activity() is majflt + (read_bytes >> 20) and needs +16 in a second, so a 4 MiB/s fault-free trickle can never trigger it. It fires easily on my box (that request logged 6214 MB read with 374,754 major faults), which is probably why it never bites me.
My file is on btrfs with 503 extents; yours is on ntfs3 and heavily fragmented. If it were my box I'd run your ext4 test before touching the engine.
@jds1-ai commented on GitHub (Oct 17, 2026):
Same mechanism on a different stack: NVIDIA, ext4, SATA SSD, no ntfs3. The direct PLE reader runs at ~400 reads/s during the stall while fio gets 10,355 from the same file, the #1407 allowance cannot see it, and the stall report blames the disk.
Strata version, GPU, OS:
0.1.44(ed4773eb, source build, CUDA 13.0, sm_86) · 2x RTX 3060 12 GB,--layer-split auto(K=39) · Linux 6.8.0-147-generic, i7-4790K (no AVX-512), 32 GB RAM, one PNY 250 GB SATA SSD, ext4 · Qwen3.8-Flash-Next-GSQ-RCO-IQ2_XS native pack, GGUF shards in place, PLE table320001536 rowsof shard 2 (26.8 GiB) ·--prefill auto --max-context 32768 --kv int8 --kv-resident 32768 --resident-budget-gib 12,--ple-ioat its default (direct).The boot probe warns on every start and keeps direct. All 42 direct starts of the same binary on the same file printed
--ple-io direct measures slow here (N rows/s ...) ... (kept direct: pass --ple-io mmap or --ple-io ram to change it). N is bimodal: 15 starts at 453-1,040 rows/s and 27 at 9,219-11,013, with nothing between. The value did not predict the kills, which landed one in each mode: the start that measured 10,092 rows/s was killed while 26 others in that mode were not; the one at 937 was killed while the restarts at 453 and 681 were not.The kills. Two engine starts self-stopped, both on the first request (a 7,718-token prompt) at
reading the prompt (batched): layer 1 of the prompt chunk from token 0, both withSTRATA_LOOKAHEAD=0[n4d-d-auto-s10-nola-1016T151848,...-nola-r2-1016T160734]; the third start under the same flags passed [n4i-nola-1016T201142]. No start with the default lookahead was killed, but four of them loggedno step finished for 60 s, but the file tier is still being read ... (#1407)at the same stage [...-b18-1016T150652,...-b18-r3-1016T155359,n4d-d-k42-1016T142141,n4i-laon-1016T201629]: the same slow step, kept alive because that arm faults while it reads (majflt+~150/s in the 137 s grace window ofn4i-laon). The stall report of a killed start:Who the 16 threads are.
/proc/<tid>/stackof every D thread during the same phase in a repeat start [n4i-nola-1016T201142/dstack.txt, 20:13:40Z]:The 16 D threads are read from
wchan[threads.txt: 16 inblk_io_schedule]; the 9 full stacks captured in the same pass [dstack.txt] all show that path. The process holds one O_DIRECT descriptor, fd 38, which is shard 2, the PLE table (flags: 0140000in theshard2 fdssection ofn4d-d-auto-s10-nola-1016T151848/stamp-long1.txt; fd 38 -> shard 2 inproc-fd.txt). So the stuck threads are the direct PLE reader, as in the report above.What the drive did during the 60 s before the kill (
/proc/diskstatsforsdaat 1 Hz,...-nola-r2-1016T160734/diskstats-sampler.txt, from 16:10:00Z):Sixteen threads with one read in flight each at 40 ms is 400 reads/s, which is what the counter shows. At 4 KiB per read that is 1.6 MiB/s, so the #1407 counter (
majflt + read_bytes MiB,src/program/generate.cpp:1155) advances by ~2 per second against the 16 per second it needs (generate.cpp:9640), and the engine is aborted at the 60 s limit (:9618,:9667) as "no progress". A reader doing 4 KiB direct reads can never reach 16 MiB/s below 4,000 reads/s, whatever its state.The drive is not the limit. Same file, same pattern, engine not running, 30 s after a cell ended:
fio --rw=randread --bs=4k --direct=1 --ioengine=psync --numjobs=16 --runtime=15 --readonlyon shard 2 reads at 10,355 IOPS, mean 1.54 ms, p99 3.0 ms; the block layer counted 155,707 reads in 15 s at 4.24 KB [fio-ple16.json,fio-ple16-diskstats-before/after.txt]. That is 25x the reads/s of the stall. Shard 2 has 463 extents over 28.8 GB. Both GPUs sat at PCIe Gen1, 0% and 18-20 W through the stall, so there was no GPU or DMA traffic beside the reads. In a passing start of the same binary the engine's own direct PLE phase averaged 2,556 reads/s at 7.8 ms per read over its 16 s (20:18:20-36Z; 4 s windows 1,047-6,154 reads/s at 2.9-16.7 ms) [n4i-laon-1016T201629/diskstats-sampler.txt]: slower than fio by ~4x when it passes, ~25x when it is killed. We do not know why the engine's direct reads take 40 ms when a second process's take 1.5 ms. What is excluded on this box: the drive (fio), fragmentation, GPU contention, and the lookahead setting as a cause (it only changes whether the slow step faults, and so whether the allowance fires).Workaround, measured.
--ple-io mmap: 6 starts, 6 cold first requests, 0 kills, noblk_io_schedulephase (the D threads sit infolio_wait_bit_common). The cold first touch of the table takes ~20 s at ~2,000 reads/s of 20-38 KB, against ~6 s in a passing direct start; after it ~0.3 GiB of shard 2 stays in the page cache (mincoreresidency 0.28-0.36 GiB) and a 28.7K-token prompt takes the same time as under direct (2048-token chunks: 54.5 / 51.3 s mmap against 53.0 / 50.9 s direct) [...-pf2048-mmap-reps-1016T203603vs...-pf2048-reps-1016T195949]. On this SATA SSD the #2040 7x penalty did not appear beyond the first touch.--ple-io ramis out on a 32 GB box: the table is the whole 28.8 GB shard.Suggested changes.
syscrfrom/proc/self/iotofile_tier_activity()(generate.cpp:1155), or treat any positive growth ofread_byteswhile D threads sit in a direct-I/O path as activity. A reader at 400 reads/s is slow, not stuck, and the allowance was written for that case.__iomap_dio_rw/pread64andread_bytesis still growing, print the measured reads/s instead of "a rotational or failing disk": on this box the same drive served 10,355 reads/s to another process.Not tested. NVMe on this box (none);
STRATA_WATCHDOG_IO_SorSTRATA_WATCHDOG_Soverrides (the kill is on the default 60 / 600); a probe landing inside a stall with the engine running (every fio run here was engine-free, so a transient drive state during the stall is not excluded, only made less likely by the healthy readings before and after it).Logs for every start named above (engine log, server log, argv, thread stacks, diskstats at 1 Hz) are available on request.
Posted by jds1-ai. Runs and the /proc instrumentation by an agent (Fizz, Claude model); source reading, scoring and this write-up by a second agent (Fable, Claude model); reviewed by the account owner before posting.
@frankwang1130 commented on GitHub (Oct 17, 2026):
Follow-up: a healthy control on the same box, and two things I got wrong
The control: what this path does when it works
I put a sampler on the block layer (
/sys/block/nvme0n1/stat) and on every thread's state andwchanat 1 Hz, then sent two cold long prompts. Both passed.One sampled second of the first one:
So on this box, with the same binary, the same
--ple-io directdefault and the same shard:/proc/<pid>/io, 12 s)/proc/diskstats)fioon the same file15-16 threads in
blk_io_scheduleis the normal mid-gather shape, which is what @jds1-ai's/proc/<tid>/stacktrace shows. The anomaly is not the thread count and not the queue depth: it isthe per-read latency, 100x here and 26x there, against what the same drive serves another
process.
That also kills the second suggestion in my original report.
STRATA_IO_THREADS=64does notaddress this — the 16-thread pool reaches 64,871 reads/s on this box, so depth is not the binding
constraint. I withdraw it for this mechanism.
Retracted: the ntfs3 angle
My original report listed "the file is on
ntfs3" as a new data point and asked whether anyone hadmeasured
--ple-io directonntfs3specifically. That was the wrong variable. @jds1-aireproduced on ext4 with an ext4 stack trace, and @mmhorda is on btrfs and reaches the same ~950
reads/s floor transiently (744 / 753 / 841 in three consecutive seconds, then recovered). Neither
filesystem nor extent count (503 and 463 respectively, against this box's heavily fragmented file)
separates a stall from a pass. Question 3 is answered: drop it.
The probe
Mine printed
34667 rows/s (fine)at boot and then stalled at runtime. @jds1-ai's 42 starts werebimodal (453-1,040 or 9,219-11,013 rows/s, nothing between) and the kills landed in both modes. So
the problem with
ple_direct_rows_per_s(generate.cpp:1778) is not only that its bar is too low:its value does not predict the prompt path at all. A probe that cannot predict should probably
not be the thing that decides whether to keep
direct.Retracted: "
--ple-io mmapis infeasible on a 64 GB box"I wrote that
mmapcannot be used here because the 28.8 GB table would need page cache and only~8.7 GiB was free. That was an inference, not a measurement, and @jds1-ai's
mincoreresultcontradicts its premise: after the cold first touch only 0.28-0.36 GiB of the shard stays
resident. I am testing
--ple-io mmapon this box and will report the numbers (RAM available hereduring a request is 5-6 GiB, below their 13 GiB, so it is a real test and not a formality).
What I still have not tested
--ple-io mmapon this box (in progress).STRATA_WATCHDOG_S/STRATA_WATCHDOG_IO_Soverrides: every observation here is on the default60 / 600.
pread64through the engine's own pool takes16.8 ms when the same process's boot probe and a standalone reader get 0.17-0.22 ms on the same
descriptor's file. Nothing in this thread explains it yet, and everything else is a workaround
for it.
@Niko1221 commented on GitHub (Oct 19, 2026):
Thanks for taking the time to report this.
We're resetting the tracker for 0.2.0-beta. There are more than 1,300 open issues and pull requests, too many for us to read properly, so we're closing everything that isn't being worked on right now. Closed here does not mean rejected.
To reopen it takes about two minutes:
/reopen. A check runs and either reopens the issue or lists what is still missing.The rules are in CONTRIBUTING.md.
--adapt-async 1beside slots) #3576