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

Add group size as an env var by default #203

Closed
3 tasks
Tracked by #161
ahg-g opened this issue Aug 31, 2024 · 9 comments
Closed
3 tasks
Tracked by #161

Add group size as an env var by default #203

ahg-g opened this issue Aug 31, 2024 · 9 comments
Assignees
Labels
kind/feature Categorizes issue or PR as related to a new feature.

Comments

@ahg-g
Copy link
Contributor

ahg-g commented Aug 31, 2024

What would you like to be added:

Add the group size as an env var

Why is this needed:

In most cases for multi-host inference, the size is needed, like in vllm.

Suggest to use LWS_GROUP_SIZE as the env var name.

Completion requirements:

This enhancement requires the following artifacts:

  • Design doc
  • API change
  • Docs update

The artifacts should be linked in subsequent comments.

@ahg-g ahg-g added the kind/feature Categorizes issue or PR as related to a new feature. label Aug 31, 2024
@liurupeng
Copy link
Collaborator

+1, this will be very helpful!

@googs1025
Copy link
Member

Can I try it? I will spend some time on it :)

@googs1025
Copy link
Member

/assign

@googs1025
Copy link
Member

friendly ping :) @ahg-g @liurupeng
This is an example I got. I want to know one thing. What we need to do is inject the spec.leaderWorkerTemplate.size field into the container, right?

apiVersion: leaderworkerset.x-k8s.io/v1
kind: LeaderWorkerSet
metadata:
  labels:
    app.kubernetes.io/name: leaderworkerset
    app.kubernetes.io/instance: leaderworkerset-multi-template
    app.kubernetes.io/part-of: lws
    app.kubernetes.io/managed-by: kustomize
    app.kubernetes.io/created-by: lws
  name: leaderworkerset-multi-template
spec:
  replicas: 3
  leaderWorkerTemplate:
    leaderTemplate:
      spec:
        containers:
        - name: nginx2
          image: nginx:1.14.2
          resources:
            limits:
              cpu: "100m"
            requests:
              cpu: "50m"
          ports:
          - containerPort: 8080
    size: 4
    workerTemplate:
      spec:
        containers:
        - name: nginx
          image: nginx:1.14.2
          resources:
            limits:
              cpu: "100m"
            requests:
              cpu: "50m"
          ports:
          - containerPort: 8080

@googs1025
Copy link
Member

If so, I plan to use this annotationKey directly to implement this feature

// Size will be added to leader pods as an annotation which corresponds to
// LeaderWorkerSet.Spec.LeaderWorkerTemplate.Size.
SizeAnnotationKey string = "leaderworkerset.sigs.k8s.io/size"

@liurupeng
Copy link
Collaborator

thanks for picking it up @googs1025

@googs1025
Copy link
Member

It's done now. If we have any questions, feel free to reopen. :)

@googs1025
Copy link
Member

/close

@k8s-ci-robot
Copy link
Contributor

@googs1025: Closing this issue.

In response to this:

/close

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

No branches or pull requests

4 participants