Shortcuts

LSFEnvironment

class pytorch_lightning.plugins.environments.LSFEnvironment[source]

Bases: pytorch_lightning.plugins.environments.cluster_environment.ClusterEnvironment

An environment for running on clusters managed by the LSF resource manager.

It is expected that any execution using this ClusterEnvironment was executed using the Job Step Manager i.e. jsrun.

This plugin expects the following environment variables.

LSB_JOBID:

The LSF assigned job ID

LSB_HOSTS:

The hosts used in the job. This string is expected to have the format “batch <rank_0_host> ….”

JSM_NAMESPACE_LOCAL_RANK:

The node local rank for the task. This environment variable is set by jsrun

JSM_NAMESPACE_SIZE:

The world size for the task. This environment variable is set by jsrun

creates_children()[source]

Whether the environment creates the subprocesses or not.

Return type

bool

global_rank()[source]

The world size is read from the environment variable JSM_NAMESPACE_RANK.

static is_using_lsf()[source]

Returns True if the current process was launched using the jsrun command.

Return type

bool

local_rank()[source]

The local rank is read from the environment variable JSM_NAMESPACE_LOCAL_RANK.

master_address()[source]

The master address is read from a list of hosts contained in the environment variable LSB_HOSTS.

master_port()[source]

THe master port gets calculated from the LSF job ID.

node_rank()[source]

The node rank is determined by the position of the current hostname in the list of hosts stored in the environment variable LSB_HOSTS.

world_size()[source]

The world size is read from the environment variable JSM_NAMESPACE_SIZE.