-
-
Notifications
You must be signed in to change notification settings - Fork 250
[Docs] Service groups and Replica IP interpolation #4185
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
Open
Bihan
wants to merge
1
commit into
dstackai:master
Choose a base branch
from
Bihan:docs_service_groups_and_interpolation
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -291,7 +291,8 @@ Setting the minimum number of replicas to `0` allows the service to scale down t | |
| <span id="replica-groups"></span> | ||
|
|
||
| ??? info "Replica groups" | ||
| A service can include multiple replica groups. Each group can define its own `commands`, `resources` requirements, and `scaling` rules. | ||
| A service can define multiple replica groups. Each group has its own `replicas` count (or range), | ||
| `resources`, `commands`, and `scaling` rules. | ||
|
|
||
| <div editor-title="service.dstack.yml"> | ||
|
|
||
|
|
@@ -303,8 +304,8 @@ Setting the minimum number of replicas to `0` allows the service to scale down t | |
| env: | ||
| - MODEL_ID=deepseek-ai/DeepSeek-R1-Distill-Llama-8B | ||
|
|
||
| replicas: | ||
| - count: 1..2 | ||
| groups: | ||
| - replicas: 1..2 | ||
| scaling: | ||
| metric: rps | ||
| target: 10 | ||
|
|
@@ -317,7 +318,7 @@ Setting the minimum number of replicas to `0` allows the service to scale down t | |
| resources: | ||
| gpu: 48GB | ||
|
|
||
| - count: 1..4 | ||
| - replicas: 1..4 | ||
| scaling: | ||
| metric: rps | ||
| target: 5 | ||
|
|
@@ -336,7 +337,21 @@ Setting the minimum number of replicas to `0` allows the service to scale down t | |
|
|
||
| </div> | ||
|
|
||
| > Properties such as `regions`, `port`, `image`, `env` and some other cannot be configured per replica group. This support is coming soon. | ||
| [`groups`](../reference/dstack.yml/service.md#groups) and top-level [`replicas`](../reference/dstack.yml/service.md#replicas) are mutually exclusive. | ||
|
|
||
| > Properties such as `regions`, `port`, `env` and some other cannot be configured per replica group. This support is coming soon. | ||
|
|
||
| ### Accessing replica IPs | ||
|
Contributor
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. Shouldn't it be under "Replica groups" section? |
||
|
|
||
| Commands in any group can reference the internal IP address of any replica in the run via | ||
| `${{ groups[i].replicas[j].IP_ADDRESS }}`, where `i` is the index of the group in `groups` and `j` is | ||
| the index of the replica within that group. | ||
|
|
||
| > Only replicas guaranteed at start can be referenced: | ||
| > | ||
| > - `replicas: 2` → replica indexes `0` and `1` can be referenced | ||
| > - `replicas: 1..4` → replica index `0` can be referenced | ||
| > - `replicas: 0..4` → no replica indexes can be referenced | ||
|
|
||
| ### PD disaggregation | ||
|
|
||
|
|
@@ -363,9 +378,9 @@ Below is an example for running `zai-org/GLM-4.5-Air-FP8` on `H200`: | |
| - HF_TOKEN | ||
| - MODEL_ID=zai-org/GLM-4.5-Air-FP8 | ||
|
|
||
| replicas: | ||
| - count: 1 | ||
| # For now replica group with router must have count: 1 | ||
| groups: | ||
| - replicas: 1 | ||
| # For now the router group must have replicas: 1 | ||
| commands: | ||
| - pip install smg | ||
| - | | ||
|
|
@@ -379,7 +394,7 @@ Below is an example for running `zai-org/GLM-4.5-Air-FP8` on `H200`: | |
| router: | ||
| type: sglang | ||
|
|
||
| - count: 1..4 | ||
| - replicas: 1..4 | ||
| scaling: | ||
| metric: rps | ||
| target: 3 | ||
|
|
@@ -394,7 +409,7 @@ Below is an example for running `zai-org/GLM-4.5-Air-FP8` on `H200`: | |
| resources: | ||
| gpu: H200 | ||
|
|
||
| - count: 1..8 | ||
| - replicas: 1..8 | ||
| scaling: | ||
| metric: rps | ||
| target: 2 | ||
|
|
@@ -437,8 +452,8 @@ Below is an example for running `zai-org/GLM-4.5-Air-FP8` on `H200`: | |
| - HF_TOKEN | ||
| - MODEL_ID=zai-org/GLM-4.5-Air-FP8 | ||
|
|
||
| replicas: | ||
| - count: 1 | ||
| groups: | ||
| - replicas: 1 | ||
| docker: true | ||
| commands: | ||
| - apt-get update | ||
|
|
@@ -460,7 +475,7 @@ Below is an example for running `zai-org/GLM-4.5-Air-FP8` on `H200`: | |
| router: | ||
| type: dynamo | ||
|
|
||
| - count: 1..4 | ||
| - replicas: 1..4 | ||
| scaling: | ||
| metric: rps | ||
| target: 3 | ||
|
|
@@ -489,7 +504,7 @@ Below is an example for running `zai-org/GLM-4.5-Air-FP8` on `H200`: | |
| resources: | ||
| gpu: H200 | ||
|
|
||
| - count: 1..8 | ||
| - replicas: 1..8 | ||
| scaling: | ||
| metric: rps | ||
| target: 2 | ||
|
|
@@ -551,8 +566,8 @@ env: | |
| - RDMA_DEVICES=bnxt_re0,bnxt_re1,bnxt_re2,bnxt_re3,bnxt_re4,bnxt_re5,bnxt_re6,bnxt_re7 | ||
| - NCCL_IB_DISABLE=1 | ||
|
|
||
| replicas: | ||
| - count: 1 | ||
| groups: | ||
| - replicas: 1 | ||
| commands: | ||
| - pip install smg | ||
| - | | ||
|
|
@@ -565,7 +580,7 @@ replicas: | |
| router: | ||
| type: sglang | ||
|
|
||
| - count: 1..2 | ||
| - replicas: 1..2 | ||
| scaling: | ||
| metric: rps | ||
| target: 300 | ||
|
|
@@ -591,7 +606,7 @@ replicas: | |
| cpu: 96.. | ||
| memory: 512GB.. | ||
|
|
||
| - count: 1..4 | ||
| - replicas: 1..4 | ||
| scaling: | ||
| metric: rps | ||
| target: 300 | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why its collapsible section? Shouldn't we do it similar to Tasks - as a separate section?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, shouldn't we cross-link Replica groups and PD disaggregation sections?