Skip to content

Commit e5cb058

Browse files
kmbandyclaude
andcommitted
feat(wp): call mark_routing_boundaries before sched compute
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014ZRfPpL8XFzk1hep9MMg9P
1 parent cb15e25 commit e5cb058

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/llama-context.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2489,6 +2489,14 @@ ggml_status llama_context::graph_compute(
24892489
set_n_threads_fn.second(set_n_threads_fn.first, n_threads);
24902490
}
24912491

2492+
// WP_PAGED_BATCH: mark each MUL_MAT_ID and its ids-producer as batch-range
2493+
// break points before the scheduler splits/computes gf, so the eval-cb can
2494+
// isolate every routing op (fixes the batched-MoE read-before-produce fault).
2495+
// No-op unless the pager is active; cheap (cached, skips when topology unchanged).
2496+
if (model.wp_pager) {
2497+
model.wp_pager->mark_routing_boundaries(gf);
2498+
}
2499+
24922500
auto status = ggml_backend_sched_graph_compute_async(sched.get(), gf);
24932501
if (status != GGML_STATUS_SUCCESS) {
24942502
LLAMA_LOG_ERROR("%s: ggml_backend_sched_graph_compute_async failed with error %d\n", __func__, status);

0 commit comments

Comments
 (0)