-
-
Notifications
You must be signed in to change notification settings - Fork 11.8k
[Bugfix] Fix 2 precommit issues - (mamba_block_size, kv_cache_config) #27811
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
Changes from 2 commits
9ce4949
7866fdc
f9b06dc
4924449
8436b1b
016b68d
16eeb2a
13eb9f9
111b37b
6b07a03
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -93,7 +93,7 @@ | |||||
| ) | ||||||
|
|
||||||
| connector_vllm_config = copy.copy(self.vllm_config) | ||||||
| connector_vllm_config.kv_cache_config = copy.copy(kv_cache_config) | ||||||
| connector_vllm_config.cache_config = copy.copy(kv_cache_config) | ||||||
|
Check failure on line 96 in vllm/v1/core/sched/scheduler.py
|
||||||
|
||||||
| self.connector = KVConnectorFactory.create_connector( | ||||||
| config=connector_vllm_config, role=KVConnectorRole.SCHEDULER | ||||||
| ) | ||||||
|
|
@@ -1335,7 +1335,7 @@ | |||||
| assert len(self.kv_cache_config.kv_cache_groups) == 1 | ||||||
| return self.connector.request_finished(request, block_ids[0]) | ||||||
| else: | ||||||
| return self.connector.request_finished(request, block_ids) | ||||||
|
Check failure on line 1338 in vllm/v1/core/sched/scheduler.py
|
||||||
|
||||||
| return self.connector.request_finished(request, block_ids) # type: ignore[attr-defined] |
Should be able to just ignore the type check here, this line will not be hit at the current state (no connector implements HMA interface).
For future reference, I think request_finished_all_groups should be called here as it is defined in SupportHMA interface and has the correct function signature.
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.
Switched to request_finished_all_groups
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.
This change appears to introduce a type error. The
connector_vllm_configis an instance ofVllmConfig, which has acache_configattribute of typeCacheConfig. Thekv_cache_configvariable is of typeKVCacheConfig. These two types are not compatible.Assigning
kv_cache_configtoconnector_vllm_config.cache_configwill likely causeAttributeErrorexceptions downstream in any code that expects aCacheConfigobject, as their attributes are different. For example,CacheConfighasblock_sizeandcache_dtype, whileKVCacheConfighasnum_blocksandkv_cache_groups.The previous code
connector_vllm_config.kv_cache_config = copy.copy(kv_cache_config)was dynamically adding an attribute, which is allowed but might have been flagged by a linter. If the connector expects akv_cache_configattribute, the previous implementation was functionally correct. This change seems to fix a linting issue by introducing a runtime bug.I suggest reverting this change and potentially adding a
# type: ignoreor# noqato address the linting warning if that was the original problem.