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

switch to using upstream vllm with new metric #54

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

coolkp
Copy link
Contributor

@coolkp coolkp commented Nov 22, 2024

  • switch to using upstream vllm with new metric
  • use latest series in gauge metric vllm:lora_requests_info using the time value of the series
  • Use label pair running_lora_adapters
  • update vllm example deployment to use latest
    Fixes Switch to upstream vLLM #22

@k8s-ci-robot k8s-ci-robot added the do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. label Nov 22, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: coolkp
Once this PR has been reviewed and has the lgtm label, please assign terrytangyuan for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 22, 2024
@coolkp coolkp changed the title switch to using upstream vllm with new metric Fixes #22 switch to using upstream vllm with new metric Nov 22, 2024
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. label Nov 22, 2024
@coolkp
Copy link
Contributor Author

coolkp commented Nov 22, 2024

/assign conliu

@k8s-ci-robot
Copy link
Contributor

@coolkp: GitHub didn't allow me to assign the following users: conliu.

Note that only kubernetes-sigs members with read permissions, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time.
For more information please see the contributor guide

In response to this:

/assign conliu

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Copy link
Contributor

@liu-cong liu-cong left a comment

Choose a reason for hiding this comment

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

Overall lgtm. Will lgtm once PR is updated with benchmark numbers.

@@ -15,7 +15,7 @@ spec:
spec:
containers:
- name: lora
image: "ghcr.io/tomatillo-and-multiverse/vllm:demo"
image: "vllm/vllm-openai:latest"
Copy link
Contributor

Choose a reason for hiding this comment

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

let's pin to a digest instead of latest.

klog "k8s.io/klog/v2"
)

const (
ActiveLoRAAdaptersMetricName = "vllm:info_active_adapters_info"
LoraRequestInfoMetricName = "vllm:lora_requests_info"
LoraRequestInfoMetricNameRunningAdapters = "running_adapters"
Copy link
Contributor

Choose a reason for hiding this comment

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

LoraRequestInfoMetricNameRunningAdapters -> LoraRequestInfoRunningAdaptersMetricName

ActiveLoRAAdaptersMetricName = "vllm:info_active_adapters_info"
LoraRequestInfoMetricName = "vllm:lora_requests_info"
LoraRequestInfoMetricNameRunningAdapters = "running_adapters"
LoraRequestInfoMetricNameMaxAdapters = "max_lora"
Copy link
Contributor

Choose a reason for hiding this comment

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

LoraRequestInfoMaxAdaptersMetricName

}

return updated, errs
}

// getLatestLoraMetric gets latest lora metric series in gauge metric family `vllm:lora_requests_info`
// reason its specially fetched is because each label key value pair permutation generates new series
// and only most recent is useful. This is timestamp metric so value of each series is the creation timestamp.
Copy link
Contributor

Choose a reason for hiding this comment

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

This is timestamp metric so value of each series is the creation timestamp. -> The value of each series is the creation timestamp so we can retrieve the latest by sorting the value.

}
return latest, time.Unix(0, int64(latestTs*1000)), nil
}

// getLatestMetric gets the latest metric of a family. This should be used to get the latest Gauge metric.
func getLatestMetric(metricFamilies map[string]*dto.MetricFamily, metricName string) (*dto.Metric, time.Time, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add a comment there that vllm doesn't set the metric timestamp, so this function essentially selects the first metric. This helps clarify why we need the getLatestLoraMetric function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Switch to upstream vLLM
3 participants