Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 58 additions & 1 deletion docs/docs/concepts/backends.md
Original file line number Diff line number Diff line change
Expand Up @@ -1060,7 +1060,64 @@ projects:

Ensure you've created a ClusterRoleBinding to grant the role to the user or the service account you're using.

> To learn more, see the [Lambda](../../examples/clusters/lambda/#kubernetes) and [Lambda](../../examples/clusters/crusoe/#kubernetes) examples.
??? info "Resources and offers"
[Resources](../concepts/tasks.md#resources) specified in the run configuration are translated to Kubernetes
[requests and limits](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#requests-and-limits) as follows:

- As with other backends, an exact value is translated to a range with the same lower and upper limits,
e.g., `cpu: 4` is the same as `cpu: 4..4`.
- The lower limit, if set, is used as a resource request, meaning that it is guaranteed that the container has at least the specified
amount of the resource.
- For resources other than `gpu`, the upper limit, if set, is used as a resource limit, meaning that the container is not allowed
to consume more resources than specified. If the upper limit is not set, the resource limit is also not set.
- For `gpu` resources, the upper limit is always ignored, and the resource limit is always set to the same value as the resource request,
that is, to the lower limit of the range.

For example, the following resources specification:

<div editor-title=".dstack.yml">

```yaml
resources:
cpu: 32..64
memory: 1024GB
disk: 100GB..
gpu: nvidia:4..8
```

</div>

is translated to:

| resource | request | limit |
|---------------------|----------|-----------|
| `cpu` | `32` | `64` |
| `memory` | `1024Gi` | `1024Gi` |
| `ephemeral-storage` | `100Gi` | _not set_ |
| `nvidia.com/gpu` | `4` | `4` |

In offers, `dstack` uses resource requests as offer's resources.
With the resources spec as in the example above, offers would look like the following,
even if nodes have more available resources:

```
# BACKEND RESOURCES INSTANCE TYPE PRICE
1 kubernetes (-) cpu=32 mem=1024GB disk=100GB H100:80GB:4 h100x8 $0
```

As a consequence, if you specify `gpu: 0` or don't specify `gpu` at all (the default value is `0`),
you won't see GPU resources in offers, even with GPU nodes. The same is true for the `dstack offer` command,
to see available GPU models, you should specify a miminum amount of GPUs > 0:

<div class="termy">

```shell
$ dstack offer --gpu 1
```

</div>

> To learn more, see the [Lambda](../../examples/clusters/lambda/#kubernetes) and [Crusoe](../../examples/clusters/crusoe/#kubernetes) examples.

### RunPod

Expand Down
Loading