Queue-Aware Layer Budgets for Dynamic Sparse Training

When a neural network is split across a chain of machines, for example a first block of layers on an edge device and the rest on a server, the delay a user sees is mostly waiting. Each stage is a queue. The time spent in a queue grows sharply as that stage's load nears its capacity, and it also grows with how much the stage's processing time varies. Pruning methods ignore this. They decide how many weights each layer keeps based on how much accuracy the layer seems to carry, under a budget of total parameters or total FLOPs, which does not care which stage the remaining compute ends up on. Two networks with identical FLOPs and identical accuracy can therefore show very different end-to-end delay under load. This happens when one of them leaves a single stage running near saturation.

We propose training sparse networks so that the number of weights kept per layer is set jointly by accuracy and by a queueing model of the deployed pipeline. Dynamic sparse training (DST) trains a network that stays sparse from the first step and keeps rewiring which weights are active. Here it is allowed, for the first time, to move weight budget between layers during training. That movement is steered by a constraint on predicted end-to-end delay. The delay formula uses the measured mean and variance of each stage's processing time, not the memoryless (exponential) assumption that makes standard multi-stage queue formulas tractable.

Core Claim

Consider a model partitioned into tandem stages with stochastic request arrivals and hardware-friendly structured sparsity. Fix accuracy and total density. The layer-wise sparsity allocation that minimizes end-to-end delay differs systematically from the allocations produced by FLOP-based heuristics such as the Erdős-Rényi-Kernel rule (ERK, which gives smaller layers higher density), and from static-latency budgets. The gap appears at moderate-to-high load and vanishes at low load. A DST procedure whose per-layer densities drift under a Lagrangian delay constraint can find this allocation, and do it at no more training cost than ordinary DST.

For a pipeline of $K$ stages, let $d$ be the vector of per-layer densities, $S_k(d)$ the processing time of stage $k$ (a random variable, because input size and contention vary), $\lambda$ the arrival rate, and $T_{\text{tx}}$ the transmission time between stages. The modeled delay is

$$D(d) = \sum_{k=1}^{K} \left( \mathbb{E}[S_k] + \frac{\lambda\, \mathbb{E}[S_k^2]\, c_k}{2\,(1-\lambda\,\mathbb{E}[S_k])} \right) + T_{\text{tx}},$$

The first term in each bracket is the stage's mean processing time and the second is its expected waiting time. Here $c_k$ is a correction factor that accounts for stage $k$ receiving non-Poisson arrivals from the stage upstream of it. It equals 1 at the first stage, which reduces that stage's term to the Pollaczek-Khinchin mean-wait formula for a single queue with general service times. Downstream of a stage with general service, departures are no longer Poisson, so the exact formula no longer holds. We therefore use a standard two-moment approximation that propagates the variability of inter-departure times from stage to stage, and we validate it empirically rather than assume it. Training then solves

$$\min_{w,\,d}\; \mathcal{L}(w, d) \quad \text{s.t.} \quad D(d) \le \tau,\;\; \textstyle\sum_l n_l d_l \le B,$$

where $\mathcal{L}$ is the task loss, $\tau$ is the delay target, $n_l$ is the parameter count of layer $l$, and $B$ is the total parameter budget.

Research Program

The work has three parts.

A measured service model. The open-problems discussion in the source material makes an important point. For fixed tensor shapes, the time to run a structured-sparse matrix multiply is nearly deterministic, so the variance in processing time comes from input size, batching and sharing the device with other jobs. We therefore use DynaDiag-style diagonal sparsity, so that sparsity actually translates into wall-clock speedups. DynaDiag is a DST method that restricts active weights to diagonals so both the forward and backward passes stay sparse on GPUs. We then build a per-layer lookup of the mean and second moment of processing time as a function of density, measured on the target edge and server devices under realistic input-size and co-tenancy distributions. This is what makes $\mathbb{E}[S_k(d)]$ and $\mathbb{E}[S_k^2(d)]$ differentiable in $d$, by interpolating between measured points.

Moving budget between layers during training. RigL Rigging the Lottery prunes low-magnitude weights and regrows those with large gradients, but within a fixed ERK allocation. We keep its within-layer rewiring and its update schedule. In addition, at each rewiring step, each layer's regrowth quota is set by two quantities that compete against each other. The first is an accuracy signal: the mean gradient magnitude of the layer's inactive weights, which is the same quantity RigL already computes. The second is the Lagrange multiplier on the delay constraint, multiplied by the layer's marginal delay cost $\partial D/\partial d_l$.

We reuse the multiplier machinery of Controlled Sparsity via Constrained Optimization. That method replaces sparsity penalties with explicit density constraints solved by a min-max game with dual restarts, using its released code constrained_sparsity. Our change is to apply the constraint to modeled delay rather than to density. The work on In-Time Over-Parameterization shows that sparse training succeeds by exploring many connections over time. It constrains our design: budget can only move gradually, with a settling period between moves, or exploration in the layers that receive budget will be starved.

Validation of the delay model. We replay arrival traces against the deployed two-stage and three-stage pipelines and compare measured mean and 99th-percentile delay with $D(d)$. We also compare against an M/M/1 version of the same model, which assumes exponential processing times. This step decides whether the queueing model deserves to sit inside the training loop at all.

