-
Notifications
You must be signed in to change notification settings - Fork 178
feat(policies): add least_load load-balancing policy #1629
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -149,7 +149,7 @@ struct CliArgs { | |
|
|
||
| // ==================== Routing Policy ==================== | ||
| /// Load balancing policy to use | ||
| #[arg(long, default_value = "cache_aware", value_parser = ["random", "round_robin", "cache_aware", "power_of_two", "prefix_hash", "consistent_hashing", "manual", "bucket"], help_heading = "Routing Policy")] | ||
| #[arg(long, default_value = "cache_aware", value_parser = ["random", "round_robin", "cache_aware", "power_of_two", "least_load", "prefix_hash", "consistent_hashing", "manual", "bucket"], help_heading = "Routing Policy")] | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When this policy is selected via the Helm chart, chart values validation still rejects it because Useful? React with 👍 / 👎. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested fix (fail closed until bucket parsing is explicit)- #[arg(long, default_value = "cache_aware", value_parser = ["random", "round_robin", "cache_aware", "power_of_two", "least_load", "prefix_hash", "consistent_hashing", "manual", "bucket"], help_heading = "Routing Policy")]
+ #[arg(long, default_value = "cache_aware", value_parser = ["random", "round_robin", "cache_aware", "power_of_two", "least_load", "prefix_hash", "consistent_hashing", "manual"], help_heading = "Routing Policy")]
@@
- #[arg(long, value_parser = ["random", "round_robin", "cache_aware", "power_of_two", "least_load", "prefix_hash", "consistent_hashing", "manual", "bucket"], help_heading = "PD Disaggregation")]
+ #[arg(long, value_parser = ["random", "round_robin", "cache_aware", "power_of_two", "least_load", "prefix_hash", "consistent_hashing", "manual"], help_heading = "PD Disaggregation")]
@@
- #[arg(long, value_parser = ["random", "round_robin", "cache_aware", "power_of_two", "least_load", "prefix_hash", "consistent_hashing", "manual", "bucket"], help_heading = "PD Disaggregation")]
+ #[arg(long, value_parser = ["random", "round_robin", "cache_aware", "power_of_two", "least_load", "prefix_hash", "consistent_hashing", "manual"], help_heading = "PD Disaggregation")]Also applies to: 217-222, 916-950 🤖 Prompt for AI Agents |
||
| policy: String, | ||
|
|
||
| /// Cache threshold (0.0-1.0) for cache-aware routing | ||
|
|
@@ -214,11 +214,11 @@ struct CliArgs { | |
| decode: Vec<String>, | ||
|
|
||
| /// Specific policy for prefill nodes in PD mode | ||
| #[arg(long, value_parser = ["random", "round_robin", "cache_aware", "power_of_two", "prefix_hash", "consistent_hashing", "manual", "bucket"], help_heading = "PD Disaggregation")] | ||
| #[arg(long, value_parser = ["random", "round_robin", "cache_aware", "power_of_two", "least_load", "prefix_hash", "consistent_hashing", "manual", "bucket"], help_heading = "PD Disaggregation")] | ||
| prefill_policy: Option<String>, | ||
|
|
||
| /// Specific policy for decode nodes in PD mode | ||
| #[arg(long, value_parser = ["random", "round_robin", "cache_aware", "power_of_two", "prefix_hash", "consistent_hashing", "manual", "bucket"], help_heading = "PD Disaggregation")] | ||
| #[arg(long, value_parser = ["random", "round_robin", "cache_aware", "power_of_two", "least_load", "prefix_hash", "consistent_hashing", "manual", "bucket"], help_heading = "PD Disaggregation")] | ||
| decode_policy: Option<String>, | ||
|
|
||
| /// Timeout in seconds for worker startup and registration | ||
|
|
@@ -928,6 +928,10 @@ impl CliArgs { | |
| "power_of_two" => PolicyConfig::PowerOfTwo { | ||
| load_check_interval_secs: 5, | ||
| }, | ||
| "least_load" => PolicyConfig::LeastLoad { | ||
| load_check_interval_secs: 5, | ||
| lambda: 1.5, | ||
| }, | ||
|
slin1237 marked this conversation as resolved.
|
||
| "prefix_hash" => PolicyConfig::PrefixHash { | ||
| prefix_token_count: self.prefix_token_count, | ||
| load_factor: self.prefix_hash_load_factor, | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.