Skip to content
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

optimize benchmark scripts for autoscaler, add more logs #356

Merged
merged 5 commits into from
Nov 11, 2024

Conversation

kr11
Copy link
Collaborator

@kr11 kr11 commented Nov 8, 2024

Pull Request Description

After optimizing some KPA configurations, KPA shows faster upscaling and better replica decisions, resulting in lower latency and higher throughput.

The main changes are:

  1. Changed the resync period from 30s to 10s.
  2. Fixed the KPA YAML config: the target value (50%) should be 0.5, not 50.
  3. Added more detailed logs.

Related Issues

Resolves: #[Insert issue number(s)]

Important: Before submitting, please complete the description above and review the checklist below.


Contribution Guidelines (Expand for Details)

We appreciate your contribution to aibrix! To ensure a smooth review process and maintain high code quality, please adhere to the following guidelines:

Pull Request Title Format

Your PR title should start with one of these prefixes to indicate the nature of the change:

  • [Bug]: Corrections to existing functionality
  • [CI]: Changes to build process or CI pipeline
  • [Docs]: Updates or additions to documentation
  • [API]: Modifications to aibrix's API or interface
  • [CLI]: Changes or additions to the Command Line Interface
  • [Misc]: For changes not covered above (use sparingly)

Note: For changes spanning multiple categories, use multiple prefixes in order of importance.

Submission Checklist

  • PR title includes appropriate prefix(es)
  • Changes are clearly explained in the PR description
  • New and existing tests pass successfully
  • Code adheres to project style and best practices
  • Documentation updated to reflect changes (if applicable)
  • Thorough testing completed, no regressions introduced

By submitting this PR, you confirm that you've read these guidelines and your changes align with the project's contribution standards.

@kr11 kr11 changed the title optimize benchmark scripts for autoscaler optimize benchmark scripts for autoscaler, add more logs Nov 8, 2024
@kr11 kr11 requested a review from Jeffwan November 8, 2024 06:48
Copy link
Collaborator

@Jeffwan Jeffwan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we deploy the autoscaler with other controllers, let's make sure we only print necessary logs, if you need additional debug logs, lets use right log level.

)
def setup_logging(log_filename, level=logging.INFO):
"""
设置全局日志配置,日志将被写入指定的文件,并同时输出到控制台。
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's remove non English characters in github repo. the policy is a different bit different from our internal repo

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrected it. thanks.

@@ -3,6 +3,7 @@
import os
import random
import time
from datetime import datetime
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@happyandslow Can you help review the benchmark changes?

@@ -11,8 +11,8 @@ spec:
apiVersion: apps/v1
kind: Deployment
name: aibrix-model-deepseek-coder-7b-instruct
minReplicas: 1
minReplicas: 2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we change to 2 here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Jeffwan
it's to align with hpa.

When our experiment started, the initial replicas of the llm service were set to 2, and we would wait for 30 seconds before adding traffic. We found that KPA would quickly reduce the replica to 1 as beginning, but HPA would not immediately scale down even without traffic. This would lead to an unfair experiment.

Should we uniformly set the min-replica of HPA.yaml and KPA.yaml to 2? I will modify the hpa.yaml to keep it consistent with the kpa.yaml.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

talked with @kr11 offline on this. We determined to change to 1.

@@ -202,6 +202,14 @@ func (k *KpaAutoscaler) Scale(originalReadyPodsCount int, metricKey metrics.Name

isOverPanicThreshold := dppc/readyPodsCount >= spec.PanicThreshold

klog.InfoS("--- KPA Details", "readyPodsCount", readyPodsCount,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this a debug message, if so, let's use V(4)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this a debug message, if so, let's use V(4)

I have fixed it together with two other debug klogs.

@Jeffwan Jeffwan merged commit 7a45b60 into main Nov 11, 2024
9 checks passed
@Jeffwan Jeffwan deleted the benchmark/autoscaling_bench_optimize branch November 11, 2024 07:04
gangmuk pushed a commit that referenced this pull request Jan 25, 2025
* optimize workload scripts and result output

* add more logs. resync period: 30->10, fix kpa.yaml

* fix lint

* add right klog level. unify min-replica in hpa.yaml and hpa.yaml

* unify hpa and kpa yaml min-replica to 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants