Skip to content

Commit aff412a

Browse files
[fix] Adapt all sparse-attention methods to the new connector. (#441)
* sparse to adapt new connector * Adapt the YAML configuration
1 parent b36dfdb commit aff412a

File tree

9 files changed

+278
-155
lines changed

9 files changed

+278
-155
lines changed

examples/offline_inference_esa.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,15 @@ def build_llm_with_uc(module_path: str, name: str, model: str):
6767
kv_connector_module_path=module_path,
6868
kv_role="kv_both",
6969
kv_connector_extra_config={
70-
"ucm_connector_name": "UcmNfsStore",
71-
"ucm_connector_config": {
72-
"storage_backends": data_dir,
73-
"kv_block_size": 33554432,
74-
},
70+
"ucm_connectors": [
71+
{
72+
"ucm_connector_name": "UcmNfsStore",
73+
"ucm_connector_config": {
74+
"storage_backends": data_dir,
75+
"use_direct": False,
76+
},
77+
}
78+
],
7579
"ucm_sparse_config": {
7680
"ESA": {
7781
"init_window_sz": 1,
@@ -125,8 +129,8 @@ def print_output(
125129

126130

127131
def main():
128-
module_path = "ucm.integration.vllm.uc_connector"
129-
name = "UnifiedCacheConnectorV1"
132+
module_path = "ucm.integration.vllm.ucm_connector"
133+
name = "UCMConnector"
130134
setup_environment_variables()
131135

132136
def get_prompt(prompt):

examples/offline_inference_kvcomp.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,15 @@ def build_llm_with_uc(module_path: str, name: str, model: str):
6767
kv_connector_module_path=module_path,
6868
kv_role="kv_both",
6969
kv_connector_extra_config={
70-
"ucm_connector_name": "UcmNfsStore",
71-
"ucm_connector_config": {
72-
"storage_backends": data_dir,
73-
"kv_block_size": 33554432,
74-
},
70+
"ucm_connectors": [
71+
{
72+
"ucm_connector_name": "UcmNfsStore",
73+
"ucm_connector_config": {
74+
"storage_backends": data_dir,
75+
"use_direct": False,
76+
},
77+
}
78+
],
7579
"ucm_sparse_config": {
7680
"KvComp": {
7781
"init_window_sz": 1,
@@ -123,8 +127,8 @@ def print_output(
123127

124128

125129
def main():
126-
module_path = "ucm.integration.vllm.uc_connector"
127-
name = "UnifiedCacheConnectorV1"
130+
module_path = "ucm.integration.vllm.ucm_connector"
131+
name = "UCMConnector"
128132
setup_environment_variables()
129133

130134
def get_prompt(prompt):

examples/offline_inference_kvstar.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,15 @@ def build_llm_with_uc(module_path: str, name: str, model: str):
6868
kv_connector_module_path=module_path,
6969
kv_role="kv_both",
7070
kv_connector_extra_config={
71-
"ucm_connector_name": "UcmNfsStore",
72-
"ucm_connector_config": {
73-
"storage_backends": data_dir,
74-
"kv_block_size": 33554432,
75-
},
71+
"ucm_connectors": [
72+
{
73+
"ucm_connector_name": "UcmNfsStore",
74+
"ucm_connector_config": {
75+
"storage_backends": data_dir,
76+
"use_direct": False,
77+
},
78+
}
79+
],
7680
"ucm_sparse_config": {
7781
"KVStarMultiStep": {
7882
"init_window_sz": 1,
@@ -123,8 +127,8 @@ def print_output(
123127

124128

125129
def main():
126-
module_path = "ucm.integration.vllm.uc_connector"
127-
name = "UnifiedCacheConnectorV1"
130+
module_path = "ucm.integration.vllm.ucm_connector"
131+
name = "UCMConnector"
128132
setup_environment_variables()
129133

130134
def get_prompt(prompt):

0 commit comments

Comments
 (0)