Skip to content

Commit de22da6

Browse files
committed
Document priorities for tasks
1 parent 3c0b88c commit de22da6

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

docs/docs/concepts/tasks.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,34 @@ retry:
427427
If one job of a multi-node task fails with retry enabled,
428428
`dstack` will stop all the jobs and resubmit the run.
429429

430+
### Priority
431+
432+
Be default, submitted runs are scheduled in the order they were submitted.
433+
When compute resources are limited, you may want to prioritize some runs over others.
434+
This can be done by specifying the [`priority`](../reference/dstack.yml/task.md) property in the run configuration:
435+
436+
<div editor-title=".dstack.yml">
437+
438+
```yaml
439+
type: task
440+
name: train
441+
442+
python: "3.10"
443+
444+
# Commands of the task
445+
commands:
446+
- pip install -r fine-tuning/qlora/requirements.txt
447+
- python fine-tuning/qlora/train.py
448+
449+
priority: 50
450+
```
451+
452+
</div>
453+
454+
`dstack` tries to provision runs with higher priority first.
455+
Note that if a high priority run cannot be scheduled,
456+
it does not block other runs with lower priority from scheduling.
457+
430458
--8<-- "docs/concepts/snippets/manage-fleets.ext"
431459

432460
--8<-- "docs/concepts/snippets/manage-runs.ext"

0 commit comments

Comments
 (0)