Skip to content

Commit fa877f4

Browse files
authored
Slurm: fix memory request (#4016)
`memory: ..4GB` should be translated to `--mem=4096M`, not `--mem=8192M` (where 8GB is taken from `DEFAULT_MEMORY_SIZE.min`)
1 parent d449eac commit fa877f4

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/dstack/_internal/core/backends/slurm/resources.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@ def get_requested_resources_from_resources_spec(spec: ResourcesSpec) -> Requeste
128128
# The easiest/safest option is to use some sane default
129129
memory = spec.memory.min or DEFAULT_MEMORY_SIZE.min
130130
assert memory
131+
if spec.memory.max:
132+
memory = min(memory, spec.memory.max)
131133
memory_mib = round(memory * 1024)
132134

133135
gpu_count: int = 0

0 commit comments

Comments
 (0)