Skip to content

Conversation

Jeffwan
Copy link
Collaborator

@Jeffwan Jeffwan commented Apr 17, 2025

Pull Request Description

Support distributed hashing mode kv cache pool

Related Issues

Resolves: part of #928

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.

@Jeffwan Jeffwan requested a review from Copilot April 18, 2025 17:26
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 adds support for distributed hashing mode with a KV cache pool by introducing new reconciliation logic for stateful sets, watcher pods, and redis services. Key changes include:

  • New constants and RBAC rules to support KV cache watcher and stateful set objects.
  • Implementation of functions for reconciling stateful sets, watcher pods, and redis-related resources.
  • Updates to CRD defaults and types to support pointer-based storage fields.

Reviewed Changes

Copilot reviewed 8 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
pkg/controller/kvcache/kvcache_controller.go Added new constants and functions to reconcile stateful sets.
pkg/controller/kvcache/distributed.go Introduced distributed mode functions, watcher pod, and redis logic.
pkg/controller/kvcache/centralized.go Updated metadata service reconciliation to invoke redis support.
config/rbac/controller-manager/role.yaml Added RBAC rules for stateful sets and their status updates.
config/crd/orchestration/orchestration.aibrix.ai_kvcaches.yaml Updated CRD defaults and removal of extra required fields.
cmd/kvcache-watcher/main.go New watcher binary implementation for registering pod events.
api/orchestration/v1alpha1/zz_generated.deepcopy.go Adjusted deepcopy logic for pointer types in storage fields.
api/orchestration/v1alpha1/kvcache_types.go Updated storage type in RedisConfig and EtcdConfig to pointer types.
Files not reviewed (2)
  • Makefile: Language not supported
  • build/container/Dockerfile.kvcache: Language not supported
Comments suppressed due to low confidence (1)

pkg/controller/kvcache/distributed.go:230

  • The variable name 'statfulset' appears to be a typo. It should be renamed to 'statefulset' for clarity.
statfulset := &appsv1.StatefulSet{

Namespace: kvCache.Namespace,
Labels: map[string]string{
KVCacheLabelKeyIdentifier: kvCache.Name,
KVCacheLabelKeyRole: KVCacheLabelValueRoleMetadata,
Copy link
Preview

Copilot AI Apr 18, 2025

Choose a reason for hiding this comment

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

The watcher pod is being labeled with KVCacheLabelValueRoleMetadata instead of using the dedicated watcher role. Consider using KVCacheLabelValueRoleKVWatcher to clearly identify watcher pods.

Suggested change
KVCacheLabelKeyRole: KVCacheLabelValueRoleMetadata,
KVCacheLabelKeyRole: KVCacheLabelValueRoleKVWatcher,

Copilot uses AI. Check for mistakes.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

resolved. nice catch

- Add kvcache watcher programe
- Add kvcache-watcher build and push scripts
- Update distributed kv cache orchestration
- Fix linter errors
- Address review feedback

Signed-off-by: Jiaxin Shan <seedjeffwan@gmail.com>
@Jeffwan Jeffwan force-pushed the jiaxin/support-distribtued-kvcache-orchestration branch from 35e4454 to b53b156 Compare April 18, 2025 17:38
@Jeffwan
Copy link
Collaborator Author

Jeffwan commented Apr 18, 2025

Due to limited reviewers this week. I will merge this request

@Jeffwan Jeffwan merged commit 58d2b5b into vllm-project:main Apr 18, 2025
11 checks passed
@Jeffwan Jeffwan deleted the jiaxin/support-distribtued-kvcache-orchestration branch April 18, 2025 17:52
Yaegaki1Erika pushed a commit to Yaegaki1Erika/aibrix that referenced this pull request Jul 23, 2025
- Add kvcache watcher programe
- Add kvcache-watcher build and push scripts
- Update distributed kv cache orchestration
- Fix linter errors
- Address review feedback

Signed-off-by: Jiaxin Shan <seedjeffwan@gmail.com>
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