Usage Limits
Setting Up GPU Usage Limits in Slurm with SlurmDBD
This guide explains how to enforce per-user and per-account GPU usage quotas in Slurm using SlurmDBD, ensuring automatic monthly resets.
Prerequisites¶
Ensure the following before proceeding:
- Slurm Accounting Enabled: Configure SlurmDBD in
slurm.conf(AccountingStorageType=accounting_storage/slurmdbd). - GPU GRES Configured: Add
AccountingStorageTRES=gres/gpuinslurm.conf.
Setting Usage Limits¶
GPU usage is measured in GPU-minutes. For example, we set:
- Per-user limit: \$5000/month at \$1.8 per GPU-hour → 166,667 GPU-minutes
- Per-account limit: \$20,000/month at \$1.8 per GPU-hour → 666,667 GPU-minutes
Commands:
sudo sacctmgr modify user name=alice account=research set GrpTRESMins=gres/gpu=166667
sudo sacctmgr modify account name=research set GrpTRESMins=gres/gpu=666667
Verifying Limits¶
- Check limits:
- Check current usage:
- Verify enforcement:
Enforcing Limits¶
- Add to
slurm.conf: - Restart Slurm:
Testing Limits¶
- Set a low test limit:
- Submit jobs:
- Revert test limits:
Automating Monthly Resets¶
Enable automatic resets using Slurm's priority scheduler:
Verify reset at the start of a new month using:
Additional Notes¶
- Limits Hierarchy: User and account limits apply separately; the most restrictive prevails.
- Adjusting Limits: Modify
GrpTRESMinsdynamically viasacctmgr. - Monitoring: Use
sreportor database queries to track GPU usage. - Removing Limits:
With these settings, Slurm will enforce GPU-minute limits, reset them monthly, and ensure resource usage stays within budgeted allocations.