Skip to content

Commit 91856ac

Browse files
authored
[bugfix]fix code style and ci (#257)
* fix code style * fix dt
1 parent 0cd97fa commit 91856ac

File tree

2 files changed

+6
-14
lines changed

2 files changed

+6
-14
lines changed

test/test_uc_connector.py

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,7 @@ def test_get_num_new_matched_tokens_partial_hit(self):
152152
def mock_lookup(tokens: List[int]) -> List[bool]:
153153
return [True, False, True, False]
154154

155-
def mock_create(tokens: List[str]) -> List[int]:
156-
return [0, 1, 0]
157-
158155
mock_connector.lookup.side_effect = mock_lookup
159-
mock_connector.create.side_effect = mock_create
160156
ucconnector = self.init_uc(mock_connector)
161157

162158
random.seed(20250704)
@@ -177,9 +173,9 @@ def mock_create(tokens: List[str]) -> List[int]:
177173
ucconnector.request_block_infos[request1.request_id].block_operations,
178174
[
179175
BlockOperation.LOAD,
180-
BlockOperation.DUMP,
181176
BlockOperation.NONE,
182-
BlockOperation.DUMP,
177+
BlockOperation.NONE,
178+
BlockOperation.NONE,
183179
],
184180
)
185181

@@ -189,11 +185,7 @@ def test_get_num_new_matched_tokens_partial_hit_with_preftxcache(self):
189185
def mock_lookup(tokens: List[int]) -> List[bool]:
190186
return [False, True, False]
191187

192-
def mock_create(tokens: List[str]) -> List[int]:
193-
return [0, 1, 0]
194-
195188
mock_connector.lookup.side_effect = mock_lookup
196-
mock_connector.create.side_effect = mock_create
197189
ucconnector = self.init_uc(mock_connector)
198190

199191
random.seed(20250704)
@@ -218,9 +210,9 @@ def mock_create(tokens: List[str]) -> List[int]:
218210
ucconnector.request_block_infos[request1.request_id].block_operations,
219211
[
220212
BlockOperation.NONE,
221-
BlockOperation.DUMP,
222213
BlockOperation.NONE,
223-
BlockOperation.DUMP,
214+
BlockOperation.NONE,
215+
BlockOperation.NONE,
224216
],
225217
)
226218

ucm/ucm_sparse/prefetch_engine.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -517,8 +517,8 @@ def _no_gsa_input_deal(
517517
self.is_gsa_req_id[req_id]
518518
and gsa_metadata.gsa_stats[req_id].topk_buf_tmp != None
519519
):
520-
if (torch.max(gsa_metadata.gsa_stats[req_id].topk_buf_tmp) >
521-
(len(self.block_table_list_bs[index]) - 1)
520+
if torch.max(gsa_metadata.gsa_stats[req_id].topk_buf_tmp) > (
521+
len(self.block_table_list_bs[index]) - 1
522522
):
523523
self.gsa_seq_len[:, bs_index] = gsa_metadata.gsa_stats[
524524
req_id

0 commit comments

Comments
 (0)