Skip to content

feat: add multi-GPU backend abstraction layer (gpu_backend)#131

Open
feiqiangs wants to merge 1 commit intomainfrom
dev_sfq
Open

feat: add multi-GPU backend abstraction layer (gpu_backend)#131
feiqiangs wants to merge 1 commit intomainfrom
dev_sfq

Conversation

@feiqiangs
Copy link
Copy Markdown
Collaborator

  • Introduce flexkv/gpu_backend/ Python abstraction layer with GpuBackend ABC (15 abstract methods covering memory, stream, IPC, and storage operations)
  • Add NvidiaBackend (production-ready), GenericBackend (CPU fallback), and MusaBackend (experimental) implementations
  • Auto-detect backend at import time via flexkv/gpu_backend/init.py
  • Unify C extension entry point to single flexkv.c_ext for all backends:
    • csrc/gpu_backend/nvidia/gpu_transfer_bindings.h (CUDA-specific bindings)
    • csrc/gpu_backend/musa/gpu_transfer_bindings.h (MUSA-specific bindings)
    • csrc/bindings.cpp selects backend via #if FLEXKV_BACKEND_MUSA at compile time,
      injected by MUSABuilder; ext_name is always flexkv.c_ext (no c_ext_musa branch)
  • Add build_backends/ package (CUDABuilder, MUSABuilder, GenericBuilder)
    with per-vendor compile flags and source lists; all comments in English
  • Add docs/gpu_backends/README_zh.md and README_en.md integration guides
    covering 5 design principles, step-by-step onboarding, GDS/IPC fallback;
    NvidiaBackend code example updated to match actual implementation

- Introduce flexkv/gpu_backend/ Python abstraction layer with GpuBackend ABC
  (15 abstract methods covering memory, stream, IPC, and storage operations)
- Add NvidiaBackend (production-ready), GenericBackend (CPU fallback),
  and MusaBackend (experimental) implementations
- Auto-detect backend at import time via flexkv/gpu_backend/__init__.py
- Unify C extension entry point to single flexkv.c_ext for all backends:
  * csrc/gpu_backend/nvidia/gpu_transfer_bindings.h  (CUDA-specific bindings)
  * csrc/gpu_backend/musa/gpu_transfer_bindings.h    (MUSA-specific bindings)
  * csrc/bindings.cpp selects backend via #if FLEXKV_BACKEND_MUSA at compile time,
    injected by MUSABuilder; ext_name is always flexkv.c_ext (no c_ext_musa branch)
- Add build_backends/ package (CUDABuilder, MUSABuilder, GenericBuilder)
  with per-vendor compile flags and source lists; all comments in English
- Add docs/gpu_backends/README_zh.md and README_en.md integration guides
  covering 5 design principles, step-by-step onboarding, GDS/IPC fallback;
  NvidiaBackend code example updated to match actual implementation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant