[GH-ISSUE #2797] [Linux, RX 7900 XTX gfx1100, 0.1.44.1, ntfs3] --ple-io direct's PLE reads run at ~950 IOPS (3.7 MiB/s) while the same file does 70,406 IOPS from another process; boot probe says "fine", and the #1407 I/O allowance cannot fire for small… #1122

Closed
opened 2026-11-04 01:48:41 +07:00 by bsakaguchi · 4 comments
Owner

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 direct PLE read path delivers ~950 random 4 KiB reads/s (3.7 MiB/s) while a
prompt chunk is read, so layer 1 of one chunk never finishes inside the 60 s watchdog and the
engine aborts itself (exit -6, server.py restarts it, clients see 503). Five occurrences in
two 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_DIRECT pattern 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 D and /proc/<pid>/io advanced at ~3.7 MiB/s, a
second 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

strata generate: PLE direct read probe: 34667 rows/s (fine)

(above the 15,000 rows/s bar in generate.cpp:3314), so no warning is printed. But that is ~36x
what the same process, same PleReader, same DirectFile pool delivers later at runtime. The
probe 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

  • Engine: 0.1.44.1, HIP, ROCm 7.2.3, stock config (no STRATA_* env set)
  • GPU: AMD Radeon RX 7900 XTX (gfx1100), 24 GB
  • Host: Linux 7.0.0-38-generic, Intel B760M D5 (no AVX-512), 20 CPUs, 62.6 GiB RAM, 0 MiB swap
  • Disk: ZHITAI Ti600 1 TB NVMe on nvme0n1p4, NTFS mounted with ntfs3, rotational=0,
    the 44.9 GB GGUF is heavily fragmented (filefrag shows many extents)
  • Model: Swift-Qwen3.8-Flash-Next-GSQ-RCO-IQ3_S, PLE table 320,001,536 rows x 90 B = 28.8 GB,
    --ple-gguf pointing at the same shard as --native
  • Config: --prefill auto --spec 4 --mtp ... --max-context 262144 --kv q4_0 --vision --vram-reserve-mib 1024 --pool-workers 9 --conversation-cache-mib 4096 ...
  • --ple-io left at the default (direct); STRATA_IO_THREADS unset

What the engine logs

strata serve: no progress for 60 s during a request (reading the prompt (batched): layer 1 of the
prompt chunk from token 8104) - stopping the engine so the server starts it again (issue #29)
strata serve: stall report (engine 0.1.44.1): stage "reading the prompt (batched): layer 1 of the
prompt chunk from token 8104" for 60 s; 0 layers served since the last finished step
  VRAM free when this request began: 912 MiB
  expert pool: epoch 0, batch epoch 0: 0 of 0 jobs claimed, 0 done; 9 of 9 workers parked, 9 sleeping
  expert pool threads: w0..w8=sleeping; host idle for 192230 ms
  verify window: 0 tokens at position 0, host at layer step 1; the GPU rang 0
  threads waiting on the disk (state D): 16 of 37 (blk_io_schedule x16)
  memory: 49390 MiB resident, 0 MiB in swap, 8768 MiB RAM available; 7 major page faults so far

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. dmesg has no I/O errors, no timeouts, no hung-task
warnings; nvme_core.io_timeout is 30.

Measurements (2026-10-17, same day, same machine, same file)

what random 4 KiB O_DIRECT notes
standalone process, 16 threads, 10 s 70,406 IOPS, 275 MiB/s, 0.22 ms block-layer counters, /sys/block/nvme0n1/stat
standalone process, 16 threads, 15 s 67,545 IOPS, 264 MiB/s, 278 ms max userspace timing
standalone process, 64 threads 75,269 IOPS, 294 MiB/s, 5.7 ms max userspace timing
the engine's boot probe 34,667 rows/s ("fine") ple_direct_rows_per_s, generate.cpp:1778
the engine, during the stall ~950 IOPS, 3.7 MiB/s, ~16.8 ms/read /proc/<pid>/io sampled every second; 16 threads in D

The 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

  1. The #1407 I/O allowance can never engage for this read pattern. generate.cpp:9640 treats the
    file tier as busy only when majflt + (read_bytes >> 20) grows by >= 16 in one second. A PLE
    gather 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.

  2. STRATA_IO_THREADS is capped at 16 on Linux but ple_inflight defaults to 256. On POSIX each
    pool thread does one blocking pread, so the thread count is the queue depth
    (direct_file.cpp:319, io_threads(16)), while generate.cpp:402 defaults ple_inflight to 256
    and comments that 64 "left the SSD half idle". So 256 jobs are queued and only 16 can ever reach
    the drive. docs/INTEL.md already documents 16 -> 64; the default still disagrees with the
    comment that justifies it.

  3. Neither documented mitigation is usable on a 64 GB machine running IQ3_S. --ple-io mmap
    needs page cache for a 28.8 GB table and --ple-io ram needs 28.8 GB of RAM, but the expert arena
    is 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 no
    supported workaround for this configuration.

Questions

  1. Is the ~76x per-read gap between the engine's runtime path and the boot probe on the same pool
    expected, or is something in the request path (the aux_cpus pinning that switches on per request,
    or --native mmap and --ple-io direct sharing one GGUF file on ntfs3) serialising the reads?
  2. Would a read-count based file-tier signal (rather than MiB/s + major faults) be the right fix for
    the watchdog allowance?
  3. Does anyone have a measurement of --ple-io direct on ntfs3 specifically? All the earlier
    reports I could find (#1425, #1629, #2040, #1407) are Windows, ext4, or loop devices.

What I did not test

  • I did not move the model to an ext4 filesystem, so I cannot separate ntfs3 from the engine's own
    read path. That is the cheapest next test and I can run it.
  • I did not sample /sys/block/nvme0n1/stat during a stall. That single measurement splits the two
    remaining hypotheses: device IOPS ~950 means the requests reach the drive and are slow there;
    device IOPS ~0 with 16 threads still in D means they are stuck above the drive. I can reproduce
    and capture this, plus gdb -p <pid> backtraces for the 16 blocked threads.
  • Three older stalls in my log are a different class (0 threads in state D, VRAM free 448-450 MiB,
    #2065); I am not claiming them here.

#1425 (closed for 0.1.42; the maintainer invited a 0.1.44 re-report), #1629, #1407, #2040, #1984,
#605.

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 direct` PLE read path delivers **~950 random 4 KiB reads/s (3.7 MiB/s)** while a prompt chunk is read, so layer 1 of one chunk never finishes inside the 60 s watchdog and the engine aborts itself (exit -6, `server.py` restarts it, clients see 503). Five occurrences in two 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_DIRECT` pattern 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 `D` and `/proc/<pid>/io` advanced at ~3.7 MiB/s, a second 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 ``` strata generate: PLE direct read probe: 34667 rows/s (fine) ``` (above the 15,000 rows/s bar in `generate.cpp:3314`), so no warning is printed. But that is ~36x what the same process, same `PleReader`, same `DirectFile` pool delivers later at runtime. The probe 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 - **Engine:** 0.1.44.1, HIP, ROCm 7.2.3, stock config (no `STRATA_*` env set) - **GPU:** AMD Radeon RX 7900 XTX (gfx1100), 24 GB - **Host:** Linux 7.0.0-38-generic, Intel B760M D5 (no AVX-512), 20 CPUs, 62.6 GiB RAM, 0 MiB swap - **Disk:** ZHITAI Ti600 1 TB NVMe on `nvme0n1p4`, **NTFS mounted with `ntfs3`**, rotational=0, the 44.9 GB GGUF is heavily fragmented (`filefrag` shows many extents) - **Model:** Swift-Qwen3.8-Flash-Next-GSQ-RCO-IQ3_S, PLE table **320,001,536 rows x 90 B = 28.8 GB**, `--ple-gguf` pointing at the same shard as `--native` - **Config:** `--prefill auto --spec 4 --mtp ... --max-context 262144 --kv q4_0 --vision --vram-reserve-mib 1024 --pool-workers 9 --conversation-cache-mib 4096 ...` - `--ple-io` left at the default (`direct`); `STRATA_IO_THREADS` unset ## What the engine logs ``` strata serve: no progress for 60 s during a request (reading the prompt (batched): layer 1 of the prompt chunk from token 8104) - stopping the engine so the server starts it again (issue #29) strata serve: stall report (engine 0.1.44.1): stage "reading the prompt (batched): layer 1 of the prompt chunk from token 8104" for 60 s; 0 layers served since the last finished step VRAM free when this request began: 912 MiB expert pool: epoch 0, batch epoch 0: 0 of 0 jobs claimed, 0 done; 9 of 9 workers parked, 9 sleeping expert pool threads: w0..w8=sleeping; host idle for 192230 ms verify window: 0 tokens at position 0, host at layer step 1; the GPU rang 0 threads waiting on the disk (state D): 16 of 37 (blk_io_schedule x16) memory: 49390 MiB resident, 0 MiB in swap, 8768 MiB RAM available; 7 major page faults so far ``` 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. `dmesg` has no I/O errors, no timeouts, no hung-task warnings; `nvme_core.io_timeout` is 30. ## Measurements (2026-10-17, same day, same machine, same file) | what | random 4 KiB O_DIRECT | notes | | --- | --- | --- | | standalone process, 16 threads, 10 s | **70,406 IOPS, 275 MiB/s, 0.22 ms** | block-layer counters, `/sys/block/nvme0n1/stat` | | standalone process, 16 threads, 15 s | 67,545 IOPS, 264 MiB/s, 278 ms max | userspace timing | | standalone process, 64 threads | 75,269 IOPS, 294 MiB/s, 5.7 ms max | userspace timing | | the engine's boot probe | 34,667 rows/s ("fine") | `ple_direct_rows_per_s`, `generate.cpp:1778` | | **the engine, during the stall** | **~950 IOPS, 3.7 MiB/s, ~16.8 ms/read** | `/proc/<pid>/io` sampled every second; 16 threads in D | The 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 1. **The #1407 I/O allowance can never engage for this read pattern.** `generate.cpp:9640` treats the file tier as busy only when `majflt + (read_bytes >> 20)` grows by **>= 16 in one second**. A PLE gather 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. 2. **`STRATA_IO_THREADS` is capped at 16 on Linux but `ple_inflight` defaults to 256.** On POSIX each pool thread does one blocking `pread`, so the thread count *is* the queue depth (`direct_file.cpp:319`, `io_threads(16)`), while `generate.cpp:402` defaults `ple_inflight` to 256 and comments that 64 "left the SSD half idle". So 256 jobs are queued and only 16 can ever reach the drive. `docs/INTEL.md` already documents 16 -> 64; the default still disagrees with the comment that justifies it. 3. **Neither documented mitigation is usable on a 64 GB machine running IQ3_S.** `--ple-io mmap` needs page cache for a 28.8 GB table and `--ple-io ram` needs 28.8 GB of RAM, but the expert arena is 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 no supported workaround for this configuration. ## Questions 1. Is the ~76x per-read gap between the engine's runtime path and the boot probe on the same pool expected, or is something in the request path (the `aux_cpus` pinning that switches on per request, or `--native` mmap and `--ple-io direct` sharing one GGUF file on `ntfs3`) serialising the reads? 2. Would a read-count based file-tier signal (rather than MiB/s + major faults) be the right fix for the watchdog allowance? 3. Does anyone have a measurement of `--ple-io direct` on `ntfs3` specifically? All the earlier reports I could find (#1425, #1629, #2040, #1407) are Windows, ext4, or loop devices. ## What I did not test - I did not move the model to an ext4 filesystem, so I cannot separate `ntfs3` from the engine's own read path. That is the cheapest next test and I can run it. - I did not sample `/sys/block/nvme0n1/stat` *during* a stall. That single measurement splits the two remaining hypotheses: device IOPS ~950 means the requests reach the drive and are slow there; device IOPS ~0 with 16 threads still in `D` means they are stuck above the drive. I can reproduce and capture this, plus `gdb -p <pid>` backtraces for the 16 blocked threads. - Three older stalls in my log are a different class (0 threads in state D, VRAM free 448-450 MiB, #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.
Author
Owner

@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.

<!-- gh-comment-id:6224079833 --> @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.
Author
Owner

@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 table 320001536 rows of shard 2 (26.8 GiB) · --prefill auto --max-context 32768 --kv int8 --kv-resident 32768 --resident-budget-gib 12, --ple-io at 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 with STRATA_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 logged no 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 of n4i-laon). The stall report of a killed start:

stall report (engine 0.1.44): stage "reading the prompt (batched): layer 1 of the prompt chunk from token 0" for 60 s; 0 layers served
  expert pool: epoch 0, batch epoch 0: 0 of 0 jobs claimed, 0 done; 3 of 3 workers parked, 3 sleeping
  threads waiting on the disk (state D): 16 of 95 (blk_io_schedule x16) - the engine is waiting for the drive: a rotational or failing disk with --ple-io direct (#605: --ple-io ram), or a drive too slow for the reads asked of it
  memory: 29453 MiB resident, 0 MiB in swap, 13408 MiB RAM available; 5815 major page faults so far

Who the 16 threads are. /proc/<tid>/stack of every D thread during the same phase in a repeat start [n4i-nola-1016T201142/dstack.txt, 20:13:40Z]:

blk_io_schedule <- __iomap_dio_rw <- iomap_dio_rw <- ext4_file_read_iter <- vfs_read <- __x64_sys_pread64

The 16 D threads are read from wchan [threads.txt: 16 in blk_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: 0140000 in the shard2 fds section of n4d-d-auto-s10-nola-1016T151848/stamp-long1.txt; fd 38 -> shard 2 in proc-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/diskstats for sda at 1 Hz, ...-nola-r2-1016T160734/diskstats-sampler.txt, from 16:10:00Z):

window reads/s KB per read ms per read
+5 s to +40 s 375-405 4.1-7.0 40-54
+45 s to +60 s 585-593 4.1-4.9 26-30

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 --readonly on 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, no blk_io_schedule phase (the D threads sit in folio_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 (mincore residency 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-1016T203603 vs ...-pf2048-reps-1016T195949]. On this SATA SSD the #2040 7x penalty did not appear beyond the first touch. --ple-io ram is out on a 32 GB box: the table is the whole 28.8 GB shard.

Suggested changes.

  1. Count read calls, not bytes: add syscr from /proc/self/io to file_tier_activity() (generate.cpp:1155), or treat any positive growth of read_bytes while 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.
  2. In the stall report, when the D threads' stacks are in __iomap_dio_rw / pread64 and read_bytes is 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.
  3. The boot probe's "fine" line (and the warning's value) does not predict the stall here either: the same file measured 453 to 11,013 rows/s across 42 starts, in two modes, and the two killed starts sat one in each mode.

Not tested. NVMe on this box (none); STRATA_WATCHDOG_IO_S or STRATA_WATCHDOG_S overrides (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.

<!-- gh-comment-id:6227541280 --> @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 table `320001536 rows` of shard 2 (26.8 GiB) · `--prefill auto --max-context 32768 --kv int8 --kv-resident 32768 --resident-budget-gib 12`, `--ple-io` at 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 with `STRATA_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 logged `no 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 of `n4i-laon`). The stall report of a killed start: ``` stall report (engine 0.1.44): stage "reading the prompt (batched): layer 1 of the prompt chunk from token 0" for 60 s; 0 layers served expert pool: epoch 0, batch epoch 0: 0 of 0 jobs claimed, 0 done; 3 of 3 workers parked, 3 sleeping threads waiting on the disk (state D): 16 of 95 (blk_io_schedule x16) - the engine is waiting for the drive: a rotational or failing disk with --ple-io direct (#605: --ple-io ram), or a drive too slow for the reads asked of it memory: 29453 MiB resident, 0 MiB in swap, 13408 MiB RAM available; 5815 major page faults so far ``` **Who the 16 threads are.** `/proc/<tid>/stack` of every D thread during the same phase in a repeat start [`n4i-nola-1016T201142/dstack.txt`, 20:13:40Z]: ``` blk_io_schedule <- __iomap_dio_rw <- iomap_dio_rw <- ext4_file_read_iter <- vfs_read <- __x64_sys_pread64 ``` The 16 D threads are read from `wchan` [`threads.txt`: 16 in `blk_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: 0140000` in the `shard2 fds` section of `n4d-d-auto-s10-nola-1016T151848/stamp-long1.txt`; fd 38 -> shard 2 in `proc-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/diskstats` for `sda` at 1 Hz, `...-nola-r2-1016T160734/diskstats-sampler.txt`, from 16:10:00Z): | window | reads/s | KB per read | ms per read | |---|---|---|---| | +5 s to +40 s | 375-405 | 4.1-7.0 | 40-54 | | +45 s to +60 s | 585-593 | 4.1-4.9 | 26-30 | 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 --readonly` on 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, no `blk_io_schedule` phase (the D threads sit in `folio_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 (`mincore` residency 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-1016T203603` vs `...-pf2048-reps-1016T195949`]. On this SATA SSD the #2040 7x penalty did not appear beyond the first touch. `--ple-io ram` is out on a 32 GB box: the table is the whole 28.8 GB shard. **Suggested changes.** 1. Count read calls, not bytes: add `syscr` from `/proc/self/io` to `file_tier_activity()` (`generate.cpp:1155`), or treat any positive growth of `read_bytes` while 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. 2. In the stall report, when the D threads' stacks are in `__iomap_dio_rw` / `pread64` and `read_bytes` is 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. 3. The boot probe's "fine" line (and the warning's value) does not predict the stall here either: the same file measured 453 to 11,013 rows/s across 42 starts, in two modes, and the two killed starts sat one in each mode. **Not tested.** NVMe on this box (none); `STRATA_WATCHDOG_IO_S` or `STRATA_WATCHDOG_S` overrides (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.
Author
Owner

@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 and
wchan at 1 Hz, then sent two cold long prompts. Both passed.

strata serve: prompt 159915 tokens = 0 reused + 159915 read in  99484 ms (1607.4 tok/s)
strata serve: prompt 187098 tokens = 0 reused + 187098 read in 119172 ms (1570.0 tok/s)

One sampled second of the first one:

threads: D15 R6 S16   (wchan: blk_io_schedule x15)
device:  64871 reads/s, 258.9 MiB/s, read_ms +11066  ->  0.171 ms per read
process: read_bytes +265236 kB in the same second     ->  ~4.18 KiB per read

So on this box, with the same binary, the same --ple-io direct default and the same shard:

reads/s ms per read
this box, healthy mid-gather (device counters) 64,871 0.171
this box, during the stall (/proc/<pid>/io, 12 s) ~950 ~16.8
this box, standalone O_DIRECT, same file, 16 threads 70,406 0.217
@jds1-ai, healthy (their comment above) 2,556 7.8
@jds1-ai, during the stall (their /proc/diskstats) 375-593 40-54
@jds1-ai, fio on the same file 10,355 1.54

15-16 threads in blk_io_schedule is the normal mid-gather shape, which is what @jds1-ai's
/proc/<tid>/stack trace shows. The anomaly is not the thread count and not the queue depth: it is
the 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=64 does not
address 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 had
measured --ple-io direct on ntfs3 specifically. That was the wrong variable. @jds1-ai
reproduced 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 were
bimodal (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 mmap is infeasible on a 64 GB box"

I wrote that mmap cannot 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 mincore result
contradicts its premise: after the cold first touch only 0.28-0.36 GiB of the shard stays
resident. I am testing --ple-io mmap on this box and will report the numbers (RAM available here
during 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 mmap on this box (in progress).
  • Moving the model to ext4 (now much less interesting, see above).
  • STRATA_WATCHDOG_S / STRATA_WATCHDOG_IO_S overrides: every observation here is on the default
    60 / 600.
  • The only question that still matters: why a pread64 through the engine's own pool takes
    16.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.
<!-- gh-comment-id:6229630447 --> @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 and `wchan` at 1 Hz, then sent two cold long prompts. Both passed. ``` strata serve: prompt 159915 tokens = 0 reused + 159915 read in 99484 ms (1607.4 tok/s) strata serve: prompt 187098 tokens = 0 reused + 187098 read in 119172 ms (1570.0 tok/s) ``` One sampled second of the first one: ``` threads: D15 R6 S16 (wchan: blk_io_schedule x15) device: 64871 reads/s, 258.9 MiB/s, read_ms +11066 -> 0.171 ms per read process: read_bytes +265236 kB in the same second -> ~4.18 KiB per read ``` So on this box, with the same binary, the same `--ple-io direct` default and the same shard: | | reads/s | ms per read | | --- | --- | --- | | this box, **healthy** mid-gather (device counters) | **64,871** | **0.171** | | this box, during the stall (`/proc/<pid>/io`, 12 s) | ~950 | ~16.8 | | this box, standalone O_DIRECT, same file, 16 threads | 70,406 | 0.217 | | @jds1-ai, healthy (their comment above) | 2,556 | 7.8 | | @jds1-ai, during the stall (their `/proc/diskstats`) | 375-593 | 40-54 | | @jds1-ai, `fio` on the same file | 10,355 | 1.54 | **15-16 threads in `blk_io_schedule` is the normal mid-gather shape**, which is what @jds1-ai's `/proc/<tid>/stack` trace shows. The anomaly is not the thread count and not the queue depth: it is the **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=64` does not address 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 had measured `--ple-io direct` on `ntfs3` specifically. **That was the wrong variable.** @jds1-ai reproduced 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 were bimodal (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 mmap` is infeasible on a 64 GB box" I wrote that `mmap` cannot 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 `mincore` result contradicts its premise: after the cold first touch only **0.28-0.36 GiB** of the shard stays resident. I am testing `--ple-io mmap` on this box and will report the numbers (RAM available here during 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 mmap` on this box (in progress). - Moving the model to ext4 (now much less interesting, see above). - `STRATA_WATCHDOG_S` / `STRATA_WATCHDOG_IO_S` overrides: every observation here is on the default 60 / 600. - **The only question that still matters: why a `pread64` through the engine's own pool takes 16.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.
Author
Owner

@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:

  1. Re-test on 0.2.0-beta. It may already be fixed. Write down what you see.
  2. Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other].
  3. Fill in the parts of the issue form: what happened, the Strata version, your graphics card, memory and system.
  4. Comment /reopen. A check runs and either reopens the issue or lists what is still missing.

The rules are in CONTRIBUTING.md.

<!-- gh-comment-id:6271265284 --> @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: 1. Re-test on 0.2.0-beta. It may already be fixed. Write down what you see. 2. Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other]. 3. Fill in the parts of the issue form: what happened, the Strata version, your graphics card, memory and system. 4. Comment `/reopen`. A check runs and either reopens the issue or lists what is still missing. The rules are in [CONTRIBUTING.md](https://github.com/Niko1221/Strata/blob/main/CONTRIBUTING.md).
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#1122
No description provided.