The proposal builds on four lines of prior work, each of which leaves one piece out:

  • SPARQ places AI service chains across edge and cloud using M/M/1 and M/G/1 delay models. It is the closest system-side work and motivates the nonlinear delay objective. It treats each model's processing rate as fixed, which is exactly what we make trainable.
  • Xu et al. model LLM decoding as an M/G/1 queue and cut mean queueing delay by clipping long outputs. This motivates attacking the second moment of processing time. They change scheduling, not weights.
  • Budget-aware allocators. Differentiable Sparsity Allocation optimizes channel allocations under a static, single-input latency budget. OWL and the evolutionary allocation search set layer budgets after training from internal statistics. None of these sees queues or stage placement.
  • Variance-sensitive control. Age Distribution in Arbitrary Preemptive Memoryless Networks warns that policies that are optimal under memoryless processing can reverse under deterministic processing. This is why we expect the exponential assumption to mis-rank allocations, not merely mis-scale them.

Baselines

Do-nothing reference: uniform-sparsity DST. RigL with uniform density, at the same total parameter count and on the same split pipeline. This shows how much any allocation matters.

Strongest existing training method: RigL with ERK (or DynaDiag with its fixed allocation). This is the standard DST recipe and the one practitioners would actually deploy.

  • On ImageNet, RigL reports 74.6% Top-1 for ResNet-50 at 80% sparsity with ERK at 1x training FLOPs (RigL).
  • DynaDiag reports a 3.13x inference speedup for ViT-Base at 90% sparsity while matching RigL accuracy up to 80% sparsity (DynaDiag).
  • No reported result was found in the research file for the end-to-end queueing delay of any sparse network in a split pipeline. We will measure it for every baseline ourselves.

All methods share data, epochs, rewiring schedule, total density, sparsity structure and partition point. Hyperparameter tuning budgets are equal, so our extra knobs (multiplier learning rate, settling period) are not tuned more than RigL's update interval.

Beating this baseline means one of two things. Either it means lower measured 99th-percentile delay at equal or higher Top-1 at loads where the stage utilization is 0.7 or higher. Or it means higher Top-1 at the same delay target, beyond seed variance across three runs.

Strongest two-stage competitor: offline delay knapsack. We solve the delay-constrained allocation once before training, using the same lookup tables and the same $D(d)$, with OWL-style or ERK-style per-layer accuracy priors. We then run fixed-allocation RigL with that allocation. This is the baseline that isolates our key ingredient, which is moving budget during training.

Two ablations. The first swaps the delay model in the constraint for an M/M/1 model, isolating the value of variance-aware queueing. The second swaps $D(d)$ for summed static latency, as in Differentiable Sparsity Allocation, isolating the value of queueing at all.

Why not just…?

Why not just balance FLOPs or static latency across stages and use ERK inside each stage? At a single arrival rate with identical hardware this may come close to our result. Delay is lowest when no stage is near saturation, and balancing static latency roughly achieves that. Where it fails is when stages differ in processing-time variance (a shared server GPU versus a dedicated edge core, the distinction SPARQ draws) or in arrival rate. There, equal static latency does not mean equal waiting time. Our static-latency ablation tests this directly. If it matches the full method across our heterogeneity settings, we will report that the queueing model is unnecessary for this regime.

Why not just compute the delay-optimal allocation offline and train normally? This is the real threat. If the accuracy cost of each layer is stable over training, the offline knapsack captures everything. Our method should win only if layer sensitivity shifts during training, which the trajectory-matters finding of Lin et al. gives some reason to expect. We will log allocation drift over training. If the final learned allocation equals the offline one, or if fixed-allocation RigL trained with our final allocation matches us, we will conclude that dynamic budget movement adds nothing and recommend the offline version.

Why not just keep the exponential assumption, since it gives closed forms? Diagonal-sparse kernels have nearly deterministic runtime. For a single queue under Poisson arrivals, deterministic service halves the mean wait relative to exponential service at equal mean. An M/M/1 constraint therefore overstates waiting and over-prunes. The M/M/1 ablation will show whether this costs measurable accuracy at matched measured delay. The delay-model validation will show whether M/M/1 or our model better predicts traces.

Why not just prune a dense model after training with OWL? That requires a dense pretraining run, and it optimizes internal statistics rather than delay. We will include OWL followed by delay-aware rescaling as a secondary comparison on the CIFAR-100 setting, where dense training is cheap.

Proposed Experiments

Setup. The main sweep uses ResNet-50 and DeiT-Small with diagonal sparsity on CIFAR-100. Confirmation runs use ImageNet-1K at 80% and 90% sparsity, with ResNet-50 for comparability with RigL's 74.6% and ViT-Base for comparability with DynaDiag. Each model is split into two stages (edge GPU, server GPU) and three stages (adding a shared server tier). Arrivals come from Poisson processes and from bursty replayed traces, at utilizations from 0.3 to 0.95.

Metrics. We report Top-1 accuracy, measured mean and 99th-percentile end-to-end delay, maximum sustainable arrival rate under a delay target, and the prediction error of $D(d)$ against measurement.

Decisive checks. There are four:

  1. The modeled delay must track measured delay better than the M/M/1 model, or the approach stops there.
  2. At low load all allocations should give nearly equal delay. Divergence there would indicate a measurement error rather than a queueing effect.
  3. At high load and with heterogeneous stages, the full method must beat ERK-RigL on the 99th-percentile delay versus accuracy frontier.
  4. The full method must beat the offline knapsack, or we report that in-training reallocation is unnecessary.

Extension (outside the main claim). Gap 4 of the research file notes that pruning channels at the cut layer would shrink the transmission payload. Adding that effect to the constraint is a natural follow-up, but it is kept outside the main claim so the core result does not depend on it.