-
Notifications
You must be signed in to change notification settings - Fork 154
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 deployment section with vLLM, TGI and NIM. Remove alignment handbook #1990
Open
Bihan
wants to merge
1
commit into
dstackai:master
Choose a base branch
from
Bihan:add_deployment_section
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 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
File renamed without changes.
Empty file.
Empty file.
This file contains 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 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 |
---|---|---|
@@ -1,23 +1,79 @@ | ||
# Text Generation Inference | ||
|
||
## Service | ||
This example shows how to deploy `mistralai/Mistral-7B-Instruct-v0.2` with `dstack` using [TGI :material-arrow-top-right-thin:{ .external }](https://huggingface.co/docs/text-generation-inference/en/index) | ||
|
||
The following command deploys Llama 7B Instruct as a service: | ||
??? info "Prerequisites" | ||
Once `dstack` is [installed](https://dstack.ai/docs/installation), go ahead clone the repo, and run `dstack init`. | ||
|
||
```shell | ||
dstack run . -f examples/deployment/tgi/serve.dstack.yml | ||
<div class="termy"> | ||
|
||
```shell | ||
$ git clone https://github.com/dstackai/dstack | ||
$ cd dstack | ||
$ dstack init | ||
``` | ||
|
||
</div> | ||
|
||
## Deployment | ||
|
||
### Running as a task | ||
If you'd like to run mistralai/Mistral-7B-Instruct-v0.2 for development purposes, consider using `dstack` [tasks](https://dstack.ai/docs/tasks/). | ||
<div editor-title="examples/deployment/tgi/serve-task.dstack.yml"> | ||
|
||
```yaml | ||
type: task | ||
# This task runs Llama 2 with TGI | ||
|
||
image: ghcr.io/huggingface/text-generation-inference:latest | ||
env: | ||
- HF_TOKEN | ||
- MODEL_ID=mistralai/Mistral-7B-Instruct-v0.2 | ||
commands: | ||
- text-generation-launcher --port 8000 --trust-remote-code | ||
ports: | ||
- 8000 | ||
|
||
resources: | ||
gpu: 24GB | ||
``` | ||
</div> | ||
|
||
### Deploying as a service | ||
|
||
See the configuration at [serve.dstack.yml](serve.dstack.yml). | ||
If you'd like to deploy the model as an auto-scalable and secure endpoint, | ||
use the [service](https://dstack.ai/docs/services) configuration. You can find it at [`examples/deployment/tgi/serve.dstack.yml` :material-arrow-top-right-thin:{ .external }](https://github.com/dstackai/dstack/blob/master/examples/deployment/tgi/serve.dstack.yml) | ||
|
||
## Task | ||
### Running a configuration | ||
|
||
The following command runs Llama 7B Instruct as a task: | ||
To run a configuration, use the [`dstack apply`](https://dstack.ai/docs/reference/cli/index.md#dstack-apply) command. | ||
|
||
<div class="termy"> | ||
|
||
```shell | ||
dstack run . -f examples/deployment/tgi/serve-task.dstack.yml | ||
$ HF_TOKEN=... | ||
$ dstack apply -f examples/deployment/tgi/serve-task.dstack.yml | ||
|
||
# BACKEND REGION RESOURCES SPOT PRICE | ||
1 tensordock unitedstates 2xCPU, 10GB, 1xRTX3090 (24GB) no $0.231 | ||
2 tensordock unitedstates 2xCPU, 10GB, 1xRTX3090 (24GB) no $0.242 | ||
3 tensordock india 2xCPU, 38GB, 1xA5000 (24GB) no $0.283 | ||
|
||
Submit a new run? [y/n]: y | ||
|
||
Provisioning... | ||
---> 100% | ||
``` | ||
</div> | ||
|
||
## Source code | ||
|
||
The source-code of this example can be found in | ||
[`examples/deployment/tgi` :material-arrow-top-right-thin:{ .external }](https://github.com/dstackai/dstack/blob/master/examples/deployment/tgi). | ||
|
||
See the configuration at [serve.dstack.yml](serve-task.dstack.yml). | ||
## What's next? | ||
|
||
For more details, refer to [services](https://dstack.ai/docs/services) or [tasks](https://dstack.ai/docs/tasks). | ||
1. Check [dev environments](https://dstack.ai/docs/dev-environments), [tasks](https://dstack.ai/docs/tasks), | ||
[services](https://dstack.ai/docs/services), and [protips](https://dstack.ai/docs/protips). | ||
2. Browse [Deployment on AMD :material-arrow-top-right-thin:{ .external }](https://dstack.ai/examples/accelerators/amd/) and | ||
[Deployment on TPU :material-arrow-top-right-thin:{ .external }](https://dstack.ai/examples/accelerators/tpu/). |
This file contains 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 |
---|---|---|
@@ -1,23 +1,79 @@ | ||
# vLLM | ||
This example shows how to deploy `NousResearch/Llama-2-7b-chat-hf` with `dstack` using [vLLM :material-arrow-top-right-thin:{ .external }](https://docs.vllm.ai/en/latest/) | ||
|
||
## Service | ||
??? info "Prerequisites" | ||
Once `dstack` is [installed](https://dstack.ai/docs/installation), go ahead clone the repo, and run `dstack init`. | ||
|
||
The following command deploys Llama 7B Instruct as a service: | ||
<div class="termy"> | ||
|
||
```shell | ||
$ git clone https://github.com/dstackai/dstack | ||
$ cd dstack | ||
$ dstack init | ||
``` | ||
|
||
</div> | ||
|
||
```shell | ||
dstack run . -f examples/deployment/vllm/serve.dstack.yml | ||
## Deployment | ||
|
||
### Running as a task | ||
If you'd like to run NousResearch/Llama-2-7b-chat-hf for development purposes, consider using `dstack` [tasks](https://dstack.ai/docs/tasks/). | ||
<div editor-title="examples/deployment/vllm/serve-task.dstack.yml"> | ||
|
||
```yaml | ||
type: task | ||
# This task runs Llama 2 with vllm | ||
|
||
image: vllm/vllm-openai:latest | ||
env: | ||
- MODEL=NousResearch/Llama-2-7b-chat-hf | ||
- PYTHONPATH=/workspace | ||
commands: | ||
- python3 -m vllm.entrypoints.openai.api_server --model $MODEL --port 8000 | ||
ports: | ||
- 8000 | ||
|
||
resources: | ||
gpu: 24GB | ||
``` | ||
|
||
See the configuration at [serve.dstack.yml](serve.dstack.yml). | ||
</div> | ||
|
||
### Deploying as a service | ||
|
||
If you'd like to deploy the model as an auto-scalable and secure endpoint, | ||
use the [service](https://dstack.ai/docs/services) configuration. You can find it at [`examples/deployment/vllm/serve.dstack.yml` :material-arrow-top-right-thin:{ .external }](https://github.com/dstackai/dstack/blob/master/examples/deployment/vllm/serve.dstack.yml) | ||
|
||
## Task | ||
### Running a configuration | ||
|
||
The following command runs Llama 7B Instruct as a task: | ||
To run a configuration, use the [`dstack apply`](https://dstack.ai/docs/reference/cli/index.md#dstack-apply) command. | ||
|
||
<div class="termy"> | ||
|
||
```shell | ||
dstack run . -f examples/deployment/vllm/serve-task.dstack.yml | ||
$ dstack apply -f examples/deployment/vllm/serve-task.dstack.yml | ||
|
||
# BACKEND REGION INSTANCE RESOURCES SPOT PRICE | ||
1 cudo ca-montreal-1 intel-broadwell 2xCPU, 8GB, no $0.0276 | ||
2 cudo ca-montreal-2 intel-broadwell 2xCPU, 8GB, no $0.0286 | ||
3 cudo fi-tampere-1 intel-broadwell 2xCPU, 8GB, no $0.0383 | ||
|
||
Submit a new run? [y/n]: y | ||
|
||
Provisioning... | ||
---> 100% | ||
``` | ||
</div> | ||
|
||
## Source code | ||
|
||
The source-code of this example can be found in | ||
[`examples/deployment/vllm` :material-arrow-top-right-thin:{ .external }](https://github.com/dstackai/dstack/blob/master/examples/deployment/vllm). | ||
|
||
See the configuration at [serve.dstack.yml](serve-task.dstack.yml). | ||
## What's next? | ||
|
||
For more details, refer to [services](https://dstack.ai/docs/services) or [tasks](https://dstack.ai/docs/tasks). | ||
1. Check [dev environments](https://dstack.ai/docs/dev-environments), [tasks](https://dstack.ai/docs/tasks), | ||
[services](https://dstack.ai/docs/services), and [protips](https://dstack.ai/docs/protips). | ||
2. Browse [Deployment on AMD :material-arrow-top-right-thin:{ .external }](https://dstack.ai/examples/accelerators/amd/) and | ||
[Deployment on TPU :material-arrow-top-right-thin:{ .external }](https://dstack.ai/examples/accelerators/tpu/). | ||
|
This file contains 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 |
---|---|---|
|
@@ -10,5 +10,5 @@ commands: | |
ports: | ||
- 8000 | ||
|
||
resources: | ||
gpu: 24GB | ||
#resources: | ||
# gpu: 24GB |
This file contains 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
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.
I'd suggest use Llama 3.1 instead of Mistral...