Skip to content

Conversation

DwyaneShi
Copy link
Collaborator

Pull Request Description

This PR introduces the foundational setup and core modules for the project:

Key Changes

  • Project Initialization – Basic project structure, setup, and dependencies.
  • Common Module – Logging, nvtx annotation, async utils.
  • Memory Module – Tensor pool allocator, memory region and reference counted object.
  • Spec/Status/Cache Handle
  • Unit test for tensor pool allocator

Related Issues

Resolves: #[Insert issue number(s)]

Important: Before submitting, please complete the description above and review the checklist below.


Contribution Guidelines (Expand for Details)

We appreciate your contribution to aibrix! To ensure a smooth review process and maintain high code quality, please adhere to the following guidelines:

Pull Request Title Format

Your PR title should start with one of these prefixes to indicate the nature of the change:

  • [Bug]: Corrections to existing functionality
  • [CI]: Changes to build process or CI pipeline
  • [Docs]: Updates or additions to documentation
  • [API]: Modifications to aibrix's API or interface
  • [CLI]: Changes or additions to the Command Line Interface
  • [Misc]: For changes not covered above (use sparingly)

Note: For changes spanning multiple categories, use multiple prefixes in order of importance.

Submission Checklist

  • PR title includes appropriate prefix(es)
  • Changes are clearly explained in the PR description
  • New and existing tests pass successfully
  • Code adheres to project style and best practices
  • Documentation updated to reflect changes (if applicable)
  • Thorough testing completed, no regressions introduced

By submitting this PR, you confirm that you've read these guidelines and your changes align with the project's contribution standards.

@DwyaneShi DwyaneShi requested review from Jeffwan and happyandslow May 7, 2025 03:14
@DwyaneShi DwyaneShi added kind/feature Categorizes issue or PR as related to a new feature. area/kv-cache labels May 7, 2025
- project init
- common module
- memory module
- spec/status/cache handle

Signed-off-by: Haiyang Shi <haiyang.shi@bytedance.com>
@DwyaneShi DwyaneShi force-pushed the haiyang/kv-cache-common branch from 80c07a0 to 63ade6c Compare May 7, 2025 05:01
@@ -0,0 +1,12 @@
# python
__pycache__
Copy link
Collaborator

@Jeffwan Jeffwan May 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here, we need a separate package python/aibrix_kvcache/aibrix_kvcache. corresponding usage would be pip install aibrix-kvcache

another option is python/aibrix/aibrix/kvcache. kv cache package doesn't have interactions with other components, technically, it can be a standalone one, I think make it as a submodule also works. What's your preferred way? this is related to publish.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I initially considered making kv cache as a submodule. But since kv cache has many more dependencies than the aibrix runtime (e.g., torch, redis, infinistore) and their dependencies do not have too much overlap, I decided to make it as a separate project. Therefore, when user installs aibrix runtime or kv cache, only needed dependencies would be downloaded and installed, which makes more sense to me.

@Jeffwan Jeffwan requested a review from Copilot May 7, 2025 05:16
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR establishes the core framework for the AIBrix KVCache project by introducing foundational modules, test infrastructure, and configuration updates. Key additions include test fixtures and helper functions, core modules for status, spec, memory, and caching functionality, as well as standardized project configuration and CI workflows.

Reviewed Changes

Copilot reviewed 22 out of 24 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
python/aibrix_kvcache/tests/conftest.py Introduces tests and fixtures for KVCache with helper functions to manage cache environments.
python/aibrix_kvcache/tests/init.py Adds license headers to test files.
python/aibrix_kvcache/scripts/check_aibrix_header.py Provides a script to verify and add required AIBrix license headers in source files.
python/aibrix_kvcache/pyproject.toml Sets up project configuration, dependencies, and linting configurations.
python/aibrix_kvcache/aibrix_kvcache/status.py Implements a generic status mechanism for success/error handling.
python/aibrix_kvcache/aibrix_kvcache/spec.py Defines specifications for cache blocks and tensor configurations.
python/aibrix_kvcache/aibrix_kvcache/memory/* Adds memory management modules including tensor pool allocator and ref-counted objects.
python/aibrix_kvcache/aibrix_kvcache/common/* Introduces common utilities such as async base, nvtx profiling, object pool and logging.
python/aibrix_kvcache/aibrix_kvcache/cache_handle.py Establishes cache handle abstraction and its memory-region based implementation.
python/aibrix_kvcache/README.md Provides an overview and quick start instructions for using the framework.
python/aibrix_kvcache/LICENSE Specifies the project license under the Apache License 2.0.
.github/workflows/*.yml Updates CI workflows to test and lint changes within the designated subdirectories.
Files not reviewed (2)
  • python/aibrix_kvcache/.gitignore: Language not supported
  • python/aibrix_kvcache/scripts/format.sh: Language not supported

Signed-off-by: Haiyang Shi <haiyang.shi@bytedance.com>
Copy link
Collaborator

@Jeffwan Jeffwan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did review the detail code in this PR.

Let's get all the work merged and then kick off the code review in parallel.

@@ -0,0 +1,45 @@
name: Python AIBrix KVCache Tests
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check release pipeline, we need to upload to pypi as well for each tags.

@@ -0,0 +1,99 @@
[project]
name = "aibrix-kvcache"
version = "0.1.0"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rest version are aligned with aibrix repo tags. we may consider the version strategy here.

@Jeffwan Jeffwan merged commit 31a1457 into vllm-project:main May 7, 2025
13 checks passed
Yaegaki1Erika pushed a commit to Yaegaki1Erika/aibrix that referenced this pull request Jul 23, 2025
- project init
- common module
- memory module
- spec/status/cache handle
---------

Signed-off-by: Haiyang Shi <haiyang.shi@bytedance.com>
Co-authored-by: Haiyang Shi <haiyang.shi@bytedance.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/kv-cache kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants