tmux

Note

Tmux software support is required.

This module is designed for assisting distributed trainning and hyperparameter searching. There are two situations where this module can be used:

  1. Distributed training. PyTorch distributed API need multi-device support. Tmux software is used for launching multi processes.

  2. Hyperparameter searching. Tmux software is used for launching each experiment which corresponds to a certain hyperparameter combination.

More information about Tmux.

Class

TmuxManager

class gedml.client.tmux.manager.TmuxManager(session_name='borel', conda_env='pytorch')[source]

Bases: object

Class to manage the Tmux software.

Note

Tmux must be installed before.

Parameters
  • session_name (str) – The name of tmux session.

  • conda_env (str) – The name of conda environment for window intialization.

Example

>>> manager = TmuxManager()
>>> manager.new_window(window_name="test")
>>> cmd = "clear"
>>> manager.send_cmd(cmd)
session

Current tmux session pointer.

curr_window

Current tmux window pointer.

curr_pane

Current tmux pane pointer by which user can send command.

close_all()[source]

Close all tmux window.

initiate_manager()[source]

Initiate libtmux.Server and create specified session.

new_window(window_name=None, *args)[source]

Create a new tmux window.

After creating the tmux window, conda initialization command will be sent to enter into the specified conda environment.

Parameters

window_name (str) – The name of window to be created.

send_cmd(cmd)[source]

Send command to the current tmux pane.

Parameters

cmd (str) – Command to be sent.