Re: [PATCH] sched_ext: Add scx_ai_numa scheduler example for AI workloads
From: Andrea Righi
Date: Fri May 08 2026 - 05:38:02 EST
Hi Christian,
On Fri, May 08, 2026 at 10:29:24AM +0100, Christian Loehle wrote:
> On 5/8/26 08:56, Andrea Righi wrote:
> > Hi Qiliang,
> >
> > On Fri, May 08, 2026 at 03:51:35PM +0800, Qiliang Yuan wrote:
> >> Implement an AI-focused NUMA-aware scheduler that optimizes task dispatch for
> >> GPU-accelerated AI training. The scheduler maintains per-NUMA-node dispatch
> >> queues to preserve L3 cache warmth and minimize remote DRAM accesses that
> >> would stall GPU kernel launches waiting on CPU preprocessing.
> >>
> >> Key features:
> >> - Per-NUMA-node DSQs (dispatch queues) to maintain cache locality
> >> - Idle fast path that bypasses DSQ for minimum latency
> >> - Per-task NUMA affinity tracking to remember task placement
> >> - Work stealing across nodes to prevent starvation during load imbalance
> >>
> >> The BPF component (scx_ai_numa.bpf.c) implements the core scheduler
> >> callbacks, while the userspace loader (scx_ai_numa.c) detects NUMA
> >> topology, installs the BPF program, and reports per-node dispatch
> >> statistics every second.
> >>
> >> This scheduler is suitable for AI training workloads where GPU command
> >> launches depend on rapid CPU preprocessing with minimal scheduling latency.
> >>
> >> Signed-off-by: Qiliang Yuan <realwujing@xxxxxxxxx>
> >
> > I think this would be more appropriate for inclusion in
> > https://github.com/sched-ext/scx.
>
> That repo no longer hosts C schedulers though, no?
> I guess it's trivial to convert this particular one to rust.
Correct, it shouldn't be too difficult to convert it to Rust and the scx repo
seems a better place for this scheduler.
In general, I think we don't want to add too many example schedulers in the
kernel, those in tools/sched_ext shouldn't be focused on production goals, they
are there to test certain specific sched_ext functionality and show how to use
the framework.
Thanks,
-Andrea