Skip to content

Commit 84b9d38

Browse files
BugFix: Resolve PolicyFlashlb warm up function attribute error (#4741)
## Description Fix the AttributeError caused by incorrect invocation of the warm-up function in the FlashLB algorithm: 1. **Root Cause**: The warm-up function for FlashLB is defined outside the `PolicyFlashlb` class (not a class method), but the code incorrectly attempted to call it via the `PolicyFlashlb` class instance. 2. **Key Fix**: Clarify the invocation rule for FlashLB: when selecting the FlashLB algorithm, the warm-up function must be called in advance to precompile and warm up the algorithm (invoked as a standalone function), instead of calling it through the `PolicyFlashlb` class. 3. **Impact**: Resolve the runtime error when using FlashLB, ensure the algorithm pre-compilation/warm-up process works as expected, and avoid attribute missing exceptions. Signed-off-by: Mercykid-bash <[email protected]>
1 parent 4984e8a commit 84b9d38

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

vllm_ascend/eplb/core/policy/policy_factory.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from .policy_abstract import DynamicConfig, EplbPolicy
44
from .policy_dynamic_ep import DynamicEplb
55
from .policy_dynamic_ep_v2 import DynamicEplbV2
6-
from .policy_flashlb import FlashLB
6+
from .policy_flashlb import FlashLB, warm_up
77
from .policy_random import RandomLoadBalance
88

99

@@ -29,5 +29,5 @@ def generate_policy(policy_type: int, config: DynamicConfig) -> EplbPolicy:
2929
policy_class = policy.get(policy_type, RandomLoadBalance)
3030
policy_instance = policy_class(config)
3131
if policy_type == 3:
32-
policy_instance.warm_up()
33-
return policy_instance
32+
warm_up()
33+
return policy_instance

0 commit comments

Comments
 (0)