Skip to content

Commit 8a5be56

Browse files
author
yangcheng (AJ)
committed
new branch
1 parent e639a4b commit 8a5be56

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

vllm_ascend/worker/model_runner_v1.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1623,7 +1623,7 @@ def _dummy_run(
16231623
attn_metadata = None
16241624

16251625

1626-
if not is_compile and not is_profile_run and self.dynamic_eplb:
1626+
if not is_torchair_compile and not is_profile_run and self.dynamic_eplb:
16271627
self.eplb_updator.forward_before()
16281628

16291629
with self.maybe_dummy_run_with_lora(self.lora_config,
@@ -1705,7 +1705,7 @@ def _dummy_run(
17051705
self.drafter.dummy_run(num_reqs, with_prefill=with_prefill)
17061706
if is_profile_run and self.dynamic_eplb:
17071707
self.model.clear_all_moe_loads()
1708-
if not is_compile and not is_profile_run and self.dynamic_eplb:
1708+
if not is_torchair_compile and not is_profile_run and self.dynamic_eplb:
17091709
self.eplb_updator.forward_end()
17101710
return hidden_states
17111711

@@ -1868,14 +1868,13 @@ def align_memory(tensor: torch.Tensor, alignment: int) -> torch.Tensor:
18681868
block_sizes=[self.cache_config.block_size],
18691869
)
18701870

1871-
if not vllm_version_is("0.9.0"):
1872-
kv_cache_sizes = {}
1873-
for kv_cache_tensor in kv_cache_config.kv_cache_tensors:
1874-
assert len(kv_cache_tensor.shared_by) == 1, (
1875-
"KV cache tensor shared by multiple layers is not supported in "
1876-
"NPU.")
1877-
kv_cache_sizes[
1878-
kv_cache_tensor.shared_by[0]] = kv_cache_tensor.size
1871+
kv_cache_sizes = {}
1872+
for kv_cache_tensor in kv_cache_config.kv_cache_tensors:
1873+
assert len(kv_cache_tensor.shared_by) == 1, (
1874+
"KV cache tensor shared by multiple layers is not supported in "
1875+
"NPU.")
1876+
kv_cache_sizes[
1877+
kv_cache_tensor.shared_by[0]] = kv_cache_tensor.size
18791878

18801879
for kv_cache_group in kv_cache_config.kv_cache_groups:
18811880
kv_cache_spec = kv_cache_group.kv_cache_spec

0 commit comments

Comments
 (0)