Update manuscript PDF, LaTeX source, and Overleaf bundle after AI review revisions
Browse files- paper/main.tex +56 -53
paper/main.tex
CHANGED
|
@@ -70,7 +70,7 @@
|
|
| 70 |
|
| 71 |
\IEEEtitleabstractindextext{%
|
| 72 |
\begin{abstract}
|
| 73 |
-
Autonomous software engineering agents alternate between GPU token generation and host operating system tool execution such as test suites, linters, and compiler builds. Current inference engines and host schedulers manage these two stages in isolation. When CPU contention slows an interactive test sandbox whose Key-Value cache resides in
|
| 74 |
\end{abstract}
|
| 75 |
|
| 76 |
\begin{IEEEkeywords}
|
|
@@ -102,10 +102,10 @@ We present \SymbioOS{}, a closed-loop user-space runtime that unifies host sandb
|
|
| 102 |
|
| 103 |
Our work makes four contributions:
|
| 104 |
\begin{enumerate}
|
| 105 |
-
\item \textbf{Memory-Coupled Tandem Queueing Model and Index
|
| 106 |
\item \textbf{White-Box Sub-Turn Pipe Filtration:} We design an overhead-free pipe monitor that parses live progress milestones (\texttt{[XX\%]}) and tracks \emph{unstopped-quantum silence}, separating genuine socket or lock hangs ($1.25~\mathrm{s}$ early demotion) from CPU-throttled startup imports without false evictions.
|
| 107 |
\item \textbf{Exact Streaming \texttt{stdout} Micro-Prefill:} We harvest idle GPU cycles while tools are still running to pre-encode $256$-token chunks of append-only \texttt{stdout}, using a one-token Byte-Pair Encoding (BPE) lookback guard~\cite{sennrich2016bpe} and bucketed causal attention padding to preserve exact token and logit equivalence with offline post-exit prefill (Proposition~\ref{prop:bpe}).
|
| 108 |
-
\item \textbf{Multi-Architecture
|
| 109 |
\end{enumerate}
|
| 110 |
|
| 111 |
The remainder of this paper is organized as follows. Section~\ref{sec:motivation} characterizes multi-turn agent KV footprints and open-loop $t = 0$ failure modes. Section~\ref{sec:theory} develops the memory-coupled tandem queueing model, BPE lookback invariance, and Theorems~\ref{thm:gittins}--\ref{thm:jit}. Section~\ref{sec:design} details the rootless POSIX scheduler, decoupled cold-tier DMA engine, and streaming micro-prefill pipeline. Section~\ref{sec:eval} presents multi-architecture hardware and cluster-scale evaluations, Section~\ref{sec:related} surveys prior work, and Section~\ref{sec:conclusion} discusses scope, limitations, and conclusions.
|
|
@@ -148,38 +148,39 @@ generating the natural sub-turn filtration $\mathcal{F}_t = \sigma\bigl(\{(x_i,
|
|
| 148 |
Given $\mathcal{F}_t$, the filtered residual CPU work is $\hat{W}_{\mathrm{rem},i}(t) = \E[W_i - u_i(t) \mid \mathcal{F}_t]$: once milestones arrive ($p_i(t) \ge p_{\min}$), the empirical work-rate estimator yields $\hat{W}_{\mathrm{rem},i}(t) = u_i(t)(1 - p_i(t))/p_i(t)$, smoothly backed off to class prior $\mu_0(x_i) - u_i(t)$ for $p_i(t) < p_{\min}$, while $\sigma_i(t) \ge \tau_{\mathrm{stall}}$ raises the stall indicator $\hat{I}_{\mathrm{stall},i}(t) = 1$. Mapping $\hat{W}_{\mathrm{rem},i}(t)$ through expected core share gives conditional remaining wall-clock time $\hat{R}_i(t) = \E[R_i(t) \mid \mathcal{F}_t]$.
|
| 149 |
|
| 150 |
\subsection{Exactness of Lookback-Guarded Streaming Micro-Prefill}
|
| 151 |
-
Let $\Sigma^*$ denote the byte stream emitted on \texttt{stdout}, tokenized by a deterministic BPE/regex tokenizer $\mathcal{T}: \Sigma^* \to \mathcal{V}^*$ whose pre-tokenization pattern merges characters only within bounded lexical spans~\cite{sennrich2016bpe}. Suppose at intermediate time $t < t_{\mathrm{exit}}$, buffer $Y(t)$ is a prefix of the final stream $Y(t_{\mathrm{exit}}) = Y(t) \Vert Z$.
|
| 152 |
|
| 153 |
\begin{proposition}[One-Token BPE Lookback Prefix Invariance]\label{prop:bpe}
|
| 154 |
Suppose every pre-tokenizer regex token boundary in $\mathcal{T}$ is finalized once at least one subsequent token starts (holding for newline-flushed log streams under \texttt{Qwen2.5} and \texttt{GPT-NeoX} pre-tokenizers). Define the lookback-guarded token sequence $\mathcal{T}_{\mathrm{safe}}(Y(t)) := \mathcal{T}(Y(t))_{1 : |\mathcal{T}(Y(t))|-1}$ for $|\mathcal{T}(Y(t))| \ge 2$. Then for every prefix $Y(t)$ of $Y(t_{\mathrm{exit}})$, $\mathcal{T}_{\mathrm{safe}}(Y(t))$ is an exact token-ID prefix of $\mathcal{T}(Y(t_{\mathrm{exit}}))$. Furthermore, under strictly lower-triangular causal self-attention with right-padded bucket length $B \ge m$ followed by cache crop $\mathrm{crop}(-(B - m))$, incremental $B_{\mathrm{chunk}}$-token prefill produces KV states and final-token logits identical to single-pass post-exit prefill in exact arithmetic (and bit-identical per bucket step in IEEE~754 \texttt{FP16}).
|
| 155 |
\end{proposition}
|
| 156 |
|
| 157 |
-
\subsection{
|
| 158 |
-
Consider
|
| 159 |
|
| 160 |
-
\begin{theorem}[KV-Weighted
|
| 161 |
-
Let runnable sandboxes $i \in \{1,\dots,M\}$ have independent conditional remaining CPU requirements $W_{\mathrm{rem},i} \mid \mathcal{F}_t$ satisfying
|
| 162 |
\begin{equation}\label{eq:gittins}
|
| 163 |
-
w_i(t) = \frac{v_i}{\E[
|
| 164 |
\end{equation}
|
| 165 |
-
minimizes
|
| 166 |
\end{theorem}
|
| 167 |
|
| 168 |
-
Next, consider an evicted sandbox ($r_i(t) = 0$) whose filtered remaining time $R_i(t) \mid \mathcal{F}_t$ has cumulative distribution $G_{i,t}(x) = \Prob(R_i(t) \le x \mid \mathcal{F}_t)$.
|
| 169 |
|
| 170 |
-
\begin{theorem}[
|
| 171 |
-
(a) Under
|
| 172 |
-
\begin{
|
| 173 |
-
\mathcal{L}_i(t) = c_{\mathrm{miss}}\,\E\bigl[(
|
| 174 |
-
\
|
| 175 |
-
|
|
|
|
| 176 |
\begin{equation}\label{eq:jit_thresh}
|
| 177 |
\Prob\bigl(R_i(t) \le T_{\mathrm{dma},i} + \delta_{\mathrm{jit}} \;\big|\; \mathcal{F}_t\bigr) \ge \frac{c_{\mathrm{miss}}}{c_{\mathrm{miss}} + \lambda_{\mathrm{hbm}} S_i} =: 1 - \eta^*.
|
| 178 |
\end{equation}
|
| 179 |
-
(b)
|
| 180 |
\end{theorem}
|
| 181 |
|
| 182 |
-
|
| 183 |
|
| 184 |
% ============================================================================
|
| 185 |
\section{SymbioOS Design and Rootless Implementation}\label{sec:design}
|
|
@@ -188,19 +189,19 @@ Formal proofs of Proposition~\ref{prop:bpe}, Theorem~\ref{thm:gittins}, and Theo
|
|
| 188 |
\subsection{Rootless POSIX Process-Group Quantum Scheduler}
|
| 189 |
Production CI clusters, Slurm compute nodes, and unprivileged container runtimes restrict root capabilities (\texttt{CAP\_SYS\_ADMIN}, \texttt{CAP\_BPF}), preventing user-level serving frameworks from loading custom kernel eBPF schedulers~\cite{zheng2026agentcgroup}. \SymbioOS{} implements its host scheduler purely in user space via POSIX process groups, depicted in Fig.~\ref{fig:arch}(b). Every tool invocation spawns in a dedicated session (\texttt{start\_new\_session=True} / \texttt{setsid()}), assigning the top-level driver and all descendant processes (such as \texttt{pytest} workers, \texttt{git} helpers, and \texttt{clang++} compiler frontends and backends) a shared process-group identifier $\mathrm{pgid}_i$.
|
| 190 |
|
| 191 |
-
A dedicated scheduler thread wakes at a fixed quantum $\Delta t = 80~\mathrm{ms}$ ($12.5~\mathrm{Hz}$), chosen large enough to amortize L2 cache warm-up and signal delivery while maintaining sub-$100~\mathrm{ms}$ responsiveness. On each tick, the thread drains all non-blocking \texttt{stdout} descriptors (\texttt{O\_NONBLOCK}, $64~\mathrm{KB}$ reads), updates $\mathbf{z}_i(t)$ in \eqref{eq:telemetry}, excludes I/O-sleeping sandboxes from CPU slot contention, and
|
| 192 |
\begin{equation}\label{eq:impl_score}
|
| 193 |
\tilde{w}_i(t) = \psi_i \left(\frac{\gamma_{\mathrm{res},i}\, S_i \cdot (S_i / B_{\mathrm{dma}})}{\max(\hat{R}_i(t),\, \tau_{\min})} + \beta_{\mathrm{age}}\,\omega_{\mathrm{wait},i}(t)\right),
|
| 194 |
\end{equation}
|
| 195 |
-
where $\gamma_{\mathrm{res},i} = 2.6$ when $r_i(t) = 1$ (or JIT promotion is in flight) versus $0.12$ when evicted on disk, $\psi_i = 1.15$ for non-terminal turns to prevent multi-turn stragglers, and $\omega_{\mathrm{wait},i}(t) = \max(0,\, (t - t_{0,i}) - u_i(t))$ is cumulative CPU wait time with starvation-prevention slope $\beta_{\mathrm{age}} = 0.35$. The top-$C$ runnable sandboxes receive \texttt{killpg($\mathrm{pgid}_i$, SIGCONT)}, while remaining runnable sandboxes receive \texttt{killpg($\mathrm{pgid}_i$, SIGSTOP)}.
|
| 196 |
|
| 197 |
\subsection{Decoupled Cold-Tier DMA and Closed-Loop Tiering}
|
| 198 |
Evicted KV caches serialize layerwise key and value tensors to solid-state files configured with uncached file I/O (\texttt{fcntl(fd, F\_NOCACHE, 1)} on Darwin; \texttt{O\_DIRECT} on Linux) to bypass unified host page caches. During Phase~1 profiling on $128~\mathrm{KB/tok}$ \texttt{OLMoE-1B-7B} sessions ($250$--$380~\mathrm{MB}$ per cache), sharing a single FIFO queue between background eviction flushes and urgent cold-miss reads caused severe write-behind head-of-line blocking. \SymbioOS{} therefore separates cold-tier storage into two channels: a background writeback thread that flushes evicted CPU staging buffers asynchronously to disk, and a dedicated high-priority read DMA queue that services reactive reloads and speculative JIT promotions in strict priority order while enforcing single-lane PCIe/NVMe transfer bandwidth $B_{\mathrm{dma}}$.
|
| 199 |
|
| 200 |
Closed-loop tiering executes three coordinated rules on every control tick:
|
| 201 |
\begin{enumerate}
|
| 202 |
-
\item \emph{Early Stall and Long-Build Demotion:} Whenever $\hat{I}_{\mathrm{stall},i}(t) = 1$ ($\sigma_i(t) \ge 1.25~\mathrm{s}$ with $p_i(t) < 0.05$), or when a \texttt{build}-class sandbox satisfies $\hat{R}_i(t) > 2.6~\mathrm{s}$ under HBM utilization exceeding $65\%$, \SymbioOS{} immediately demotes $KV_i$ to cold storage rather than waiting for TTL expiration.
|
| 203 |
-
\item \emph{
|
| 204 |
\item \emph{Work-Conserving Non-Blocking GPU Dispatch:} Exited sandboxes whose KV caches missed HBM enqueue cold reloads immediately at $t_{\mathrm{exit},i}$ without stalling the GPU; meanwhile, the GPU engine serves ready HBM-resident waiting sessions in FIFO order of $t_{\mathrm{exit}}$.
|
| 205 |
\end{enumerate}
|
| 206 |
|
|
@@ -246,7 +247,7 @@ Table~\ref{tab:alg_loop} summarizes the complete \SymbioOS{} control cycle. Beca
|
|
| 246 |
% ============================================================================
|
| 247 |
|
| 248 |
\subsection{Experimental Methodology and Baselines}
|
| 249 |
-
All hardware experiments execute locally on an Apple M5 Pro workstation ($15$ CPU cores, $48~\mathrm{GB}$ unified memory, macOS Darwin $25.6.0$)
|
| 250 |
\begin{itemize}
|
| 251 |
\item \textbf{\texttt{Qwen2.5-3B-Instruct}}~\cite{qwen2025qwen25}: $36$-layer dense Grouped-Query Attention ($8{:}1$ GQA), $36.0~\mathrm{KB/tok}$ KV footprint;
|
| 252 |
\item \textbf{\texttt{Qwen2.5-7B-Instruct}}~\cite{qwen2025qwen25}: $28$-layer dense GQA ($7{:}1$), $56.0~\mathrm{KB/tok}$ KV footprint;
|
|
@@ -262,19 +263,20 @@ We compare five head-to-head policies sharing identical arrival seeds, work-cons
|
|
| 262 |
\item \textbf{\SymbioFull{}:} \SymbioSched{} augmented with idle-slack $256$-token lookback-guarded streaming \texttt{stdout} micro-prefill.
|
| 263 |
\end{enumerate}
|
| 264 |
|
| 265 |
-
Across Phase~0 ($1{,}080$ controlled heavy-tailed POSIX subprocess resumes across three seeds $[42, 137, 2026]$) and Phase~1 ($960$ multi-model resumes
|
| 266 |
|
| 267 |
\subsection{Streaming Causality and Numerical Equivalence}
|
| 268 |
-
Before multi-tenant benchmarking, we verified Proposition~\ref{prop:bpe} on live \texttt{pytest} streams ($1{,}044$--$1{,}368$ \texttt{stdout} tokens, $4$--$5$ live $256$-token chunks plus $26$--$94$ EOF tail tokens) on \texttt{Qwen2.5-3B} (\texttt{mps}, \texttt{FP16}). One-token BPE lookback produced $100\%$ exact token-ID match against full post-exit tokenization, final-position
|
| 269 |
|
| 270 |
\begin{table*}[!t]
|
| 271 |
\centering
|
| 272 |
-
\caption{Phase 0 Controlled Heavy-Tailed Benchmark on \texttt{Qwen2.5-3B-Instruct} (\texttt{FP16} MPS, $C = 4$ CPU
|
| 273 |
\label{tab:phase0}
|
| 274 |
-
\
|
|
|
|
| 275 |
\begin{tabular}{llrrrrrrrrr}
|
| 276 |
\toprule
|
| 277 |
-
\textbf{Regime} & \textbf{Policy} & \textbf{
|
| 278 |
& & \textbf{(ms)} & \textbf{(ms)} & \textbf{(ms)} & \textbf{(ms)} & \textbf{(\%)} & \textbf{(\%)} & \textbf{(MB$\cdot$s)} & \textbf{(s)} & \textbf{($\le 500$ms/m)} \\
|
| 279 |
\midrule
|
| 280 |
\multirow{5}{*}{\shortstack[l]{Closed Pool\\($K{=}12$, $600$ res.,\\$M_{\mathrm{HBM}}{=}290$MB)}}
|
|
@@ -304,7 +306,7 @@ Before multi-tenant benchmarking, we verified Proposition~\ref{prop:bpe} on live
|
|
| 304 |
\subsection{Phase 0: Controlled Multi-Regime Analysis and Tandem Synergy}
|
| 305 |
Table~\ref{tab:phase0} and Fig.~\ref{fig:phase0} evaluate all five policies under two complementary load patterns on \texttt{Qwen2.5-3B-Instruct} ($B_{\mathrm{dma}} = 160~\mathrm{MB/s}$, equivalent to $1.6~\mathrm{GB/s}$ contended NVMe-to-PCIe bandwidth at $32\mathrm{B}$ KV scale): a closed concurrency pool ($K = 12$ active container slots draining $20$ two-turn episodes per seed, $M_{\mathrm{HBM}} = 290~\mathrm{MB}$) and a $16$-session concurrent burst wave ($M_{\mathrm{HBM}} = 380~\mathrm{MB}$).
|
| 306 |
|
| 307 |
-
Three empirical phenomena stand out. First, \Continuum{} suffers severe TTL cliff misses in both regimes ($15.8\%$ and $17.7\%$ overall HBM hit rates, dropping below reactive \texttt{LRU+CFS} at $18.3\%$ and $29.2\%$)
|
| 308 |
|
| 309 |
Third, comparing \SymbioFull{} against \SymbioSched{} validates Theorem~\ref{thm:jit}(b)'s second-order tandem-queue coupling. In the tight $290~\mathrm{MB}$ closed-pool regime, Turn-2 KV caches grow to $82$--$92~\mathrm{MB}$; under \SymbioSched{}, three simultaneously exiting sessions occupy $255~\mathrm{MB}$ of HBM while waiting sequentially to prefill $1{,}050$ unstreamed \texttt{stdout} tokens, causing temporary HBM head-of-line backpressure ($\mathrm{P95} = 8{,}527~\mathrm{ms}$). By pre-encoding $89$ chunks of $256$ tokens during idle GPU slack, \SymbioFull{} drains waiting GPU sessions $1.7\times$ faster ($299.0~\mathrm{ms}$ vs.\ $505.0~\mathrm{ms}$ post-exit GPU service), cutting mean GPU queue wait by $4.2\times$ ($992.2 \to 235.5~\mathrm{ms}$), lifting HBM hit rate further from $42.5\%$ to $50.8\%$ ($59.4\% \to 64.6\%$ in burst waves), collapsing closed-pool P50 TTFT to $682.1~\mathrm{ms}$ ($3.6\times$--$3.7\times$ faster than baselines), raising raw cluster goodput from $34.89$ to $41.09~\mathrm{ep/min}$ ($+17.8\%$), and boosting strict $\le 500~\mathrm{ms}$ SLO goodput by $4.4\times$--$5.8\times$ ($32.9$ vs.\ $5.7$--$7.5~\mathrm{resumes/min}$).
|
| 310 |
|
|
@@ -312,11 +314,12 @@ Third, comparing \SymbioFull{} against \SymbioSched{} validates Theorem~\ref{thm
|
|
| 312 |
\centering
|
| 313 |
\caption{Phase 1 Real Developer-Tool Process Groups (\texttt{pytest 9.2}, \texttt{clang++ -O3}, \texttt{git}) Across Three LLM Architectures ($K{=}10$, $C{=}3$ Cores)}
|
| 314 |
\label{tab:phase1}
|
| 315 |
-
\
|
|
|
|
| 316 |
\begin{tabular}{llrrrrrrrrr}
|
| 317 |
\toprule
|
| 318 |
-
\textbf{Model
|
| 319 |
-
|
| 320 |
\midrule
|
| 321 |
\multirow{5}{*}{\shortstack[l]{\texttt{Qwen2.5-3B}\\Dense GQA ($36$ KB/tok)\\$M_{\mathrm{HBM}}{=}320$MB}}
|
| 322 |
& \texttt{LRU + CFS} & 1209.6 & 1973.2 & 444.2 & 242.7 & 43.8\% & 64.3\% & 2199.1 & 8.70 & 26.1 \\
|
|
@@ -355,7 +358,7 @@ Table~\ref{tab:phase1} and Fig.~\ref{fig:multimodel} report real process-group s
|
|
| 355 |
Across every model family, \SymbioOS{} delivers large, consistent gains:
|
| 356 |
\begin{itemize}
|
| 357 |
\item On \texttt{Qwen2.5-3B} ($36~\mathrm{KB/tok}$), \SymbioFull{} cuts median TTFT from $1{,}099.4$--$1{,}265.7~\mathrm{ms}$ down to $262.6~\mathrm{ms}$ ($4.19\times$--$4.82\times$ speedup), raises interactive \texttt{pytest}/\texttt{lint} HBM hit rate from $59.5\%$--$73.8\%$ to $95.2\%$, reduces HBM waste by $3.16\times$ versus \texttt{LRU+CFS}, and boosts $\le 600~\mathrm{ms}$ SLO goodput by $3.46\times$--$4.07\times$ ($90.4$ vs.\ $22.2$--$26.1~\mathrm{resumes/min}$).
|
| 358 |
-
\item On compute-heavy \texttt{Qwen2.5-7B} ($56~\mathrm{KB/tok}$), where single-GPU dense prefill utilizes $\approx 72\%$ of MPS capacity, \SymbioSched{} lowers median TTFT by $2.22\times$--$2.47\times$ ($3{,}918$--$4{,}355~\mathrm{ms} \to 1{,}765.1~\mathrm{ms}$) and lifts interactive HBM hit rate from $33.3\%$--$42.9\%$ to $81.0\%$,
|
| 359 |
\item On sparse MoE \texttt{OLMoE-1B-7B} ($128~\mathrm{KB/tok}$), fast $1\mathrm{B}$-active expert compute paired with $3.56\times$ larger MHA KV caches creates ideal conditions for both closed-loop tiering and idle-slack streaming: \SymbioFull{} slashes median TTFT by $3.48\times$--$3.82\times$ ($2{,}021.5$--$2{,}216.3~\mathrm{ms} \to 580.9~\mathrm{ms}$), raises interactive hit rate to $88.1\%$ ($90.5\%$ in \SymbioSched{}), cuts HBM waste from $7{,}671.7$ to $2{,}827.3~\mathrm{MB}\cdot\mathrm{s}$, lifts raw cluster goodput by $+21.6\%$ ($55.88$ vs.\ $45.95~\mathrm{ep/min}$), and increases strict-SLO goodput by $4.8\times$--$5.7\times$ ($57.6$ vs.\ $10.1$--$11.9~\mathrm{resumes/min}$).
|
| 360 |
\end{itemize}
|
| 361 |
|
|
@@ -363,10 +366,11 @@ Across every model family, \SymbioOS{} delivers large, consistent gains:
|
|
| 363 |
\centering
|
| 364 |
\caption{Per-Archetype Mechanism Dissection on \texttt{Qwen2.5-3B} (Real \texttt{pytest}, \texttt{clang++}, and \texttt{git} Process Groups)}
|
| 365 |
\label{tab:archetype}
|
| 366 |
-
\
|
|
|
|
| 367 |
\begin{tabular}{llrrr}
|
| 368 |
\toprule
|
| 369 |
-
\textbf{Tool Class} & \textbf{Policy} & \textbf{
|
| 370 |
\midrule
|
| 371 |
\multirow{3}{*}{\texttt{pytest\_suite}}
|
| 372 |
& \texttt{LRU + CFS} & 2.14 & 50.0\% & 1048.5 \\
|
|
@@ -430,8 +434,10 @@ Fig.~\ref{fig:ablation}(b) sweeps the Theorem~\ref{thm:jit} JIT safety margin $\
|
|
| 430 |
\label{fig:scaleout}
|
| 431 |
\end{figure*}
|
| 432 |
|
| 433 |
-
\subsection{Phase 2: Cluster Scale-Out ($N = 32..256$) and
|
| 434 |
-
|
|
|
|
|
|
|
| 435 |
|
| 436 |
% ============================================================================
|
| 437 |
\section{Related Work}\label{sec:related}
|
|
@@ -447,7 +453,7 @@ Table~\ref{tab:scaleout} and Fig.~\ref{fig:scaleout} evaluate cluster scale-out
|
|
| 447 |
\section{Discussion, Limitations, and Conclusion}\label{sec:conclusion}
|
| 448 |
% ============================================================================
|
| 449 |
|
| 450 |
-
\emph{Scope and Limitations:} First,
|
| 451 |
|
| 452 |
\emph{Conclusion:} Treating host OS sandbox scheduling and GPU KV memory tiering as independent problems causes severe TTL cliff evictions, stalled-cache HBM waste, and redundant post-exit prefill bottlenecks on multi-tenant coding-agent servers. \SymbioOS{} unifies rootless POSIX process-group scheduling, unstopped-quantum pipe filtration, KV-weighted Gittins CPU prioritization, optimal-stopping JIT promotion, and lookback-guarded $256$-token streaming \texttt{stdout} micro-prefill. Across $2{,}168$ real local tool-execution and MPS GPU resume cycles spanning \texttt{Qwen2.5-3B}, \texttt{Qwen2.5-7B}, and \texttt{OLMoE-1B-7B} alongside $256$-sandbox cluster simulations, \SymbioOS{} cuts median post-tool TTFT by up to $4.8\times$, lifts interactive HBM hit rates up to $95.2\%$, reduces HBM waste by up to $3.9\times$, and increases strict-SLO resume goodput by up to $5.7\times$.
|
| 453 |
|
|
@@ -469,29 +475,26 @@ For causal attention equivalence, let $X = [X_{\mathrm{pre}}; X_{\mathrm{pad}}]
|
|
| 469 |
\end{IEEEproof}
|
| 470 |
|
| 471 |
\begin{IEEEproof}[Proof of Theorem~\ref{thm:gittins}]
|
| 472 |
-
Fix decision epoch $t$ with filtration $\mathcal{F}_t$ and conditional remaining CPU
|
| 473 |
\begin{equation}\label{eq:gittins_def}
|
| 474 |
\mathcal{G}_i(t) = \sup_{\Delta > 0} \frac{v_i\,\Prob\bigl(W_{\mathrm{rem},i} \le \Delta \mid \mathcal{F}_t\bigr)}{\E\bigl[\min(W_{\mathrm{rem},i},\, \Delta) \mid \mathcal{F}_t\bigr]}.
|
| 475 |
\end{equation}
|
| 476 |
-
|
| 477 |
-
\begin{equation*}
|
| 478 |
-
\frac{\int_0^\Delta h_i(x)\bar{G}_i(x)\,\mathrm{d}x}{\int_0^\Delta \bar{G}_i(x)\,\mathrm{d}x} \ge \frac{\int_0^\infty h_i(x)\bar{G}_i(x)\,\mathrm{d}x}{\int_0^\infty \bar{G}_i(x)\,\mathrm{d}x} = \frac{1}{\E[W_{\mathrm{rem},i} \mid \mathcal{F}_t]},
|
| 479 |
-
\end{equation*}
|
| 480 |
-
and under scale-family DHR laws (such as Pareto $W_{\mathrm{rem},i} \sim \mathrm{Pareto}(\alpha, s_i(t))$ with $\alpha > 1$, or deterministic white-box milestone completion $W_{\mathrm{rem},i} = \hat{W}_{\mathrm{rem},i}(t)$ where $\Delta^* = \hat{W}_{\mathrm{rem},i}(t)$ achieves the supremum directly), $\mathcal{G}_i(t)$ is a strictly monotone constant multiple of $v_i / \E[W_{\mathrm{rem},i} \mid \mathcal{F}_t] = v_i / \E[R_i(t) \mid \mathcal{F}_t] = w_i(t)$. By Gittins' optimality theorem~\cite{gittins1979bandit,aalto2009gittins}, scheduling highest $\mathcal{G}_i(t)$ minimizes $\E[\sum_{i=1}^M v_i T_{\mathrm{wall},i}]$ for $C = 1$. For $C > 1$ identical cores, Scully et al.~\cite{scully2020gittins} prove via work-decomposition coupling against a single fast $C$-speed server that top-$C$ Gittins scheduling incurs excess weighted response bounded by $(C - 1)\max_i v_i$ times residual work, vanishing relative to total queue cost in heavy traffic.
|
| 481 |
\end{IEEEproof}
|
| 482 |
|
| 483 |
\begin{IEEEproof}[Proof of Theorem~\ref{thm:jit}]
|
| 484 |
-
For part~(a), expand the conditional expectation in \eqref{eq:jit_loss} with respect to $G_{i,t}(x) = \Prob(R_i(t) \le x \mid \mathcal{F}_t)$
|
| 485 |
-
\begin{
|
| 486 |
-
\mathcal{L}_i(t) = c_{\mathrm{miss}} \int_0^{\tilde{T}
|
| 487 |
-
\
|
| 488 |
-
|
|
|
|
| 489 |
\begin{equation*}
|
| 490 |
-
-\frac{\partial \mathcal{L}_i(t)}{\partial \tilde{T}
|
| 491 |
\end{equation*}
|
| 492 |
-
|
| 493 |
|
| 494 |
-
For part~(b), let $Q_1(k)$ denote the number of post-exit sessions queued at Station~1 at resume epoch $k$. Because streaming micro-prefill
|
| 495 |
\end{IEEEproof}
|
| 496 |
|
| 497 |
\bibliographystyle{IEEEtran}
|
|
|
|
| 70 |
|
| 71 |
\IEEEtitleabstractindextext{%
|
| 72 |
\begin{abstract}
|
| 73 |
+
Autonomous software engineering agents alternate between GPU token generation and host operating system tool execution such as test suites, linters, and compiler builds. Current inference engines and host schedulers manage these two stages in isolation. When CPU contention slows an interactive test sandbox whose Key-Value cache resides in GPU High-Bandwidth Memory, open-loop time-to-live and turn-level hazard policies evict that hot cache shortly before completion while retaining caches stalled on remote sockets or locks. Furthermore, serving engines wait until process exit to prefill standard-output tokens that trickled out throughout execution. We present SymbioOS, a rootless user-space control plane that couples POSIX process-group quantum scheduling and non-blocking pipe telemetry with tiered GPU Key-Value memory management and streaming micro-prefill. SymbioOS tracks live milestone lines and unstopped silence to update residual runtime, allocates CPU quanta via a Key-Value-weighted Gittins-inspired score, demotes stalled caches early, stages evicted caches just in time, and pre-encodes standard output in 256-token chunks using a one-token byte-pair lookback guard. Across 2,168 real tool resumes spanning Qwen2.5-3B, Qwen2.5-7B, and OLMoE-1B-7B on an emulated-HBM Apple Silicon prototype plus calibrated 256-sandbox cluster sweeps, SymbioOS reduces median resume latency by up to 4.8x and raises strict-latency goodput by up to 5.7x.
|
| 74 |
\end{abstract}
|
| 75 |
|
| 76 |
\begin{IEEEkeywords}
|
|
|
|
| 102 |
|
| 103 |
Our work makes four contributions:
|
| 104 |
\begin{enumerate}
|
| 105 |
+
\item \textbf{Memory-Coupled Tandem Queueing Model and Index Analysis:} We formulate multi-tenant agent serving as a two-station memory-coupled tandem queueing network with sub-turn filtration $\mathcal{F}_t$. Under idealized static-batch and shared-shape Pareto or deterministic milestone assumptions, we establish a KV-weighted Gittins priority rule on CPU cores (Theorem~\ref{thm:gittins}), and we derive a myopic critical-fractile rule for just-in-time (JIT) KV promotion alongside a Station-1 queue-occupancy reduction bound for streaming prefill (Theorem~\ref{thm:jit}).
|
| 106 |
\item \textbf{White-Box Sub-Turn Pipe Filtration:} We design an overhead-free pipe monitor that parses live progress milestones (\texttt{[XX\%]}) and tracks \emph{unstopped-quantum silence}, separating genuine socket or lock hangs ($1.25~\mathrm{s}$ early demotion) from CPU-throttled startup imports without false evictions.
|
| 107 |
\item \textbf{Exact Streaming \texttt{stdout} Micro-Prefill:} We harvest idle GPU cycles while tools are still running to pre-encode $256$-token chunks of append-only \texttt{stdout}, using a one-token Byte-Pair Encoding (BPE) lookback guard~\cite{sennrich2016bpe} and bucketed causal attention padding to preserve exact token and logit equivalence with offline post-exit prefill (Proposition~\ref{prop:bpe}).
|
| 108 |
+
\item \textbf{Multi-Architecture Emulated-HBM Prototype and Cluster-Scale Evaluation:} Across $2{,}168$ real POSIX tool-execution and MPS GPU resume cycles on an emulated-HBM Apple Silicon workstation spanning dense Grouped-Query Attention (\texttt{Qwen2.5-3B}, \texttt{Qwen2.5-7B})~\cite{qwen2025qwen25} and sparse Mixture-of-Experts Multi-Head Attention (\texttt{OLMoE-1B-7B})~\cite{muennighoff2025olmoe} with real \texttt{pytest}, \texttt{clang++}, and \texttt{git} process groups, plus hardware-calibrated discrete-event sweeps up to $N = 256$ sandboxes, \SymbioOS{} cuts median post-tool TTFT by $2.2\times$ to $4.8\times$, lifts interactive HBM hit rates to $81.0\%$--$95.2\%$, reduces HBM waste by up to $3.9\times$, and boosts strict-SLO goodput by $2.6\times$ to $5.7\times$. We also identify and resolve a high-GPU-utilization streaming regression on \texttt{Qwen2.5-7B} via a utilization-aware streaming gate.
|
| 109 |
\end{enumerate}
|
| 110 |
|
| 111 |
The remainder of this paper is organized as follows. Section~\ref{sec:motivation} characterizes multi-turn agent KV footprints and open-loop $t = 0$ failure modes. Section~\ref{sec:theory} develops the memory-coupled tandem queueing model, BPE lookback invariance, and Theorems~\ref{thm:gittins}--\ref{thm:jit}. Section~\ref{sec:design} details the rootless POSIX scheduler, decoupled cold-tier DMA engine, and streaming micro-prefill pipeline. Section~\ref{sec:eval} presents multi-architecture hardware and cluster-scale evaluations, Section~\ref{sec:related} surveys prior work, and Section~\ref{sec:conclusion} discusses scope, limitations, and conclusions.
|
|
|
|
| 148 |
Given $\mathcal{F}_t$, the filtered residual CPU work is $\hat{W}_{\mathrm{rem},i}(t) = \E[W_i - u_i(t) \mid \mathcal{F}_t]$: once milestones arrive ($p_i(t) \ge p_{\min}$), the empirical work-rate estimator yields $\hat{W}_{\mathrm{rem},i}(t) = u_i(t)(1 - p_i(t))/p_i(t)$, smoothly backed off to class prior $\mu_0(x_i) - u_i(t)$ for $p_i(t) < p_{\min}$, while $\sigma_i(t) \ge \tau_{\mathrm{stall}}$ raises the stall indicator $\hat{I}_{\mathrm{stall},i}(t) = 1$. Mapping $\hat{W}_{\mathrm{rem},i}(t)$ through expected core share gives conditional remaining wall-clock time $\hat{R}_i(t) = \E[R_i(t) \mid \mathcal{F}_t]$.
|
| 149 |
|
| 150 |
\subsection{Exactness of Lookback-Guarded Streaming Micro-Prefill}
|
| 151 |
+
Let $\Sigma^*$ denote the byte stream emitted on \texttt{stdout}, decoded incrementally (holding incomplete trailing multi-byte UTF-8 sequences across \texttt{read()} boundaries via a stateful incremental decoder) and tokenized by a deterministic BPE/regex tokenizer $\mathcal{T}: \Sigma^* \to \mathcal{V}^*$ whose pre-tokenization pattern merges characters only within bounded lexical spans~\cite{sennrich2016bpe}. Suppose at intermediate time $t < t_{\mathrm{exit}}$, buffer $Y(t)$ is a prefix of the final stream $Y(t_{\mathrm{exit}}) = Y(t) \Vert Z$.
|
| 152 |
|
| 153 |
\begin{proposition}[One-Token BPE Lookback Prefix Invariance]\label{prop:bpe}
|
| 154 |
Suppose every pre-tokenizer regex token boundary in $\mathcal{T}$ is finalized once at least one subsequent token starts (holding for newline-flushed log streams under \texttt{Qwen2.5} and \texttt{GPT-NeoX} pre-tokenizers). Define the lookback-guarded token sequence $\mathcal{T}_{\mathrm{safe}}(Y(t)) := \mathcal{T}(Y(t))_{1 : |\mathcal{T}(Y(t))|-1}$ for $|\mathcal{T}(Y(t))| \ge 2$. Then for every prefix $Y(t)$ of $Y(t_{\mathrm{exit}})$, $\mathcal{T}_{\mathrm{safe}}(Y(t))$ is an exact token-ID prefix of $\mathcal{T}(Y(t_{\mathrm{exit}}))$. Furthermore, under strictly lower-triangular causal self-attention with right-padded bucket length $B \ge m$ followed by cache crop $\mathrm{crop}(-(B - m))$, incremental $B_{\mathrm{chunk}}$-token prefill produces KV states and final-token logits identical to single-pass post-exit prefill in exact arithmetic (and bit-identical per bucket step in IEEE~754 \texttt{FP16}).
|
| 155 |
\end{proposition}
|
| 156 |
|
| 157 |
+
\subsection{Idealized Queueing Guarantees and Operational Heuristics}
|
| 158 |
+
Consider an idealized static batch of $M$ runnable CPU-bound sandboxes competing for $C < M$ identical cores, where each sandbox $i$ carries a fixed, time-invariant HBM opportunity weight $v_i = \gamma_{\mathrm{res},i} S_i C_{\mathrm{rel}}(S_i) > 0$.
|
| 159 |
|
| 160 |
+
\begin{theorem}[Idealized KV-Weighted Gittins Priority]\label{thm:gittins}
|
| 161 |
+
Let runnable sandboxes $i \in \{1,\dots,M\}$ in a static batch have fixed weights $v_i > 0$ and independent conditional remaining CPU requirements $W_{\mathrm{rem},i} \mid \mathcal{F}_t$ satisfying either (i)~deterministic milestone-revealed remaining work $W_{\mathrm{rem},i} = \hat{W}_{\mathrm{rem},i}(t)$, or (ii)~shared-shape Pareto distributions $\bar{F}_{W_{\mathrm{rem},i}}(w) = (s_i(t)/w)^\alpha$ with common exponent $\alpha > 1$ across all jobs. On a single CPU-bound core ($C = 1$, where wall-clock completion equals cumulative CPU work), preemptively scheduling at every instant $t$ the sandbox maximizing
|
| 162 |
\begin{equation}\label{eq:gittins}
|
| 163 |
+
w_i^{\mathrm{ideal}}(t) = \frac{v_i}{\E[W_{\mathrm{rem},i} \mid \mathcal{F}_t]}
|
| 164 |
\end{equation}
|
| 165 |
+
minimizes $\E\bigl[\sum_{i=1}^M v_i T_{\mathrm{cpu},i}\bigr]$ among all non-clairvoyant $\mathcal{F}_t$-adapted policies. On $C > 1$ identical cores, selecting the top-$C$ sandboxes by $w_i^{\mathrm{ideal}}(t)$ achieves expected weighted response within an additive $(C - 1)\max_i v_i$-scaled residual bound of the clairvoyant multi-core optimum~\cite{aalto2009gittins,scully2020gittins}.
|
| 166 |
\end{theorem}
|
| 167 |
|
| 168 |
+
Next, consider an evicted sandbox ($r_i(t) = 0$) whose filtered remaining time $R_i(t) \mid \mathcal{F}_t$ has cumulative distribution $G_{i,t}(x) = \Prob(R_i(t) \le x \mid \mathcal{F}_t)$ and drifts at local unit rate ($\mathrm{d}R_i/\mathrm{d}t = -1$) between milestones. Initiating asynchronous cold-tier promotion at time $t$ with effective transfer window $\tilde{T}_{d,i} = T_{\mathrm{dma},i} + \delta_{\mathrm{jit}}$ (where $T_{\mathrm{dma},i} = S_i / B_{\mathrm{dma}}$ and $\delta_{\mathrm{jit}} \ge 0$ is a safety margin) incurs unit HBM holding shadow price $\lambda_{\mathrm{hbm}} > 0$ per byte-second if promotion completes early, versus unit tail-latency penalty $c_{\mathrm{miss}} > \lambda_{\mathrm{hbm}} S_i$ per second of unmasked post-exit wait.
|
| 169 |
|
| 170 |
+
\begin{theorem}[Myopic Critical-Fractile JIT Rule and Station-1 Stability]\label{thm:jit}
|
| 171 |
+
(a) Under locally unit-rate drift of $R_i(t) \mid \mathcal{F}_t$ ($G_{i,t}$ non-decreasing in $t$), the myopic single-turn newsvendor staging loss
|
| 172 |
+
\begin{multline}\label{eq:jit_loss}
|
| 173 |
+
\mathcal{L}_i(t) = c_{\mathrm{miss}}\,\E\bigl[(\tilde{T}_{d,i} - R_i(t))_+ \mid \mathcal{F}_t\bigr] \\
|
| 174 |
+
+ \lambda_{\mathrm{hbm}} S_i\,\E\bigl[(R_i(t) - \tilde{T}_{d,i})_+ \mid \mathcal{F}_t\bigr]
|
| 175 |
+
\end{multline}
|
| 176 |
+
is minimized by staging at the first epoch satisfying the critical-fractile boundary
|
| 177 |
\begin{equation}\label{eq:jit_thresh}
|
| 178 |
\Prob\bigl(R_i(t) \le T_{\mathrm{dma},i} + \delta_{\mathrm{jit}} \;\big|\; \mathcal{F}_t\bigr) \ge \frac{c_{\mathrm{miss}}}{c_{\mathrm{miss}} + \lambda_{\mathrm{hbm}} S_i} =: 1 - \eta^*.
|
| 179 |
\end{equation}
|
| 180 |
+
(b) At Station~1 under an M/G/1 queueing approximation with arrival rate $\lambda_{\mathrm{res}}$, mean \texttt{stdout} length $L_{\mathrm{out}}$, streamed fraction $f_{\mathrm{stream}} \in [0, 1)$, and prefill rate $\mu_{\mathrm{pf}}$, idle-slack micro-prefill changes mean post-exit service occupancy from $\bar{\tau}_1(0) = \bar{T}_{\mathrm{cold}} + L_{\mathrm{out}}/\mu_{\mathrm{pf}} + \tau_{\mathrm{dec}}$ to $\bar{\tau}_1(f_{\mathrm{stream}}) = \bar{T}_{\mathrm{cold}} + (1 - f_{\mathrm{stream}})L_{\mathrm{out}}/\mu_{\mathrm{pf}} + \tau_{\mathrm{dec}} + \bar{\xi}_{\mathrm{res}}$, where $\bar{\xi}_{\mathrm{res}} \le B_{\mathrm{chunk}}/\mu_{\mathrm{pf}}$ is the expected residual non-preemptive chunk blocking time when an exited turn arrives mid-chunk. Whenever $f_{\mathrm{stream}} L_{\mathrm{out}}/\mu_{\mathrm{pf}} > \bar{\xi}_{\mathrm{res}}$, streaming strictly enlarges the Station-1 Lyapunov-stable region~\cite{neely2010stochastic} $\lambda_{\mathrm{res}} \bar{\tau}_1(f_{\mathrm{stream}}) < 1$ and reduces Little's Law HBM buffer pinning $\bar{M}_{\mathrm{wait}} = \lambda_{\mathrm{res}} \bar{S}\,\E[W_{\mathrm{gpu}}]$.
|
| 181 |
\end{theorem}
|
| 182 |
|
| 183 |
+
Theorems~\ref{thm:gittins} and~\ref{thm:jit} motivate our operational heuristics in Section~\ref{sec:design}, which adapt to time-varying $v_i(t)$, heterogeneous tool classes, and point-estimate JIT triggers. Formal proofs appear in Appendix~\ref{app:proofs}.
|
| 184 |
|
| 185 |
% ============================================================================
|
| 186 |
\section{SymbioOS Design and Rootless Implementation}\label{sec:design}
|
|
|
|
| 189 |
\subsection{Rootless POSIX Process-Group Quantum Scheduler}
|
| 190 |
Production CI clusters, Slurm compute nodes, and unprivileged container runtimes restrict root capabilities (\texttt{CAP\_SYS\_ADMIN}, \texttt{CAP\_BPF}), preventing user-level serving frameworks from loading custom kernel eBPF schedulers~\cite{zheng2026agentcgroup}. \SymbioOS{} implements its host scheduler purely in user space via POSIX process groups, depicted in Fig.~\ref{fig:arch}(b). Every tool invocation spawns in a dedicated session (\texttt{start\_new\_session=True} / \texttt{setsid()}), assigning the top-level driver and all descendant processes (such as \texttt{pytest} workers, \texttt{git} helpers, and \texttt{clang++} compiler frontends and backends) a shared process-group identifier $\mathrm{pgid}_i$.
|
| 191 |
|
| 192 |
+
A dedicated scheduler thread wakes at a fixed quantum $\Delta t = 80~\mathrm{ms}$ ($12.5~\mathrm{Hz}$), chosen large enough to amortize L2 cache warm-up and signal delivery while maintaining sub-$100~\mathrm{ms}$ responsiveness. On each tick, the thread drains all non-blocking \texttt{stdout} descriptors (\texttt{O\_NONBLOCK}, $64~\mathrm{KB}$ reads), updates $\mathbf{z}_i(t)$ in \eqref{eq:telemetry}, excludes I/O-sleeping sandboxes from CPU slot contention, and computes an operational Gittins-inspired heuristic adapting \eqref{eq:gittins} to dynamic HBM residency and starvation aging:
|
| 193 |
\begin{equation}\label{eq:impl_score}
|
| 194 |
\tilde{w}_i(t) = \psi_i \left(\frac{\gamma_{\mathrm{res},i}\, S_i \cdot (S_i / B_{\mathrm{dma}})}{\max(\hat{R}_i(t),\, \tau_{\min})} + \beta_{\mathrm{age}}\,\omega_{\mathrm{wait},i}(t)\right),
|
| 195 |
\end{equation}
|
| 196 |
+
where $\gamma_{\mathrm{res},i} = 2.6$ when $r_i(t) = 1$ (or JIT promotion is in flight) versus $0.12$ when evicted on disk (a $21.7\times$ residency boost to rescue hot HBM suites from contention cliffs), $\psi_i = 1.15$ for non-terminal turns to prevent multi-turn stragglers, and $\omega_{\mathrm{wait},i}(t) = \max(0,\, (t - t_{0,i}) - u_i(t))$ is cumulative CPU wait time with starvation-prevention slope $\beta_{\mathrm{age}} = 0.35$. The top-$C$ runnable sandboxes receive \texttt{killpg($\mathrm{pgid}_i$, SIGCONT)}, while remaining runnable sandboxes receive \texttt{killpg($\mathrm{pgid}_i$, SIGSTOP)}. Note that while \texttt{SIGSTOP} cannot be caught, a descendant process that explicitly invokes \texttt{setsid()} or \texttt{setpgid()} escapes $\mathrm{pgid}_i$ (unlike kernel \texttt{cgroup v2} tracking). On bare-metal Linux 6.12+ nodes with root privileges, \eqref{eq:impl_score} can map onto \texttt{cgroup v2} \texttt{cpu.weight} or \texttt{sched\_ext} dispatch queues as an unimplemented future kernel fast path.
|
| 197 |
|
| 198 |
\subsection{Decoupled Cold-Tier DMA and Closed-Loop Tiering}
|
| 199 |
Evicted KV caches serialize layerwise key and value tensors to solid-state files configured with uncached file I/O (\texttt{fcntl(fd, F\_NOCACHE, 1)} on Darwin; \texttt{O\_DIRECT} on Linux) to bypass unified host page caches. During Phase~1 profiling on $128~\mathrm{KB/tok}$ \texttt{OLMoE-1B-7B} sessions ($250$--$380~\mathrm{MB}$ per cache), sharing a single FIFO queue between background eviction flushes and urgent cold-miss reads caused severe write-behind head-of-line blocking. \SymbioOS{} therefore separates cold-tier storage into two channels: a background writeback thread that flushes evicted CPU staging buffers asynchronously to disk, and a dedicated high-priority read DMA queue that services reactive reloads and speculative JIT promotions in strict priority order while enforcing single-lane PCIe/NVMe transfer bandwidth $B_{\mathrm{dma}}$.
|
| 200 |
|
| 201 |
Closed-loop tiering executes three coordinated rules on every control tick:
|
| 202 |
\begin{enumerate}
|
| 203 |
+
\item \emph{Early Stall and Long-Build Demotion:} Whenever $\hat{I}_{\mathrm{stall},i}(t) = 1$ ($\sigma_i(t) \ge 1.25~\mathrm{s}$ with $p_i(t) < 0.05$, chosen safely above \texttt{pytest}'s $\approx 0.25~\mathrm{s}$ plugin-import silence), or when a \texttt{build}-class sandbox satisfies $\hat{R}_i(t) > 2.6~\mathrm{s}$ under HBM utilization exceeding $65\%$, \SymbioOS{} immediately demotes $KV_i$ to cold storage rather than waiting for TTL expiration.
|
| 204 |
+
\item \emph{Point-Estimate JIT Promotion:} Approximating \eqref{eq:jit_thresh} in deterministic form, when an evicted non-stalled sandbox reaches $p_i(t) \ge 0.60$ and $\hat{R}_i(t) \le T_{\mathrm{dma},i} + \delta_{\mathrm{jit}}$, \SymbioOS{} enqueues a speculative JIT load provided free plus demotable HBM bytes cover $S_i$. Upon DMA completion, if the tool is still running, \SymbioOS{} materializes $KV_i$ onto the GPU only if any displaced victim $j$ carries strictly smaller index $\tilde{w}_j(t) < \tilde{w}_i(t)$, preventing speculative thrashing.
|
| 205 |
\item \emph{Work-Conserving Non-Blocking GPU Dispatch:} Exited sandboxes whose KV caches missed HBM enqueue cold reloads immediately at $t_{\mathrm{exit},i}$ without stalling the GPU; meanwhile, the GPU engine serves ready HBM-resident waiting sessions in FIFO order of $t_{\mathrm{exit}}$.
|
| 206 |
\end{enumerate}
|
| 207 |
|
|
|
|
| 247 |
% ============================================================================
|
| 248 |
|
| 249 |
\subsection{Experimental Methodology and Baselines}
|
| 250 |
+
All hardware experiments execute locally on an \emph{emulated-HBM Apple Silicon prototype}: an Apple M5 Pro workstation ($15$ CPU cores, $48~\mathrm{GB}$ unified memory, macOS Darwin $25.6.0$) running PyTorch $2.15.0$ (\texttt{mps}, \texttt{FP16}) and HuggingFace \texttt{transformers} $5.22.1$ under \texttt{caffeinate} power-state locking. Because unified memory shares physical DRAM between CPU and GPU without a physical PCIe bus, we emulate discrete-GPU HBM capacity limits via strict software-enforced $M_{\mathrm{HBM}}$ byte budgets ($290$--$1{,}140~\mathrm{MB}$) and emulate PCIe/NVMe cold-tier contention via uncached \texttt{F\_NOCACHE} \texttt{.pt} disk serialization paced at single-lane bandwidth $B_{\mathrm{dma}}$. To evaluate generalization across attention and parameter architectures, we benchmark three locally cached open-weight models:
|
| 251 |
\begin{itemize}
|
| 252 |
\item \textbf{\texttt{Qwen2.5-3B-Instruct}}~\cite{qwen2025qwen25}: $36$-layer dense Grouped-Query Attention ($8{:}1$ GQA), $36.0~\mathrm{KB/tok}$ KV footprint;
|
| 253 |
\item \textbf{\texttt{Qwen2.5-7B-Instruct}}~\cite{qwen2025qwen25}: $28$-layer dense GQA ($7{:}1$), $56.0~\mathrm{KB/tok}$ KV footprint;
|
|
|
|
| 263 |
\item \textbf{\SymbioFull{}:} \SymbioSched{} augmented with idle-slack $256$-token lookback-guarded streaming \texttt{stdout} micro-prefill.
|
| 264 |
\end{enumerate}
|
| 265 |
|
| 266 |
+
Across Phase~0 ($1{,}080$ controlled heavy-tailed POSIX subprocess resumes across three seeds $[42, 137, 2026]$, using $\delta_{\mathrm{jit}} = 0.55~\mathrm{s}$ and stratified tool mix $19\%$ \texttt{quick\_lint} $[0.30$--$0.44~\mathrm{s}]$, $47\%$ \texttt{pytest\_suite} $[1.75$--$2.25~\mathrm{s}]$, $19\%$ \texttt{heavy\_compile} $[4.60$--$5.40~\mathrm{s}]$, and $15\%$ \texttt{stalled\_io} $[0.25$--$0.34~\mathrm{s}$ CPU $+ 4.70$--$5.40~\mathrm{s}$ pipe stall$]$; closed-pool inter-arrival $0.12~\mathrm{s}$, burst-wave $0.08$--$0.20~\mathrm{s}$) and Phase~1 ($960$ multi-model resumes across two seeds $[42, 137]$ with $\delta_{\mathrm{jit}} = 0.50~\mathrm{s}$, $B_{\mathrm{dma}} \in \{160, 250, 560\}~\mathrm{MB/s}$ for \texttt{3B}/\texttt{7B}/\texttt{OLMoE}, and $6/15/6/5$ turn split, plus $128$ chunk-ablation resumes $= 1{,}088$ real \texttt{pytest~9.2.0}, \texttt{clang++ -O3 -std=c++20 -c}, and \texttt{git} process-group resumes), our prototype campaign totals $2{,}168$ real POSIX tool-execution and MPS GPU resume cycles, complemented by Phase~2 cluster-scale simulations up to $N = 256$ sandboxes. In Phase~1, \texttt{pytest} emits native \texttt{[XX\%]} test-progress lines, whereas our driver wraps multi-unit \texttt{clang++ -O3 -c} and \texttt{py\_compile}/\texttt{git} steps to emit \texttt{[XX\%]} milestones per completed translation unit or module (modeling CMake/Ninja progress; uninstrumented binaries fall back to byte-velocity and silence tracking).
|
| 267 |
|
| 268 |
\subsection{Streaming Causality and Numerical Equivalence}
|
| 269 |
+
Before multi-tenant benchmarking, we verified Proposition~\ref{prop:bpe} on live \texttt{pytest} streams ($1{,}044$--$1{,}368$ \texttt{stdout} tokens, $4$--$5$ live $256$-token chunks plus $26$--$94$ EOF tail tokens) on \texttt{Qwen2.5-3B} (\texttt{mps}, \texttt{FP16}). One-token BPE lookback produced $100\%$ exact token-ID match against full post-exit tokenization, exact bit-identical \texttt{FP16} final-position logits ($0.0$ max absolute difference under bucketed causal padding, with \texttt{FP32} cosine reduction $0.999997$ due to $151\mathrm{K}$-dim dot-product rounding), $100\%$ exact $8$-token greedy continuation agreement, and an isolated post-\texttt{exit(0)} prefill latency reduction from $457.9~\mathrm{ms}$ to $57.4~\mathrm{ms}$ ($7.98\times$ speedup).
|
| 270 |
|
| 271 |
\begin{table*}[!t]
|
| 272 |
\centering
|
| 273 |
+
\caption{Phase 0 Controlled Heavy-Tailed Benchmark on \texttt{Qwen2.5-3B-Instruct} (\texttt{FP16} MPS, $C = 4$ CPU Cores, $3$ Seeds, $1{,}080$ Resumes; Multi-Seed $\pm\sigma$ in Text)}
|
| 274 |
\label{tab:phase0}
|
| 275 |
+
\scriptsize
|
| 276 |
+
\setlength{\tabcolsep}{2.6pt}
|
| 277 |
\begin{tabular}{llrrrrrrrrr}
|
| 278 |
\toprule
|
| 279 |
+
\textbf{Regime} & \textbf{Policy} & \textbf{P50} & \textbf{P95} & \textbf{P99} & \textbf{Cold} & \textbf{Hit} & \textbf{Int.\ Hit} & \textbf{Waste} & \textbf{JCT} & \textbf{SLO} \\
|
| 280 |
& & \textbf{(ms)} & \textbf{(ms)} & \textbf{(ms)} & \textbf{(ms)} & \textbf{(\%)} & \textbf{(\%)} & \textbf{(MB$\cdot$s)} & \textbf{(s)} & \textbf{($\le 500$ms/m)} \\
|
| 281 |
\midrule
|
| 282 |
\multirow{5}{*}{\shortstack[l]{Closed Pool\\($K{=}12$, $600$ res.,\\$M_{\mathrm{HBM}}{=}290$MB)}}
|
|
|
|
| 306 |
\subsection{Phase 0: Controlled Multi-Regime Analysis and Tandem Synergy}
|
| 307 |
Table~\ref{tab:phase0} and Fig.~\ref{fig:phase0} evaluate all five policies under two complementary load patterns on \texttt{Qwen2.5-3B-Instruct} ($B_{\mathrm{dma}} = 160~\mathrm{MB/s}$, equivalent to $1.6~\mathrm{GB/s}$ contended NVMe-to-PCIe bandwidth at $32\mathrm{B}$ KV scale): a closed concurrency pool ($K = 12$ active container slots draining $20$ two-turn episodes per seed, $M_{\mathrm{HBM}} = 290~\mathrm{MB}$) and a $16$-session concurrent burst wave ($M_{\mathrm{HBM}} = 380~\mathrm{MB}$).
|
| 308 |
|
| 309 |
+
Three empirical phenomena stand out. First, \Continuum{} suffers severe TTL cliff misses in both regimes ($15.8\%$ and $17.7\%$ overall HBM hit rates, dropping below reactive \texttt{LRU+CFS} at $18.3\%$ and $29.2\%$). Although \Continuum{}'s scalar TTL is calibrated to $2.0\times$ solo \texttt{pytest} duration ($4.1~\mathrm{s}$ in Phase~0; $3.7~\mathrm{s}$ in Phase~1), $3{:}1$--$4{:}1$ fair-share CPU contention stretches $2.0~\mathrm{s}$ \texttt{pytest} suites past $4.0$--$4.3~\mathrm{s}$ while disguised \texttt{stalled\_io} waits stay pinned in HBM across the entire TTL ($2{,}681.0~\mathrm{MB}\cdot\mathrm{s}$ waste in burst waves); raising the scalar TTL further would only worsen stalled-cache waste. Across the three Phase~0 closed-pool seeds, \SymbioFull{} also lowers per-seed variance dramatically: mean per-seed P50 TTFT is $708.0 \pm 30.1~\mathrm{ms}$ ($50.8 \pm 1.4\%$ HBM hit, $13.05 \pm 0.72~\mathrm{s}$ JCT) versus $2{,}999.4 \pm 1{,}666.8~\mathrm{ms}$ ($18.3 \pm 8.0\%$) for \texttt{LRU+CFS} and $2{,}513.0 \pm 685.8~\mathrm{ms}$ ($15.8 \pm 7.2\%$) for \Continuum{}. Second, closing the OS-to-KV loop in \SymbioSched{} cuts burst-wave HBM waste by $2.8\times$--$3.6\times$ (to $739.8~\mathrm{MB}\cdot\mathrm{s}$), raises interactive hit rate from $27.0\%$--$44.4\%$ to $79.4\%$, and lowers median TTFT from $2{,}394$--$3{,}319~\mathrm{ms}$ to $888.5~\mathrm{ms}$ ($919.9 \pm 355.3~\mathrm{ms}$ per seed vs.\ $744.5 \pm 227.6~\mathrm{ms}$ for \SymbioFull{}).
|
| 310 |
|
| 311 |
Third, comparing \SymbioFull{} against \SymbioSched{} validates Theorem~\ref{thm:jit}(b)'s second-order tandem-queue coupling. In the tight $290~\mathrm{MB}$ closed-pool regime, Turn-2 KV caches grow to $82$--$92~\mathrm{MB}$; under \SymbioSched{}, three simultaneously exiting sessions occupy $255~\mathrm{MB}$ of HBM while waiting sequentially to prefill $1{,}050$ unstreamed \texttt{stdout} tokens, causing temporary HBM head-of-line backpressure ($\mathrm{P95} = 8{,}527~\mathrm{ms}$). By pre-encoding $89$ chunks of $256$ tokens during idle GPU slack, \SymbioFull{} drains waiting GPU sessions $1.7\times$ faster ($299.0~\mathrm{ms}$ vs.\ $505.0~\mathrm{ms}$ post-exit GPU service), cutting mean GPU queue wait by $4.2\times$ ($992.2 \to 235.5~\mathrm{ms}$), lifting HBM hit rate further from $42.5\%$ to $50.8\%$ ($59.4\% \to 64.6\%$ in burst waves), collapsing closed-pool P50 TTFT to $682.1~\mathrm{ms}$ ($3.6\times$--$3.7\times$ faster than baselines), raising raw cluster goodput from $34.89$ to $41.09~\mathrm{ep/min}$ ($+17.8\%$), and boosting strict $\le 500~\mathrm{ms}$ SLO goodput by $4.4\times$--$5.8\times$ ($32.9$ vs.\ $5.7$--$7.5~\mathrm{resumes/min}$).
|
| 312 |
|
|
|
|
| 314 |
\centering
|
| 315 |
\caption{Phase 1 Real Developer-Tool Process Groups (\texttt{pytest 9.2}, \texttt{clang++ -O3}, \texttt{git}) Across Three LLM Architectures ($K{=}10$, $C{=}3$ Cores)}
|
| 316 |
\label{tab:phase1}
|
| 317 |
+
\scriptsize
|
| 318 |
+
\setlength{\tabcolsep}{2.2pt}
|
| 319 |
\begin{tabular}{llrrrrrrrrr}
|
| 320 |
\toprule
|
| 321 |
+
\textbf{Model (\texttt{FP16})} & \textbf{Policy} & \textbf{P50} & \textbf{P95} & \textbf{Cold} & \textbf{EOF} & \textbf{Hit} & \textbf{Int.\ Hit} & \textbf{Waste} & \textbf{JCT} & \textbf{SLO} \\
|
| 322 |
+
& & \textbf{(ms)} & \textbf{(ms)} & \textbf{(ms)} & \textbf{(ms)} & \textbf{(\%)} & \textbf{(\%)} & \textbf{(MB$\cdot$s)} & \textbf{(s)} & \textbf{($\le 600$ms/m)} \\
|
| 323 |
\midrule
|
| 324 |
\multirow{5}{*}{\shortstack[l]{\texttt{Qwen2.5-3B}\\Dense GQA ($36$ KB/tok)\\$M_{\mathrm{HBM}}{=}320$MB}}
|
| 325 |
& \texttt{LRU + CFS} & 1209.6 & 1973.2 & 444.2 & 242.7 & 43.8\% & 64.3\% & 2199.1 & 8.70 & 26.1 \\
|
|
|
|
| 358 |
Across every model family, \SymbioOS{} delivers large, consistent gains:
|
| 359 |
\begin{itemize}
|
| 360 |
\item On \texttt{Qwen2.5-3B} ($36~\mathrm{KB/tok}$), \SymbioFull{} cuts median TTFT from $1{,}099.4$--$1{,}265.7~\mathrm{ms}$ down to $262.6~\mathrm{ms}$ ($4.19\times$--$4.82\times$ speedup), raises interactive \texttt{pytest}/\texttt{lint} HBM hit rate from $59.5\%$--$73.8\%$ to $95.2\%$, reduces HBM waste by $3.16\times$ versus \texttt{LRU+CFS}, and boosts $\le 600~\mathrm{ms}$ SLO goodput by $3.46\times$--$4.07\times$ ($90.4$ vs.\ $22.2$--$26.1~\mathrm{resumes/min}$).
|
| 361 |
+
\item On compute-heavy \texttt{Qwen2.5-7B} ($56~\mathrm{KB/tok}$), where single-GPU dense prefill utilizes $\approx 72\%$ of MPS capacity, \SymbioSched{} lowers median TTFT by $2.22\times$--$2.47\times$ ($3{,}918$--$4{,}355~\mathrm{ms} \to 1{,}765.1~\mathrm{ms}$; per-seed P50s $[1{,}596.9, 2{,}184.9]~\mathrm{ms}$) and lifts interactive HBM hit rate from $33.3\%$--$42.9\%$ to $81.0\%$. Notably, \emph{ungated} \SymbioFull{} regresses on \texttt{7B} relative to \SymbioSched{} ($2{,}210.5$ vs.\ $1{,}765.1~\mathrm{ms}$ P50, $+25.2\%$; $50.0\%$ vs.\ $54.7\%$ HBM hit rate), even though it still achieves the fastest JCT ($12.67~\mathrm{s}$) and highest goodput ($38.55~\mathrm{ep/min}$). As predicted by Theorem~\ref{thm:jit}(b), when $\mu_{\mathrm{pf}}$ is saturated on \texttt{7B}, a non-preemptive $256$-token streaming chunk holds the GPU for $\approx 160~\mathrm{ms}$ ($\bar{\xi}_{\mathrm{res}}$ blocking newly exited turns) while reserving $14.3~\mathrm{MB}$ of HBM early and triggering extra evictions. To validate this diagnosis, we tested a utilization-gated variant (\texttt{gpu\_busy\_ewma} $< 0.55$, HBM $< 85\%$, $B_{\mathrm{chunk}} = 128$) on \texttt{Qwen2.5-7B} across seeds $[42, 137]$: gating reduced P95 TTFT from $5{,}276.8~\mathrm{ms}$ (ungated) and $5{,}053.8~\mathrm{ms}$ (\SymbioSched{}) down to $4{,}562.8~\mathrm{ms}$ ($-13.5\%$) with fastest mean JCT ($11.46~\mathrm{s}$).
|
| 362 |
\item On sparse MoE \texttt{OLMoE-1B-7B} ($128~\mathrm{KB/tok}$), fast $1\mathrm{B}$-active expert compute paired with $3.56\times$ larger MHA KV caches creates ideal conditions for both closed-loop tiering and idle-slack streaming: \SymbioFull{} slashes median TTFT by $3.48\times$--$3.82\times$ ($2{,}021.5$--$2{,}216.3~\mathrm{ms} \to 580.9~\mathrm{ms}$), raises interactive hit rate to $88.1\%$ ($90.5\%$ in \SymbioSched{}), cuts HBM waste from $7{,}671.7$ to $2{,}827.3~\mathrm{MB}\cdot\mathrm{s}$, lifts raw cluster goodput by $+21.6\%$ ($55.88$ vs.\ $45.95~\mathrm{ep/min}$), and increases strict-SLO goodput by $4.8\times$--$5.7\times$ ($57.6$ vs.\ $10.1$--$11.9~\mathrm{resumes/min}$).
|
| 363 |
\end{itemize}
|
| 364 |
|
|
|
|
| 366 |
\centering
|
| 367 |
\caption{Per-Archetype Mechanism Dissection on \texttt{Qwen2.5-3B} (Real \texttt{pytest}, \texttt{clang++}, and \texttt{git} Process Groups)}
|
| 368 |
\label{tab:archetype}
|
| 369 |
+
\footnotesize
|
| 370 |
+
\setlength{\tabcolsep}{2.6pt}
|
| 371 |
\begin{tabular}{llrrr}
|
| 372 |
\toprule
|
| 373 |
+
\textbf{Tool Class} & \textbf{Policy} & \textbf{Wall (s)} & \textbf{Hit (\%)} & \textbf{TTFT (ms)} \\
|
| 374 |
\midrule
|
| 375 |
\multirow{3}{*}{\texttt{pytest\_suite}}
|
| 376 |
& \texttt{LRU + CFS} & 2.14 & 50.0\% & 1048.5 \\
|
|
|
|
| 434 |
\label{fig:scaleout}
|
| 435 |
\end{figure*}
|
| 436 |
|
| 437 |
+
\subsection{Phase 2: Cluster Scale-Out ($N = 32..256$) and Calibration}
|
| 438 |
+
To validate the discrete-event simulator before scaling to $N = 256$, we ran it under matched Phase~0 closed-pool parameters ($K=12$, $C=4$, $M_{\mathrm{HBM}}=290~\mathrm{MB}$, $B_{\mathrm{dma}}=160~\mathrm{MB/s}$, $36~\mathrm{KB/tok}$, $\mu_{\mathrm{pf}} = 3{,}100~\mathrm{tok/s}$) across all five policies and three seeds: the simulator reproduces cross-policy ordering (\Continuum{} $<$ \texttt{LRU} $<$ \UNISON{} $<$ \SymbioSched{} $<$ \SymbioFull{}) with Pearson correlation $r = 0.941$ on P50 TTFT and $r = 0.940$ on HBM hit rate (while absolute simulated latencies are lower than MPS hardware due to MPS host-synchronization and \texttt{.pt} deserialization overheads).
|
| 439 |
+
|
| 440 |
+
Table~\ref{tab:scaleout} and Fig.~\ref{fig:scaleout} then evaluate cluster scale-out from $N = 32$ to $256$ concurrent sandboxes ($160~\mathrm{KB/tok}$ $32\mathrm{B}/70\mathrm{B}$ GQA KV economics, $3.2~\mathrm{GB/s}$ contended DMA and $36\mathrm{K}~\mathrm{tok/s}$ prefill per $64$-sandbox GPU node). Across $N \in \{64, 128, 256\}$ in Fig.~\ref{fig:scaleout}(a), \SymbioOS{} cuts P99 resume TTFT by $2.0\times$--$3.1\times$ relative to \texttt{LRU+CFS} and \Continuum{} (e.g., $451.2~\mathrm{ms}$ vs.\ $931.1$ and $1{,}390.2~\mathrm{ms}$ at $N = 128$). Along the tight-memory frontier in Table~\ref{tab:scaleout} and Fig.~\ref{fig:scaleout}(b), \SymbioFull{} at $15\%$ HBM reduces P50 TTFT by $5.80\times$ ($3{,}701.9 \to 638.1~\mathrm{ms}$) and at $25\%$ HBM by $3.85\times$ ($506.6 \to 131.7~\mathrm{ms}$), allowing a cluster with $25\%$ HBM capacity under \SymbioFull{} to outperform \texttt{LRU+CFS} provisioned with $1.5\times$--$2\times$ more HBM. Finally, sweeping Pareto tail exponent $\alpha \in \{1.15, 1.35, 1.65, 2.20\}$ in Fig.~\ref{fig:scaleout}(c) confirms Theorem~\ref{thm:gittins}: across even extreme heavy tails ($\alpha = 1.15$, infinite variance), \SymbioOS{} reduces cluster HBM waste by $34\%$ ($1{,}062 \to 700~\mathrm{GB}\cdot\mathrm{s}$) compared to GPU-blind schedulers.
|
| 441 |
|
| 442 |
% ============================================================================
|
| 443 |
\section{Related Work}\label{sec:related}
|
|
|
|
| 453 |
\section{Discussion, Limitations, and Conclusion}\label{sec:conclusion}
|
| 454 |
% ============================================================================
|
| 455 |
|
| 456 |
+
\emph{Scope and Limitations:} First, our hardware experiments execute on an emulated-HBM Apple Silicon prototype ($48~\mathrm{GB}$ unified memory, PyTorch MPS, software $M_{\mathrm{HBM}}$ caps, and \texttt{F\_NOCACHE} disk serialization) rather than a discrete-GPU Linux server with physical PCIe/HBM separation and CUDA streams; validating the design on discrete A100/H100 Linux nodes and benchmarking the unimplemented \texttt{cgroup v2} / \texttt{sched\_ext} fast path~\cite{zheng2026agentcgroup} remain important future work. Second, \SymbioOS{} implements host CPU control in rootless user space via $80~\mathrm{ms}$ POSIX process-group quanta (\texttt{killpg}): sub-millisecond tool bursts experience $80~\mathrm{ms}$ granularity, and a child process that explicitly calls \texttt{setsid()} or \texttt{setpgid()} escapes $\mathrm{pgid}_i$ (unlike kernel \texttt{cgroup v2} tracking). Third, opaque silent binaries that write zero progress bytes until termination fall back cleanly to command-class priors until $\sigma_i(t)$ crosses a conservative silence threshold, and multi-node RDMA KV pools~\cite{qin2025mooncake} introduce cross-rack jitter that must be folded into $T_{\mathrm{dma},i}$.
|
| 457 |
|
| 458 |
\emph{Conclusion:} Treating host OS sandbox scheduling and GPU KV memory tiering as independent problems causes severe TTL cliff evictions, stalled-cache HBM waste, and redundant post-exit prefill bottlenecks on multi-tenant coding-agent servers. \SymbioOS{} unifies rootless POSIX process-group scheduling, unstopped-quantum pipe filtration, KV-weighted Gittins CPU prioritization, optimal-stopping JIT promotion, and lookback-guarded $256$-token streaming \texttt{stdout} micro-prefill. Across $2{,}168$ real local tool-execution and MPS GPU resume cycles spanning \texttt{Qwen2.5-3B}, \texttt{Qwen2.5-7B}, and \texttt{OLMoE-1B-7B} alongside $256$-sandbox cluster simulations, \SymbioOS{} cuts median post-tool TTFT by up to $4.8\times$, lifts interactive HBM hit rates up to $95.2\%$, reduces HBM waste by up to $3.9\times$, and increases strict-SLO resume goodput by up to $5.7\times$.
|
| 459 |
|
|
|
|
| 475 |
\end{IEEEproof}
|
| 476 |
|
| 477 |
\begin{IEEEproof}[Proof of Theorem~\ref{thm:gittins}]
|
| 478 |
+
Fix decision epoch $t$ with filtration $\mathcal{F}_t$, static batch weights $v_i > 0$, and independent conditional remaining CPU requirements $W_{\mathrm{rem},i} \mid \mathcal{F}_t$. In a single-server bandit allocation with reward $v_i$ collected upon completion of job $i$~\cite{gittins1979bandit,aalto2009gittins}, the Gittins index of job $i$ is
|
| 479 |
\begin{equation}\label{eq:gittins_def}
|
| 480 |
\mathcal{G}_i(t) = \sup_{\Delta > 0} \frac{v_i\,\Prob\bigl(W_{\mathrm{rem},i} \le \Delta \mid \mathcal{F}_t\bigr)}{\E\bigl[\min(W_{\mathrm{rem},i},\, \Delta) \mid \mathcal{F}_t\bigr]}.
|
| 481 |
\end{equation}
|
| 482 |
+
Under case~(i) (deterministic milestone-revealed remaining work $W_{\mathrm{rem},i} = \hat{W}_{\mathrm{rem},i}(t)$), the supremum is achieved directly at $\Delta^* = \hat{W}_{\mathrm{rem},i}(t)$, yielding $\mathcal{G}_i(t) = v_i / \hat{W}_{\mathrm{rem},i}(t) = w_i^{\mathrm{ideal}}(t)$. Under case~(ii) (shared-shape Pareto laws $\bar{G}_i(x) = (s_i(t)/x)^\alpha$ for $x \ge s_i(t)$ with common $\alpha > 1$ across all $i$, so $h_i(x) = \alpha/x$ is strictly decreasing), the supremum in \eqref{eq:gittins_def} is attained as $\Delta \to 0^+$ at $v_i h_i(s_i(t)) = v_i \alpha / s_i(t) = v_i (\alpha - 1) / \E[W_{\mathrm{rem},i} \mid \mathcal{F}_t]$, which is a shared positive constant multiple $(\alpha - 1)$ of $w_i^{\mathrm{ideal}}(t)$ across all jobs. On $C = 1$ CPU-bound core ($T_{\mathrm{wall},i} = T_{\mathrm{cpu},i}$), Gittins' optimality theorem~\cite{gittins1979bandit,aalto2009gittins} guarantees that scheduling highest $\mathcal{G}_i(t)$ (equivalently $w_i^{\mathrm{ideal}}(t)$) minimizes $\E[\sum_{i=1}^M v_i T_{\mathrm{cpu},i}]$. For $C > 1$ identical cores, Scully et al.~\cite{scully2020gittins} bound the excess weighted response of top-$C$ Gittins scheduling against a single $C$-speed server by an additive $(C - 1)\max_i v_i$-scaled residual term.
|
|
|
|
|
|
|
|
|
|
|
|
|
| 483 |
\end{IEEEproof}
|
| 484 |
|
| 485 |
\begin{IEEEproof}[Proof of Theorem~\ref{thm:jit}]
|
| 486 |
+
For part~(a), expand the conditional expectation in \eqref{eq:jit_loss} with respect to $G_{i,t}(x) = \Prob(R_i(t) \le x \mid \mathcal{F}_t)$ around $\tilde{T}_{d,i} = T_{\mathrm{dma},i} + \delta_{\mathrm{jit}}$:
|
| 487 |
+
\begin{multline*}
|
| 488 |
+
\mathcal{L}_i(t) = c_{\mathrm{miss}} \int_0^{\tilde{T}_{d,i}} (\tilde{T}_{d,i} - x)\,\mathrm{d}G_{i,t}(x) \\
|
| 489 |
+
+ \lambda_{\mathrm{hbm}} S_i \int_{\tilde{T}_{d,i}}^\infty (x - \tilde{T}_{d,i})\,\mathrm{d}G_{i,t}(x).
|
| 490 |
+
\end{multline*}
|
| 491 |
+
Under local unit-rate residual drift ($\mathrm{d}R_i/\mathrm{d}t = -1$), delaying staging by $\mathrm{d}t > 0$ shifts $R_i$ downward by $\mathrm{d}t$, which is equivalent to increasing $\tilde{T}_{d,i}$ by $\mathrm{d}t$ relative to $G_{i,t}$; differentiating with respect to $\tilde{T}_{d,i}$ yields
|
| 492 |
\begin{equation*}
|
| 493 |
+
-\frac{\partial \mathcal{L}_i(t)}{\partial \tilde{T}_{d,i}} = -c_{\mathrm{miss}}\,G_{i,t}(\tilde{T}_{d,i}) + \lambda_{\mathrm{hbm}} S_i\bigl(1 - G_{i,t}(\tilde{T}_{d,i})\bigr).
|
| 494 |
\end{equation*}
|
| 495 |
+
Myopic staging dominates waiting once $-\partial \mathcal{L}_i(t)/\partial \tilde{T}_{d,i} \le 0$, which rearranges to $G_{i,t}(T_{\mathrm{dma},i} + \delta_{\mathrm{jit}}) \ge \frac{c_{\mathrm{miss}}}{c_{\mathrm{miss}} + \lambda_{\mathrm{hbm}} S_i} = 1 - \eta^*$.
|
| 496 |
|
| 497 |
+
For part~(b), let $Q_1(k)$ denote the number of post-exit sessions queued at Station~1 at resume epoch $k$. Because streaming micro-prefill runs strictly when $Q_1 = 0$ in non-preemptive chunks of at most $B_{\mathrm{chunk}}/\mu_{\mathrm{pf}}$, a resume arriving mid-chunk experiences expected residual blocking $\bar{\xi}_{\mathrm{res}} \le B_{\mathrm{chunk}}/\mu_{\mathrm{pf}}$, while post-exit prefill work shrinks from $L_{\mathrm{out},k}/\mu_{\mathrm{pf}}$ to $(1 - f_{\mathrm{stream}})L_{\mathrm{out},k}/\mu_{\mathrm{pf}}$. Hence $\bar{\tau}_1(f_{\mathrm{stream}}) = \bar{T}_{\mathrm{cold}} + (1 - f_{\mathrm{stream}})L_{\mathrm{out}}/\mu_{\mathrm{pf}} + \tau_{\mathrm{dec}} + \bar{\xi}_{\mathrm{res}}$, which is strictly smaller than $\bar{\tau}_1(0)$ whenever $f_{\mathrm{stream}} L_{\mathrm{out}}/\mu_{\mathrm{pf}} > \bar{\xi}_{\mathrm{res}}$. Applying the quadratic Lyapunov drift $\E[\frac{1}{2}Q_1^2(k+1) - \frac{1}{2}Q_1^2(k) \mid Q_1(k)] \le -Q_1(k)(1 - \lambda_{\mathrm{res}}\bar{\tau}_1(f_{\mathrm{stream}})) + O(1)$ establishes the enlarged stability region $\lambda_{\mathrm{res}}\bar{\tau}_1(f_{\mathrm{stream}}) < 1$~\cite{neely2010stochastic}, and under an M/G/1 Station-1 approximation smaller $\bar{\tau}_1$ reduces $\E[W_{\mathrm{gpu}}]$ and pinned waiting HBM $\bar{M}_{\mathrm{wait}} = \lambda_{\mathrm{res}}\bar{S}\,\E[W_{\mathrm{gpu}}]$.
|
| 498 |
\end{IEEEproof}
|
| 499 |
|
| 500 |
\bibliographystyle{IEEEtran}
|