How to use submitit - 4 common examples

To help you get started, we’ve selected a few submitit examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github facebookresearch / hydra / plugins / submitit / hydra_plugins / submitit / submitit_launcher.py View on Github external
def launch(self, job_overrides):
        # lazy import to ensurue plugin discovery remains fast
        import submitit

        num_jobs = len(job_overrides)
        assert num_jobs > 0
        with open_dict(self.config):
            self.config.hydra.job.num_jobs = num_jobs

        if self.queue == "auto":
            executor = submitit.AutoExecutor(
                folder=self.folder, conda_file=self.conda_file
            )
        elif self.queue == "slurm":
            executor = submitit.SlurmExecutor(folder=self.folder)
        elif self.queue == "chronos":
            executor = submitit.ChronosExecutor(
                folder=self.folder, conda_file=self.conda_file
            )
        elif self.queue == "local":
            executor = submitit.LocalExecutor(folder=self.folder)
        else:
            raise RuntimeError("Unsupported queue type {}".format(self.queue))

        executor.update_parameters(**self.queue_parameters[self.queue])

        log.info("Sweep output dir : {}".format(self.config.hydra.sweep.dir))
github facebookresearch / hydra / plugins / submitit / hydra_plugins / submitit / submitit_launcher.py View on Github external
# lazy import to ensurue plugin discovery remains fast
        import submitit

        num_jobs = len(job_overrides)
        assert num_jobs > 0
        with open_dict(self.config):
            self.config.hydra.job.num_jobs = num_jobs

        if self.queue == "auto":
            executor = submitit.AutoExecutor(
                folder=self.folder, conda_file=self.conda_file
            )
        elif self.queue == "slurm":
            executor = submitit.SlurmExecutor(folder=self.folder)
        elif self.queue == "chronos":
            executor = submitit.ChronosExecutor(
                folder=self.folder, conda_file=self.conda_file
            )
        elif self.queue == "local":
            executor = submitit.LocalExecutor(folder=self.folder)
        else:
            raise RuntimeError("Unsupported queue type {}".format(self.queue))

        executor.update_parameters(**self.queue_parameters[self.queue])

        log.info("Sweep output dir : {}".format(self.config.hydra.sweep.dir))
        path_str = str(self.config.hydra.sweep.dir)
        os.makedirs(path_str, exist_ok=True)
        if "mode" in self.config.hydra.sweep:
            mode = int(str(self.config.hydra.sweep.mode), 8)
            os.chmod(path_str, mode=mode)
github facebookresearch / hydra / plugins / submitit / hydra_plugins / submitit / submitit_launcher.py View on Github external
assert num_jobs > 0
        with open_dict(self.config):
            self.config.hydra.job.num_jobs = num_jobs

        if self.queue == "auto":
            executor = submitit.AutoExecutor(
                folder=self.folder, conda_file=self.conda_file
            )
        elif self.queue == "slurm":
            executor = submitit.SlurmExecutor(folder=self.folder)
        elif self.queue == "chronos":
            executor = submitit.ChronosExecutor(
                folder=self.folder, conda_file=self.conda_file
            )
        elif self.queue == "local":
            executor = submitit.LocalExecutor(folder=self.folder)
        else:
            raise RuntimeError("Unsupported queue type {}".format(self.queue))

        executor.update_parameters(**self.queue_parameters[self.queue])

        log.info("Sweep output dir : {}".format(self.config.hydra.sweep.dir))
        path_str = str(self.config.hydra.sweep.dir)
        os.makedirs(path_str, exist_ok=True)
        if "mode" in self.config.hydra.sweep:
            mode = int(str(self.config.hydra.sweep.mode), 8)
            os.chmod(path_str, mode=mode)

        jobs = []
        for job_num in range(num_jobs):
            sweep_override = list(job_overrides[job_num])
            log.info(
github facebookresearch / hydra / plugins / submitit / hydra_plugins / submitit / submitit_launcher.py View on Github external
def launch(self, job_overrides):
        # lazy import to ensurue plugin discovery remains fast
        import submitit

        num_jobs = len(job_overrides)
        assert num_jobs > 0
        with open_dict(self.config):
            self.config.hydra.job.num_jobs = num_jobs

        if self.queue == "auto":
            executor = submitit.AutoExecutor(
                folder=self.folder, conda_file=self.conda_file
            )
        elif self.queue == "slurm":
            executor = submitit.SlurmExecutor(folder=self.folder)
        elif self.queue == "chronos":
            executor = submitit.ChronosExecutor(
                folder=self.folder, conda_file=self.conda_file
            )
        elif self.queue == "local":
            executor = submitit.LocalExecutor(folder=self.folder)
        else:
            raise RuntimeError("Unsupported queue type {}".format(self.queue))

        executor.update_parameters(**self.queue_parameters[self.queue])

        log.info("Sweep output dir : {}".format(self.config.hydra.sweep.dir))
        path_str = str(self.config.hydra.sweep.dir)
        os.makedirs(path_str, exist_ok=True)
        if "mode" in self.config.hydra.sweep:
            mode = int(str(self.config.hydra.sweep.mode), 8)

submitit

"Python 3.8+ toolbox for submitting jobs to Slurm

MIT
Latest version published 3 months ago

Package Health Score

86 / 100
Full package analysis