mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-05 07:48:45 +00:00
Split search: price a pipelined two-stage split by its slower stage (from Strata-DualGPU)
With --pipeline-windows 2 on two stages the stages overlap, so a window costs about the slower stage, and a stage's CPU misses wait on that stage; the last one also runs the head and the draft chain the next window waits for (~4 ms on an RTX 5080, about 12 of its layers). The serial sum balances the two cards' totals instead and starves the fast card's expert cache: on a 4060 Ti + 5080 pair it picks K=23 of 48 layers (33.4 ms predicted) where the pipelined price picks K=18 (17.0 ms). Adapted from Strata-DualGPU (Hardin22), keeping this tree's per-link miss scaling (link_scale). Measured on RTX 5080 + RTX 4060 Ti / Ryzen 7 9800X3D / 32 GB, Swift 1.5 IQ2_XS, 64K, q4_0 KV, --pipeline-windows 2, --layer-split auto: decode 48.1 tok/s sustained on a 1.9K-token answer (stock main prices the same placement serially at 33.4 ms; with #4522's trim also applied the pair reaches 66.5 tok/s).
This commit is contained in:
1 parent
dbb2d168cf
commit
b1b8b8d3d4
1 file changed
+16
@@ -6235,6 +6235,22 @@ int main(int argc, char** argv) {
|
||||
++held_cnt[(size_t) st];
|
||||
}
|
||||
held_mass /= std::max(total_mass, 1e-9);
|
||||
// --pipeline-windows 2 on two stages: the stages overlap, so a window costs about the slower stage,
|
||||
// and a stage's CPU misses wait on that stage. The last one also runs the head and the draft chain
|
||||
// the next window waits for: ~4 ms on an RTX 5080, about 12 of its layers. (A sum of the stages put
|
||||
// 2 of 48 layers on the first card of a 4060 Ti + 5080 pair and left most of its VRAM idle: 29 tok/s
|
||||
// against 165 at K=20. From Strata-DualGPU, adapted to keep this tree's per-link miss scaling.)
|
||||
if (o.pipeline_windows >= 2 && ns == 2) {
|
||||
double slowest = 0.0;
|
||||
for (int i = 0; i < ns; ++i) {
|
||||
const int64_t lb = i == 0 ? 0 : at[(size_t) i - 1], le = i + 1 < ns ? at[(size_t) i] : g.n_layers;
|
||||
const double gpu = (double) (le - lb + (i + 1 == ns ? 12 : 0)) * layer_ms[(size_t) i];
|
||||
slowest = std::max(slowest, gpu + miss_ms * link_scale[(size_t) i] *
|
||||
std::max(0.0, mass_i[(size_t) i] - held_i[(size_t) i]) /
|
||||
std::max(total_mass, 1e-9));
|
||||
}
|
||||
return slowest;
|
||||
}
|
||||
// Each stage's misses on its own link (link_scale; 1.0 everywhere = the fitted single-constant formula).
|
||||
double ms = 0.0;
|
||||
for (int i = 0; i < ns; ++i)
|
||||
|
||||
Reference in new issue
Block a user