Skip to content

Add job_name as a staticmethod in SLURMEnvironment class #10697

@AndresAlgaba

Description

@AndresAlgaba

Proposed refactor

Add job_name as a staticmethod in SLURMEnvironment class to improve code quality of the staticmethod job_id:
https://github.com/PyTorchLightning/pytorch-lightning/blob/6fc7c54c3af6dc3a446253df379e459d18bacb85/pytorch_lightning/plugins/environments/slurm_environment.py#L41-L54

Motivation

Currently:

os.environ.get("SLURM_JOB_NAME")

is used to get the slurm job name. This could be replaced by a staticmethod in the SLURMEnvironment class to improve the code quality.

Pitch

  1. Add a staticmethod job_name to the SLURMEnvironment class.
  2. Replace os.environ.get("SLURM_JOB_NAME") with the staticmethod job_name in the staticmethod job_id.

Additional context

@awaelchli


If you enjoy Lightning, check out our other projects! ⚡

  • Metrics: Machine learning metrics for distributed, scalable PyTorch applications.

  • Lite: enables pure PyTorch users to scale their existing code on any kind of device while retaining full control over their own loops and optimization logic.

  • Flash: The fastest way to get a Lightning baseline! A collection of tasks for fast prototyping, baselining, fine-tuning, and solving problems with deep learning.

  • Bolts: Pretrained SOTA Deep Learning models, callbacks, and more for research and production with PyTorch Lightning and PyTorch.

  • Lightning Transformers: Flexible interface for high-performance research using SOTA Transformers leveraging Pytorch Lightning, Transformers, and Hydra.

cc @justusschock @awaelchli @akihironitta

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions