Registry /
devops / hydra-submitit-launcher
Install & Compatibility
Where this runs
tested against v1.2.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 25.3MB
glibcpy 3.10–3.910 runs
installs and imports cleanly · install 2.3s · import 0.000s · 27MB
24MB installed
● package 24MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
SubmititLauncher
✓ from hydra_plugins.hydra_submitit_launcher import SubmititLauncher
✗ from hydra_plugins.hydra_submitit_launcher import SubmititLauncher
This example demonstrates how to set up a basic Hydra application to be launched using `submitit_local`. Users need to define a Hydra configuration file (e.g., `conf/config.yaml`) that specifies the `submitit_local` launcher. The `@hydra.main` decorator will then use this configuration to launch the `my_app` function as a Submitit job. For demonstration purposes, `submitit_local` is used; for production, `submitit_slurm` or other backends would be chosen after installing their respective dependencies (e.g., `pip install submitit[slurm]`).
import hydra
from omegaconf import DictConfig
import os
# To run this quickstart:
# 1. Ensure hydra-submitit-launcher is installed: `pip install hydra-submitit-launcher`
# 2. Create a directory named 'conf' in the same location as this script.
# 3. Create a file 'conf/config.yaml' with the following content:
# ---
# # conf/config.yaml
# # @package _global_
# defaults:
# - override hydra/launcher: submitit_local
# - _self_
#
# hydra:
# launcher:
# submitit_local:
# timeout_min: 1
# cpus_per_task: 1
# mem_gb: 1
# nodes: 1
# ---
# 4. Save this Python code as a .py file (e.g., my_app.py).
# 5. Run from your terminal: `python my_app.py`
@hydra.main(config_path='conf', config_name='config', version_base='1.3')
def my_app(cfg: DictConfig) -> None:
print(f"Hello from a Submitit-launched job!")
print(f"Working directory : {os.getcwd()}")
print(f"Config: {cfg.pretty()}")
# The actual job logic would go here. Submitit handles serialization
# of the function and its arguments to the remote/local executor.
if __name__ == "__main__":
my_app()
Debug
Known issues
breakingThe behavior for distinguishing job timeouts from preemptions has changed in version 1.2.0 due to upstream Slurm regressions (versions 19.04-20.02). Relying on Slurm's exact signals for preemption detection might require review, as the launcher now implements its own logic.fixReview job monitoring and error handling logic, especially if it directly interprets Slurm exit codes or signals for preemption. Adapt to the launcher's new detection method for timeouts vs. preemptions, or consult Submitit documentation for best practices.
affects: >=1.2.0
gotchaPaths containing spaces or special characters may not be correctly handled by Submitit backends, leading to job failures or unexpected behavior during resource staging. While 1.2.0 includes fixes for quoting, complex path scenarios can still be problematic.fixUpgrade to `hydra-submitit-launcher>=1.2.0`. As a best practice, avoid special characters and spaces in job-related paths. Thoroughly test job submission with non-trivial paths if their use is unavoidable.
affects: <1.2.0 (partially fixed in 1.2.0)
gotchaIf the `hydra/launcher` default is not correctly overridden in your Hydra configuration, Hydra will default to its `basic` launcher, or raise an error if an incorrect launcher name is specified, preventing Submitit from being used.fixEnsure your `conf/config.yaml` or equivalent explicitly sets `defaults: - override hydra/launcher: submitit_slurm` (or `submitit_local`, etc.) within the global defaults to activate the plugin. This line must be present at the top level of your primary config file.
affects: *
Upgrade
Version history
1.2.0latest on PyPI · released May 17, 2022
Audit
Dependencies
hydra-corerequiredRequired for core Hydra functionality and plugin integration.
submititrequiredThe underlying job submission library used by the launcher.