Recorded 2026-11-25. Moving Run 7.2 from L40S to RTX 5090 with torch.compile, FlexAttention, and 2D fixed-grid sequence packing failed to raise median throughput (27.36–30.65 TFLOP/s, ~14.6% MFU), while brief bursts hit 71–73 TFLOP/s (~35% MFU) immediately after 1,000-step pauses. Cross-checking Dashboard time-series data against the prefetcher implementation indicates that CPU data loading and collation are starving the GPU for over half of wall-clock training time, alongside a lower realistic GPU ceiling (~72 TFLOP/s) than earlier roofline estimates assumed.
Observed anomaly across runs
In Run #7.2.5 (SkyPilot, NVIDIA GeForce RTX 5090, compile = true, max_batch_frames = 52,000, 20,000 updates over 6.18 h), Dashboard metrics (attempt_id = 84) show a sharp bimodal split rather than uniform GPU execution:
- Overall steady state sits at
27.4–30.7 TFLOP/s: Across2,000sampled points oftrain/flops_per_second, median throughput is30.65 TFLOP/s(19.91 TFLOP/satp10,32.45 TFLOP/satp90). Across the500-point summary query, median throughput is27.36 TFLOP/s(0.83–0.88 s/steptypical, dropping to1.3–1.4 s/stepatp10). - All
14high-throughput spikes align with1,000-step pauses: Every single log window exceeding60 TFLOP/s(61.4–73.0 TFLOP/s,~0.37 s/step) appeared atstep 10, 2010, 3010, 4010, 6010, 8010, 10010, 11010, 13010, 14010, 15010, 16010, 18010, 19010. Each of those steps immediately followed a~90 srender_interval = 1000andcheckpoint_interval = 1000pause (wall_dt = 96.21 saroundstep 3010).
Cross-checking three neighboring runs in the Dashboard database reinforces the same pattern:
Run #7.2.3(Modal A100-40GB,max_batch_frames = 52,000): Median throughput dropped to18.20 TFLOP/s(p10 = 14.09 TFLOP/s), while unstarved peak reached71.24 TFLOP/s(~3.9xgap).Run #7.2.4(Modal A100-40GB,max_batch_frames = 80,000): Raisingmax_batch_framesfrom52,000to80,000reduced the number of batches the CPU needed to prepare per second and lifted median throughput from18.20to42.22 TFLOP/s, while unstarved peak stayed at73.73 TFLOP/s.Run #8.2.2(Modal L40S,244Chia slices,max_batch_frames = 16,000): With only244short slices (~21.5 mintotal audio), throughput stayed flat at78.92 TFLOP/smedian (p10 = 78.58 TFLOP/s,max = 79.46 TFLOP/s) with no starvation drops.
Suspected CPU data-pipeline mechanism
Inspecting BatchPrefetcher and collate_packed explains why the GPU runs at ~72 TFLOP/s after a pause and then collapses back to ~30 TFLOP/s:
- Queue prefill during pauses masks the CPU bottleneck for a few steps: During the
~90 srender + checkpointstop at every1,000steps, the GPU stops consuming batches while the background thread refillsqueue.Queue(maxsize=6). Once training resumes, the GPU consumes those prebuilt batches at its unstarved speed (~0.37 s/step,~71–73 TFLOP/s). After the6-slot buffer drains, the main training loop blocks inprefetcher.next()waiting for CPU preparation. - Hardcoded
2 GiBLRU cache thrashes on M4Singeraudio_features:_ItemLRUCachecaps deserialized rows in memory at_PREFETCH_CACHE_MAX_BYTES = 2 * 1024**3(2 GiB). M4Singer’s24.93 htraining split carries1024-dimensionalaudio_featureson every frame alongsidemel,f0, and alignments, so the deserialized working set exceeds2 GiB. Every miss triggers cross-process HDF5 reads viapool.map(_fetch_cache_item, missing)(whereas Chia’s244slices inRun #8.2.2fit completely inside2 GiBafter epoch 1, eliminating cache misses). - Single-threaded synchronous collation and pinning: Although
BatchPrefetcherspawns up to4worker processes (min(4, max(1, os.cpu_count() or 1))) to fetch raw rows, a single background thread (self.thread) runs_collate_groupsserially. For each52,000-frame microbatch,collate_packedallocates output tensors, normalizes Mel frames, computes F0 and timing features, copies1024-daudio_features, and pins15tensors (pin_memory()). That serial CPU loop cannot sustain one52,000-frame batch every0.37 s.
Realistic unstarved GPU ceiling
Even when the prefetch queue is full, both RTX 5090 (73.04 TFLOP/s, ~34.9% MFU) and A100-40GB (71.24–73.73 TFLOP/s, ~23% MFU) plateau near ~72 TFLOP/s on Run #7.2 rather than reaching 110–160 TFLOP/s:
- Nominal vs. sustained bandwidth:
RTX 5090’s1,792 GB/sGDDR7 specification represents peak theoretical bandwidth, whereas real compiled kernels typically sustain70%–80%. - Narrow sub-modules and dual-path graph: Alongside the
width = 512DiT, dual-path updates insteps.pyrun bothlabelandaudioforward and backward passes plusaudio_ref,PhoneEncoder(width = 256),ConditionedResidualAdapter(512to64), gradient clipping, andAdamW. - Windowed
FlexAttentionand block-mask construction: Windowed256-frame attention (head_width = 64) and per-forwardcreate_attention_block_maskcalls lower effective step-level arithmetic intensity relative to isolatedFFNprojections.
Eliminating CPU starvation is therefore expected to raise RTX 5090 median throughput from ~30 TFLOP/s to roughly 65–73 TFLOP/s (cutting a 20,000-step 7.2 run from ~6.2 h to roughly 2.3–2.6 h), while pushing MFU past ~35% requires scaling model width (width >= 1024) rather than further micro-tuning at width = 512.
Hypotheses and validation plan
Before rewriting the data pipeline, run a short diagnostic benchmark (20–50 steps on RTX 5090 or A100 using the 7.2 config) to measure each stage directly:
- Instrument wait vs. compute time: Log
prefetcher.next()blocking duration,_prefetch_missingHDF5 read time,collate_packedCPU time, andpin_memory()time per update so the~0.5–1.0 s/stepstall is decomposed into measured fractions rather than inferred fromrenderspikes. - Test scaled or RAM-resident item caching: Make
_PREFETCH_CACHE_MAX_BYTESconfigurable (or size it from host RAM) and verify on>= 32 GBRAM instances whether eliminating2 GiBLRU evictions removes the19–20 TFLOP/s(p10) stalls. - Test multi-process collation: Move
collate_packedinto worker processes (or use shared-memory tensor buffers / a multi-worker PyTorchDataLoaderwithpin_memoryon the main prefetch thread) and check whetherBatchPrefetcherkeeps thequeuefull without blockingRTX 5090at~0.37 s/step. - Verify steady-state throughput and CPU provisioning: Measure median
train/flops_per_secondacross200consecutive steps withoutrenderpauses (validation_interval = 0during the micro-benchmark) and record minimum required vCPU cores and host RAM for Cloud GPU selection.



