#1810·colibri

[Feature]: Asynchronous PIPE queue

Author: tonnthuirCreated Sep 30, 2026Updated Sep 30, 2026

Problem

This is a re-implementation of the glm5.2 PIPE system to be more asynchronous. The big benefit is that the CPU path executes the first available expert instead of waiting to run them in a pre-determined order. This improves performance by about 10%.

Motivation: My profiling found that executing experts in order frequently led to the CPU waiting for the desired expert even when other experts were loaded. CPU utilization was at about 60-70% and disk utilization was at about 30-35%. The disk is mostly idle waiting for load requests and the CPU is sometimes waiting for the correct expert to load, while sometimes also waiting with no ready experts. With this new architecture, the CPU utilization increases to 75-90% and the disk utilization increases to about 35-40%

I am measuring disk utilization by bandwidth. I wrote a benchmarking program that just loads random experts and I am using that bandwidth as 100%. Improvements in the pilot are required to increase disk utilization.

I also moved the pipe infrastructure to its own file to make it easier to share between models.

Proposed solution

I have an implementation at https://github.com/tonnthuir/colibri/tree/async-pipe

It needs to be cleaned up a bit and rebased on the current version, but I would appreciate comments and feedback. The design is:

  • One queue for read requests, with the entire layer of requests fed in together.
  • Read workers that take the first available request, load the expert, and mark the job as ready
  • A computation queue that is searched in order for the first ready expert when the CPU becomes idle
  • Coordination mutexes that ensure state changes are atomic

Read job state list: queued, running, ready, consuming, released

The ws slots are dynamically allocated as reads are claimed and freed when the computation is completed. Cache promotion is pre-computed so experts being promoted to the cache are moved to the cache when computation is done.

This code is also set up to move the pilot loads into the same read queue, with read job types of demand, pilot, and cancelled. Cancelled jobs are completed if they start before cancellation, but will not be claimed by a read worker. I have not yet actually moved the pilot reads into this work queue, but I expect a larger performance boost from that because it will reduce the disk idle time.

Alternatives considered

No response

Scope and compatibility

I have only tested this on the CPU path. The coding agent checked the various GPU paths and tried to get all of them right, but it is hard for me to be confident about that.