-
-
Notifications
You must be signed in to change notification settings - Fork 11.7k
[Core][Hybrid allocator + kv connector 1/n] Enable hybrid allocator + KV cache connector #25712
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Core][Hybrid allocator + kv connector 1/n] Enable hybrid allocator + KV cache connector #25712
Conversation
Signed-off-by: KuntaiDu <[email protected]>
Signed-off-by: KuntaiDu <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request successfully enables the use of the hybrid allocator with the KV cache connector by removing the explicit restriction and adding the necessary logic to handle multiple KV cache groups. The changes are well-structured, introducing a SupportsHMA interface to check for compatibility. My review focuses on improving code quality and performance. I've identified an opportunity to refactor duplicated code for better maintainability and two instances where an expensive deepcopy operation can be replaced with a more efficient shallow copy, which should improve initialization performance.
|
@NickLucche @njhill This is the refactored version of #25363 , PTAL |
Signed-off-by: KuntaiDu <[email protected]>
Signed-off-by: KuntaiDu <[email protected]>
|
This pull request has merge conflicts that must be resolved before it can be |
Get it. Prefer to fix it in future PR though. |
|
This pull request has merge conflicts that must be resolved before it can be |
Signed-off-by: KuntaiDu <[email protected]>
Signed-off-by: Kuntai Du <[email protected]>
Signed-off-by: KuntaiDu <[email protected]>
Signed-off-by: KuntaiDu <[email protected]>
Signed-off-by: KuntaiDu <[email protected]>
Signed-off-by: KuntaiDu <[email protected]>
…aiDu/vllm into kuntai-enable-hma-connector
Signed-off-by: KuntaiDu <[email protected]>
Signed-off-by: KuntaiDu <[email protected]>
Signed-off-by: KuntaiDu <[email protected]>
… KV cache connector (vllm-project#25712) Signed-off-by: KuntaiDu <[email protected]> Signed-off-by: Kuntai Du <[email protected]>
… KV cache connector (vllm-project#25712) Signed-off-by: KuntaiDu <[email protected]> Signed-off-by: Kuntai Du <[email protected]> Signed-off-by: 0xrushi <[email protected]>
… KV cache connector (vllm-project#25712) Signed-off-by: KuntaiDu <[email protected]> Signed-off-by: Kuntai Du <[email protected]> Signed-off-by: 0xrushi <[email protected]>
Follow on from vllm-project#25712 `VllmConfig` is explicitly designed as a dataclass containing user-provided configuration and model metadata. It is a global configuration object that lives throughout the entire engine lifetime and is meant to be immutable after `__post_init__()`. `KVCacheConfig` is worker-specific, runtime-computed state. It has limited lifetime, and its purpose is limited to initializing the KV Cache in the model runner. Even if we add KV cache hints to model config.json in future, this would be parsed into `ModelConfig`, used as input to the `get_kv_cache_configs()` computation, and the resulting `KVCacheConfig` would still be runtime state. We are currently creating per-worker copies of VllmConfig in order to attach the runtime `KVCacheConfig` state. But instead we should just explicitly pass `KVCacheConfig` to the connector. Make sure to handle backwards compatibility for external connector implementations (loaded via module path) that have the old style constructor signature. Signed-off-by: Mark McLoughlin <[email protected]>
Follow on from vllm-project#25712 `VllmConfig` is explicitly designed as a dataclass containing user-provided configuration and model metadata. It is a global configuration object that lives throughout the entire engine lifetime and is meant to be immutable after `__post_init__()`. `KVCacheConfig` is worker-specific, runtime-computed state. It has limited lifetime, and its purpose is limited to initializing the KV Cache in the model runner. Even if we add KV cache hints to model config.json in future, this would be parsed into `ModelConfig`, used as input to the `get_kv_cache_configs()` computation, and the resulting `KVCacheConfig` would still be runtime state. We are currently creating per-worker copies of VllmConfig in order to attach the runtime `KVCacheConfig` state. But instead we should just explicitly pass `KVCacheConfig` to the connector. Make sure to handle backwards compatibility for external connector implementations (loaded via module path) that have the old style constructor signature. Signed-off-by: Mark McLoughlin <[email protected]>
Follow on from vllm-project#25712 `VllmConfig` is explicitly designed as a dataclass containing user-provided configuration and model metadata. It is a global configuration object that lives throughout the entire engine lifetime and is meant to be immutable after `__post_init__()`. `KVCacheConfig` is worker-specific, runtime-computed state. It has limited lifetime, and its purpose is limited to initializing the KV Cache in the model runner. Even if we add KV cache hints to model config.json in future, this would be parsed into `ModelConfig`, used as input to the `get_kv_cache_configs()` computation, and the resulting `KVCacheConfig` would still be runtime state. We are currently creating per-worker copies of VllmConfig in order to attach the runtime `KVCacheConfig` state. But instead we should just explicitly pass `KVCacheConfig` to the connector. Make sure to handle backwards compatibility for external connector implementations (loaded via module path) that have the old style constructor signature. Signed-off-by: Mark McLoughlin <[email protected]>
… KV cache connector (vllm-project#25712) Signed-off-by: KuntaiDu <[email protected]> Signed-off-by: Kuntai Du <[email protected]>
… KV cache connector (vllm-project#25712) Signed-off-by: KuntaiDu <[email protected]> Signed-off-by: Kuntai Du <[email protected]>
… KV cache connector (vllm-project#25712) Signed-off-by: KuntaiDu <[email protected]> Signed-off-by: Kuntai Du <[email protected]>
Purpose
Refactor of #25363 . This PR enables the combination of hybrid allocator + KV cache connector in a backward-compatible way.
Test Script
Test Result
Success.
Essential Elements of an Effective PR Description Checklist
supported_models.mdandexamplesfor a new model.