Skip to content

Commit

Permalink
- Fixed reference/api/python (style and content)
Browse files Browse the repository at this point in the history
- Renamed `guides/clouds` to `configuration/server`
- Refactored the CTA on the home page
  • Loading branch information
peterschmidt85 committed Oct 23, 2023
1 parent e27808f commit 55928ec
Show file tree
Hide file tree
Showing 21 changed files with 109 additions and 77 deletions.
2 changes: 1 addition & 1 deletion ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

## Overview

The `dstack` toolkit consists of five major components:
The `dstack` platform consists of five major components:

* the server
* the Python API
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</h1>

<h3 align="center">
Orchestrate GPU workloads across clouds
Effortlessly train and deploy generative AI
</h3>

<p align="center">
Expand All @@ -23,7 +23,7 @@ Orchestrate GPU workloads across clouds
[![PyPI - License](https://img.shields.io/pypi/l/dstack?style=flat-square&color=blue)](https://github.com/dstackai/dstack/blob/master/LICENSE.md)
</div>

`dstack` is an open-source toolkit for training, fine-tuning, and deployment of
`dstack` is an open-source platform for training, fine-tuning, and deployment of
generative AI models across various cloud providers (e.g., AWS, GCP, Azure, Lambda Cloud, etc.)

## Latest news ✨
Expand Down Expand Up @@ -57,7 +57,7 @@ $ pip install "dstack[all]" -U
If you have default AWS, GCP, or Azure credentials on your machine, `dstack` will pick them up automatically.

Otherwise, you need to manually specify the cloud credentials in `~/.dstack/server/config.yml`.
For further cloud configuration details, refer to [Clouds](https://dstack.ai/docs/guides/clouds.md).
For further cloud configuration details, refer to [Clouds](https://dstack.ai/docs/configuration/server).

### Start the server

Expand Down
33 changes: 24 additions & 9 deletions docs/assets/stylesheets/extra.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
}

[dir=ltr] .md-header__source {
margin-left: 0.2rem;
margin-left: 0;
width: 10rem;
}

.md-source__facts {
Expand Down Expand Up @@ -352,6 +353,13 @@ h4.doc-heading {
margin: 0 4px;
}

.md-typeset :is(h2, h3, h4) > code {
background-color: inherit;
color: inherit;
padding: 0;
margin: 0;
}

.md-typeset :not(td, pre, h2, h3, h4) > code {
font-size: 0.65rem;
}
Expand Down Expand Up @@ -993,8 +1001,8 @@ html .md-footer-meta.md-typeset a:is(:focus,:hover) {
}

.md-tabs__item:nth-child(n+5) .md-tabs__link:before {
width: 30px;
height: 30px;
width: 38px;
height: 38px;
margin-top: 6px;
visibility: visible;
}
Expand All @@ -1005,8 +1013,8 @@ html .md-footer-meta.md-typeset a:is(:focus,:hover) {
}

.md-tabs__item:nth-child(n+6) .md-tabs__link:before {
width: 30px;
height: 30px;
width: 38px;
height: 38px;
margin-top: 6px;
visibility: visible;
}
Expand All @@ -1024,11 +1032,11 @@ html .md-footer-meta.md-typeset a:is(:focus,:hover) {
}*/

.md-tabs__item:nth-child(5) .md-tabs__link:before {
content: url('data:image/svg+xml,<svg width="32" height="32" viewBox="-10 40 300 170" version="1.1" xmlns="http://www.w3.org/2000/svg"><g><path d="M216.856339,16.5966031 C200.285002,8.84328665 182.566144,3.2084988 164.041564,0 C161.766523,4.11318106 159.108624,9.64549908 157.276099,14.0464379 C137.583995,11.0849896 118.072967,11.0849896 98.7430163,14.0464379 C96.9108417,9.64549908 94.1925838,4.11318106 91.8971895,0 C73.3526068,3.2084988 55.6133949,8.86399117 39.0420583,16.6376612 C5.61752293,67.146514 -3.4433191,116.400813 1.08711069,164.955721 C23.2560196,181.510915 44.7403634,191.567697 65.8621325,198.148576 C71.0772151,190.971126 75.7283628,183.341335 79.7352139,175.300261 C72.104019,172.400575 64.7949724,168.822202 57.8887866,164.667963 C59.7209612,163.310589 61.5131304,161.891452 63.2445898,160.431257 C105.36741,180.133187 151.134928,180.133187 192.754523,160.431257 C194.506336,161.891452 196.298154,163.310589 198.110326,164.667963 C191.183787,168.842556 183.854737,172.420929 176.223542,175.320965 C180.230393,183.341335 184.861538,190.991831 190.096624,198.16893 C211.238746,191.588051 232.743023,181.531619 254.911949,164.955721 C260.227747,108.668201 245.831087,59.8662432 216.856339,16.5966031 Z M85.4738752,135.09489 C72.8290281,135.09489 62.4592217,123.290155 62.4592217,108.914901 C62.4592217,94.5396472 72.607595,82.7145587 85.4738752,82.7145587 C98.3405064,82.7145587 108.709962,94.5189427 108.488529,108.914901 C108.508531,123.290155 98.3405064,135.09489 85.4738752,135.09489 Z M170.525237,135.09489 C157.88039,135.09489 147.510584,123.290155 147.510584,108.914901 C147.510584,94.5396472 157.658606,82.7145587 170.525237,82.7145587 C183.391518,82.7145587 193.761324,94.5189427 193.539891,108.914901 C193.539891,123.290155 183.391518,135.09489 170.525237,135.09489 Z" fill="none" stroke="black" stroke-width="22px" stroke-linejoin="round" stroke-linecap="round" shape-rendering="geometricPrecision"></path></g></svg>');
content: url('data:image/svg+xml,<svg width="38" height="38" viewBox="-10 40 300 170" version="1.1" xmlns="http://www.w3.org/2000/svg"><g><path d="M216.856339,16.5966031 C200.285002,8.84328665 182.566144,3.2084988 164.041564,0 C161.766523,4.11318106 159.108624,9.64549908 157.276099,14.0464379 C137.583995,11.0849896 118.072967,11.0849896 98.7430163,14.0464379 C96.9108417,9.64549908 94.1925838,4.11318106 91.8971895,0 C73.3526068,3.2084988 55.6133949,8.86399117 39.0420583,16.6376612 C5.61752293,67.146514 -3.4433191,116.400813 1.08711069,164.955721 C23.2560196,181.510915 44.7403634,191.567697 65.8621325,198.148576 C71.0772151,190.971126 75.7283628,183.341335 79.7352139,175.300261 C72.104019,172.400575 64.7949724,168.822202 57.8887866,164.667963 C59.7209612,163.310589 61.5131304,161.891452 63.2445898,160.431257 C105.36741,180.133187 151.134928,180.133187 192.754523,160.431257 C194.506336,161.891452 196.298154,163.310589 198.110326,164.667963 C191.183787,168.842556 183.854737,172.420929 176.223542,175.320965 C180.230393,183.341335 184.861538,190.991831 190.096624,198.16893 C211.238746,191.588051 232.743023,181.531619 254.911949,164.955721 C260.227747,108.668201 245.831087,59.8662432 216.856339,16.5966031 Z M85.4738752,135.09489 C72.8290281,135.09489 62.4592217,123.290155 62.4592217,108.914901 C62.4592217,94.5396472 72.607595,82.7145587 85.4738752,82.7145587 C98.3405064,82.7145587 108.709962,94.5189427 108.488529,108.914901 C108.508531,123.290155 98.3405064,135.09489 85.4738752,135.09489 Z M170.525237,135.09489 C157.88039,135.09489 147.510584,123.290155 147.510584,108.914901 C147.510584,94.5396472 157.658606,82.7145587 170.525237,82.7145587 C183.391518,82.7145587 193.761324,94.5189427 193.539891,108.914901 C193.539891,123.290155 183.391518,135.09489 170.525237,135.09489 Z" fill="none" stroke="black" stroke-width="22px" stroke-linejoin="round" stroke-linecap="round" shape-rendering="geometricPrecision"></path></g></svg>');
}

.md-tabs__item:nth-child(6) .md-tabs__link:before {
content: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" viewBox="0 0 24 24" fill="black" stroke="none"><path d="M18.901 1.153h3.68l-8.04 9.19L24 22.846h-7.406l-5.8-7.584-6.638 7.584H.474l8.6-9.83L0 1.154h7.594l5.243 6.932ZM17.61 20.644h2.039L6.486 3.24H4.298Z"></path></svg>');
content: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" viewBox="0 0 24 24" fill="black" stroke="none"><path d="M18.901 1.153h3.68l-8.04 9.19L24 22.846h-7.406l-5.8-7.584-6.638 7.584H.474l8.6-9.83L0 1.154h7.594l5.243 6.932ZM17.61 20.644h2.039L6.486 3.24H4.298Z"></path></svg>');
}

.md-tabs__link {
Expand Down Expand Up @@ -1080,10 +1088,16 @@ html .md-footer-meta.md-typeset a:is(:focus,:hover) {
opacity: 1;
}

[dir=ltr] .md-source__icon+.md-source__repository {
margin-left: -2.6rem !important;
}

.md-source__icon.md-icon svg {
height: 1.4rem;
width: 1.4rem;
height: 1.38rem;
width: 1.38rem;
fill: none;
margin-left: -0.1rem;
margin-top: 0.61rem;
}

.md-source__facts {
Expand All @@ -1097,6 +1111,7 @@ html .md-footer-meta.md-typeset a:is(:focus,:hover) {
@media screen and (min-width: 76.25em) {
.md-search .md-search__inner {
padding-top: 0.2rem;
margin-right: 0.8rem;
}

[data-md-toggle=search]:checked ~ .md-header .md-search__inner, .md-search__scrollwrap {
Expand Down
2 changes: 1 addition & 1 deletion docs/assets/stylesheets/landing.css
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
position: relative;
left: 50%;
transform: translateX(-50%);
margin-top: 3rem;
margin-top: 2.5rem;
padding-top: 4.5rem;
padding-bottom: 4.5rem;
/*border-top-left-radius: 2.5rem;*/
Expand Down
4 changes: 2 additions & 2 deletions docs/blog/posts/simplified-cloud-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ projects:
</div>
Regions and other settings are optional. Learn more on what credential types are supported
via [Clouds](../../docs/guides/clouds.md).
via [Clouds](../../docs/configuration/server.md).
## Enhanced API
Expand Down Expand Up @@ -98,7 +98,7 @@ This means you'll need to delete `~/.dstack` and configure `dstack` from scratch

1. `pip install "dstack[all]==0.12.0"`
2. Delete `~/.dstack`
3. Configure clouds via `~/.dstack/server/config.yml` (see the [new guide](../../docs/guides/clouds.md))
3. Configure clouds via `~/.dstack/server/config.yml` (see the [new guide](../../docs/configuration/server.md))
4. Run `dstack server`

The [documentation](../../docs/index.md) and [examples](../../examples/index.md) are updated.
Expand Down
15 changes: 9 additions & 6 deletions docs/docs/guides/clouds.md → docs/docs/configuration/server.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
# Clouds
# Server configuration

For every project, `dstack` allows you to configure and use multiple cloud accounts.
The `dstack` server manages your workloads' state and orchestrates them across configured cloud providers.

To configure a cloud account, provide its credentials and other settings via `~/.dstack/server/config.yml`
under the `backends` property of the respective project.
For flexibility, the server allows you to configure multiple projects and users. Within each project, you can set up
multiple cloud accounts.

To configure a cloud account, specify its settings in `~/.dstack/server/config.yml` under the `backends` property
of the respective project.

Example:

Expand All @@ -28,7 +31,7 @@ projects:
[//]: # (If you run the `dstack` server without creating `~/.dstack/server/config.yml`, `dstack` will attempt to automatically detect the)
[//]: # (default credentials for AWS, GCP, and Azure and create the configuration.)

## Credentials
## Cloud credentials

### AWS

Expand Down Expand Up @@ -249,7 +252,7 @@ projects:

</div>

## Other settings
## Cloud regions

In addition to credentials, each cloud optionally allows for region configuration.

Expand Down
15 changes: 6 additions & 9 deletions docs/docs/guides/fine-tuning.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ Hugging Face model with SFT or DPO techniques in your cloud with just one line o
pip install "dstack[all]==0.12.1rc1"
```

Also, make sure you've configured clouds and started the server.

First, you connect to the `dstack` server:

```python
Expand All @@ -29,7 +31,6 @@ from dstack.api.huggingface import SFTFineTuningTask

task = SFTFineTuningTask(model_name="NousResearch/Llama-2-13b-hf",
dataset_name="peterschmidt85/samsum",
new_model_name="Llama-2-13b-samsum",
num_train_epochs=2,
env={
"`HUGGING_FACE_HUB_TOKEN`": "...",
Expand All @@ -45,24 +46,20 @@ And finally, submit the task:
from dstack.api import Resources, GPU

run = client.runs.submit(
run_name="Llama-2-13b-samsum",
run_name="Llama-2-13b-samsum", # (Optional) If unset, its chosen randomly
configuration=task,
resources=Resources(gpu=GPU(memory="24GB", count=4)),
)
```

`dstack` automatically provisions necessary resources in the configured cloud, does training, and pushes
the final model to the Hugging Face hub.

## Integrations
When submitting a task, you can configure resources, along with [many other options](../../docs/reference/api/python/index.md#dstack.api.RunCollection.submit).

To track experiment metrics, specify `report_to` and related authentication environment variables. Currently, the API
supports `"tensorboard"` and `"wandb"`:

```python
task = SFTFineTuningTask(model_name="NousResearch/Llama-2-13b-hf",
dataset_name="peterschmidt85/samsum",
new_model_name="Llama-2-13b-samsum",
num_train_epochs=2,
report_to="wandb",
env={
Expand All @@ -74,7 +71,7 @@ task = SFTFineTuningTask(model_name="NousResearch/Llama-2-13b-hf",

[//]: # (TODO: Add W&B screenshot)

You can use the [methods](../../docs/reference/api/python/index.md#dstack.api.Client) on `dstack.api.Client` to manage your runs, including getting a list of runs, stopping a given
You can use the [methods](../../docs/reference/api/python/index.md#dstack.api.Client) on `client` to manage your runs, including getting a list of runs, stopping a given
run, etc.

The `dstack.api.Client.runs.submit` allows for configuring resources as well as [many other options](../../docs/reference/api/python/index.md#dstack.api.RunCollection.submit).
When the training is done, `dstack` pushes the final model to the Hugging Face hub.
10 changes: 5 additions & 5 deletions docs/docs/index.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Quickstart

`dstack` is an open-source toolkit for training, fine-tuning, and deployment of
`dstack` is an open-source platform for training, fine-tuning, and deployment of
generative AI models across various cloud providers. (1)
{ .annotate }

1. You can use various cloud accounts (e.g., AWS, GCP, Azure, Lambda Cloud) by configuring
their credentials. The framework can optimize costs by running workloads across multiple
their credentials. The platform can optimize costs by running workloads across multiple
regions and cloud accounts.

## Set up the server
Expand All @@ -31,12 +31,12 @@ $ pip install "dstack[all]" -U

Another way to install the server is through [Docker](https://hub.docker.com/r/dstackai/dstack).

### Configure clouds
### Configure the server

If you have default AWS, GCP, or Azure credentials on your machine, `dstack` will pick them up automatically.
If you have default AWS, GCP, or Azure credentials on your machine, the `dstack` server will pick them up automatically.

Otherwise, you need to manually specify the cloud credentials in `~/.dstack/server/config.yml`.
For further cloud configuration details, refer to [Clouds](guides/clouds.md).
For further details, refer to [server configuration](configuration/server.md).

### Start the server

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/installation/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ $ docker run --name dstack -p &lt;port-on-host&gt;:3000 \

!!! info "Configure clouds"
Upon startup, the server sets up the default project called `main`.
Prior to using `dstack`, make sure to [configure clouds](../guides/clouds.md#configure-backends).
Prior to using `dstack`, make sure to [configure clouds](../configuration/server.md).

## Environment variables

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/installation/pip.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ The server is available at http://127.0.0.1:3000?token=b934d226-e24a-4eab-eb92b3

!!! info "Configure clouds"
Upon startup, the server sets up the default project called `main`.
Prior to using `dstack`, make sure to [configure clouds](../guides/clouds.md#configure-backends).
Prior to using `dstack`, make sure to [configure clouds](../configuration/server.md).
20 changes: 10 additions & 10 deletions docs/docs/reference/api/python/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@

The Python API allows for running tasks, services, and managing runs programmatically.

## dstack.api { #dstack.api }
## `dstack.api` { #dstack.api data-toc-label="dstack.api" }

### dstack.api.Client { #dstack.api.Client data-toc-label="Client" }
### `dstack.api.Client` { #dstack.api.Client data-toc-label="Client" }

::: dstack.api.Client
options:
show_root_heading: false
show_root_toc_entry: false
heading_level: 4

### dstack.api.Task { #dstack.api.Task data-toc-label="Task" }
### `dstack.api.Task` { #dstack.api.Task data-toc-label="Task" }

::: dstack.api.Task
options:
Expand All @@ -21,7 +21,7 @@ The Python API allows for running tasks, services, and managing runs programmati
show_root_toc_entry: false
heading_level: 4

### dstack.api.Service { #dstack.api.Service data-toc-label="Service" }
### `dstack.api.Service` { #dstack.api.Service data-toc-label="Service" }

::: dstack.api.Service
options:
Expand All @@ -30,7 +30,7 @@ The Python API allows for running tasks, services, and managing runs programmati
show_root_toc_entry: false
heading_level: 4

### dstack.api.Run { ##dstack.api.Run data-toc-label="Run" }
### `dstack.api.Run` { ##dstack.api.Run data-toc-label="Run" }

::: dstack.api.Run
options:
Expand All @@ -39,33 +39,33 @@ The Python API allows for running tasks, services, and managing runs programmati
show_root_toc_entry: false
heading_level: 4

### dstack.api.Client.runs { #dstack.api.Client.runs data-toc-label="runs" }
### `dstack.api.Client.runs` { #dstack.api.Client.runs data-toc-label="runs" }

::: dstack.api.RunCollection
options:
show_symbol_type_heading: true
show_root_toc_entry: false
heading_level: 4

### dstack.api.Client.repos { #dstack.api.Client.repos data-toc-label="repos" }
### `dstack.api.Client.repos` { #dstack.api.Client.repos data-toc-label="repos" }

::: dstack.api.RepoCollection
options:
show_root_heading: false
show_root_toc_entry: false
heading_level: 4

### dstack.api.Client.backends { #dstack.api.Client.backends data-toc-label="backends" }
### `dstack.api.Client.backends` { #dstack.api.Client.backends data-toc-label="backends" }

::: dstack.api.BackendCollection
options:
show_root_heading: false
show_root_toc_entry: false
heading_level: 4

## dstack.api.huggingface
## `dstack.api.huggingface` { #dstack.api.huggingface data-toc-label="dstack.api.huggingface" }

### dstack.api.huggingface.SFTFineTuningTask { #dstack.api.huggingface.SFTFineTuningTask data-toc-label="SFTFineTuningTask" }
### `dstack.api.huggingface.SFTFineTuningTask` { #dstack.api.huggingface.SFTFineTuningTask data-toc-label="SFTFineTuningTask" }

::: dstack.api.huggingface.SFTFineTuningTask
options:
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/stable-diffusion-xl.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ commands:
## Run the configuration
!!! warning "NOTE:"
Before running a service, ensure that you have configured a [gateway](../docs/guides/clouds.md#configuring-gateways).
Before running a service, ensure that you have configured a [gateway](../docs/guides/services.md#set-up-a-gateway).
After the gateway is configured, go ahead run the service.
Expand All @@ -204,7 +204,7 @@ $ dstack run . -f stable-diffusion-xl/api.dstack.yml
</div>

!!! info "Endpoint URL"
If you've configured a [wildcard domain](../docs/guides/clouds.md#configuring-gateways) for the gateway,
If you've configured a [wildcard domain](../docs/guides/services.md#set-up-a-gateway) for the gateway,
`dstack` enables HTTPS automatically and serves the service at
`https://<run name>.<your domain name>`.

Expand Down
Loading

0 comments on commit 55928ec

Please sign in to comment.