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

[k8s] Clarified the usage of shared memory. #4341

Merged
merged 1 commit into from
Mar 27, 2025

Conversation

jsuchome
Copy link
Contributor

@jsuchome jsuchome commented Mar 12, 2025

Added extended shared memory for default kubernetes manigest. Also, point various cache directories to writable /tmp so that pod does not need to be run as root.

Motivation

Added some more clarification for the usage of shared memory increase. It's necessary for single node installation too, if one wants to use some parallelism techniques. See #4259

Also, k8s pod does not need to run with root security context, but it needs some tinkering.

Modifications

  • small update on the parallelism docs page
  • extended basic k8s manifest to include increased shared memory volume
    - additionally added env variables to enforce creating caches in writable volume, so that the pod can be run as non-root

Checklist

@jsuchome jsuchome changed the title Clarified the usage of shared memory. [k8s] Clarified the usage of shared memory. Mar 12, 2025
@@ -21,6 +21,7 @@ python -m sglang.launch_server --model-path meta-llama/Meta-Llama-3-8B-Instruct
```

- See [hyperparameter tuning](hyperparameter_tuning.md) on tuning hyperparameters for better performance.
- For docker and Kubernetes runs, you need to set up shared memory which is used for communication between processes. See `--shm-size` for docker and `/dev/shm` size update for Kubernetes manifests.
Copy link
Contributor

Choose a reason for hiding this comment

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

good summary. but it seem this doc server_arguments.md is majorly for CLI (python run) use case.
if we aim for "docker"/"k8s", maybe this file is not suitable?
https://github.com/sgl-project/sglang/blob/main/docs/start/install.md

Copy link
Contributor Author

Choose a reason for hiding this comment

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

well, server_arguments.md is the only place where it summarize the parallelism runs, so I believe it should be mentioned thare (maybe among other places?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

also, as you wrote, in Docker part of https://github.com/sgl-project/sglang/blob/main/docs/start/install.md shared memory is already mentioned. And in Kubernetes section there's just a link to manifest, so I'm suggesting:

  • to modify single node manifest
  • to update the docs in the place where --tp is actually mentioned as server argument

@zhaochenyang20
Copy link
Collaborator

cc @whybeyoung could you take a look? thanks!

@jsuchome jsuchome force-pushed the k8smanifest branch 2 times, most recently from 865d476 to 3852603 Compare March 13, 2025 16:44
@zhaochenyang20
Copy link
Collaborator

@whybeyoung is it approved by you? if so, pass the CI . I can merge it

@zhaochenyang20
Copy link
Collaborator

I will remind @whybeyoung again.

@whybeyoung
Copy link
Contributor

/approve

@panpan0000
Copy link
Contributor

/lgtm

@jsuchome jsuchome force-pushed the k8smanifest branch 2 times, most recently from da6e5ec to 546144e Compare March 18, 2025 21:12
Added extended shared memory for default kubernetes manigest.
@jsuchome
Copy link
Contributor Author

I don't expect I am supposed to merge the PR, right? I keep rebasing it because it's offent out-of-sync, but than the approval status is lost...

@zhaochenyang20
Copy link
Collaborator

I don't expect I am supposed to merge the PR, right? I keep rebasing it because it's offent out-of-sync, but than the approval status is lost...

no need to rebase. We will merge this

@jsuchome
Copy link
Contributor Author

Hey, so what do you think about this? It's quite minor change, is there anything wrong with it?

@zhaochenyang20 zhaochenyang20 merged commit f60f293 into sgl-project:main Mar 27, 2025
1 of 17 checks passed
KCFindstr pushed a commit to KCFindstr/sglang that referenced this pull request Mar 27, 2025
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.

4 participants