Skip to content

[Roadmap] CPU Backend Optimization (2025 H2) #8281

Description

@mingfeima

Checklist

Motivation

Continue optimize CPU backend on SGLang after #2807, we target at providing optimal performance for intel Xeon with AMX support. For CPUs without AMX, we will only guarantee functionality but not performance.

Single Node CPU Optimization

(deploy with single node CPU, with 1/2/4 sockets)

  • Graph Mode Support: enable graph mode with torch.compile, to remove the python overhead. This roughly give extra 10% performance improvement for decoding, Add graph runner support with torch compile on CPU #7843.
  • Prefill Optimization: add thread blocking and cache blocking for gemm and moe modules, the current implementations exist duplicate reads for weights for large input M, will give 50~80% improvements for prefilling phase. @mingfeima Optimize prefill performance on cpu backend #8750
  • INT4 Support: 4bit mode is more important for computationally constrained hardware e.g. CPUs. Enable awq INT4 (w4a8), reuse frontend from CUDA implementation (also decouple with vLLM) and inject high performance kernels for CPU devices. [CPU][INT4] Add AWQ frontend support for CPU  #8225, [CPU][INT4] Add INT4 kernels for CPU  #8226.
  • FP4 Support: follow WoQ pattern to enable FP4 support and run GPU model weights OOBox.
  • FP8 KV Cache Support: enable usage of FP8 kv cache, fallback to compute with BF16. @shiyang-weng
  • FP8 Bmm Support: enable FP8 BMM in MLA weight absorb, the current BMM is computed with BF16. As CPU hardware doesn't support FP8 computation, prefer to use WoQ (A:BF16, B:FP8, C:BF16). @blzheng the improvement for decoding will only be marginal, estimated 1.5% top.
  • SplitK: GEMM with small OC (output channels, or N for GEMM) suffers from low performance since not be able to fully parallel, implement splitK for gate proj. @mingfeima The current gate proj only has ~50% memory bandwidth utilization.
  • MTP Support: Enable Multi-Token Prediction @Yuxingwang-intel

Multi Node CPU Optimization

(deploy with multi node CPU, each with 1/2/4 sockets)

  • Data Parallel MLA and Expert Parallel MoE: map DP-MLA and EPMoE from multi-GPUs to multi-CPUs @chunyuan-w @mingfeima @yanbing-j
  • Distributed Collectives: expand collectives, e.g. broadcast, all-reduce to multi node. Evaluate use of oneCCL implementation from DeepSeed. @yanbing-j @blzheng

Hybrid MoE Offloading

(CPU handles MoE, GPU handles Attention, etc.)

  • GPU-CPU Offloading: GPU and CPU run sequentially, @Quallyjiang @jianan-gu.
  • GPU-CPU Pipelining: GPU and CPU run in parallel with a pipeling pattern.

Hybrid PD Disaggregation

(PoC stage)

  • Scheduling with heterogeneous decoding nodes.

User Experience and Testing Enhancement

Innovation

  • super long context prefill/decode performance optimization
  • expert load balancing with numa aware

Related resources

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions