Skip to content

Commit 71246f6

Browse files
committed
[Fix] Adjust use_aclgraph logic
Signed-off-by: Yizhou Liu <[email protected]>
1 parent 8cf97d8 commit 71246f6

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

vllm_ascend/ops/common_fused_moe.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
from vllm.model_executor.layers.fused_moe.layer import \
2323
UnquantizedFusedMoEMethod
2424

25+
from vllm_ascend.ascend_config import get_ascend_config
2526
from vllm_ascend.ops.fused_moe import (fused_experts, fused_experts_moge,
2627
select_experts)
2728
from vllm_ascend.utils import is_310p
@@ -33,7 +34,15 @@ def unquantized_fused_moe_init_func(self, *args, **kwargs):
3334
original_unquantized_fused_moe_init_func(self, *args, **kwargs)
3435
vllm_config = get_current_vllm_config()
3536
self.max_num_batched_tokens = vllm_config.scheduler_config.max_num_batched_tokens
36-
self.use_aclgraph = vllm_config.compilation_config.level == CompilationLevel.PIECEWISE and not vllm_config.model_config.enforce_eager
37+
38+
ascend_config = get_ascend_config()
39+
40+
if ascend_config.torchair_graph_config.enabled:
41+
self.use_aclgraph = False
42+
else:
43+
self.use_aclgraph = (vllm_config.compilation_config.level
44+
== CompilationLevel.PIECEWISE
45+
and not vllm_config.model_config.enforce_eager)
3746

3847

3948
def forward_oot(

vllm_ascend/ops/fused_moe.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1084,7 +1084,7 @@ def apply(
10841084
# this is a naive implementation for experts load balance so as
10851085
# to avoid accumulating too much tokens on a single rank.
10861086
# currently it is only activated when doing profile runs.
1087-
if enable_force_load_balance:
1087+
if enable_force_load_balance and not self.use_aclgraph:
10881088
topk_ids = torch.randint_like(topk_ids, 0, global_num_experts)
10891089

10901090
fused_moe_state = get_forward_context().fused_moe_state

0 commit comments

Comments
 (0)