Fix code examples (#928)

This commit is contained in:
pollfly 2024-09-12 11:57:39 +03:00 committed by GitHub
parent d35b1a221e
commit 00c903b052
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -39,28 +39,33 @@ clearml-agent daemon <arguments> --stop
### Allocating Resources ### Allocating Resources
To specify GPUs associated with the agent, add the `--gpus` flag. To specify GPUs associated with the agent, add the `--gpus` flag.
:::info Docker Mode
Make sure to include the `--docker` flag, as GPU management through the agent is only supported in [Docker Mode](clearml_agent_execution_env.md#docker-mode).
:::
To execute multiple agents on the same machine (usually assigning GPU for the different agents), run: To execute multiple agents on the same machine (usually assigning GPU for the different agents), run:
```bash ```bash
clearml-agent daemon --detached --queue default --gpus 0 clearml-agent daemon --gpus 0 --queue default --docker
clearml-agent daemon --detached --queue default --gpus 1 clearml-agent daemon --gpus 1 --queue default --docker
``` ```
To allocate more than one GPU, provide a list of allocated GPUs To allocate more than one GPU, provide a list of allocated GPUs
```bash ```bash
clearml-agent daemon --gpus 0,1 --queue dual_gpu clearml-agent daemon --gpus 0,1 --queue dual_gpu --docker
``` ```
### Queue Prioritization ### Queue Prioritization
A single agent can listen to multiple queues. The priority is set by their order. A single agent can listen to multiple queues. The priority is set by their order.
```bash ```bash
clearml-agent daemon --detached --queue high_q low_q --gpus 0 clearml-agent daemon --queue high_q low_q
``` ```
This ensures the agent first tries to pull a Task from the `high_q` queue, and only if it is empty, the agent will try to pull This ensures the agent first tries to pull a Task from the `high_q` queue, and only if it is empty, the agent will try to pull
from the `low_q` queue. from the `low_q` queue.
To make sure an agent pulls from all queues equally, add the `--order-fairness` flag. To make sure an agent pulls from all queues equally, add the `--order-fairness` flag.
```bash ```bash
clearml-agent daemon --detached --queue group_a group_b --order-fairness --gpus 0 clearml-agent daemon --queue group_a group_b --order-fairness
``` ```
It will make sure the agent will pull from the `group_a` queue, then from `group_b`, then back to `group_a`, etc. This ensures It will make sure the agent will pull from the `group_a` queue, then from `group_b`, then back to `group_a`, etc. This ensures
that `group_a` or `group_b` will not be able to starve one another of resources. that `group_a` or `group_b` will not be able to starve one another of resources.