LabGym

Overview

This article documents how to use LabGym on Matilda. There are several prerequisites required for using LabGym, and UTS has installed all of these for you. However, LabGym is designed to permit users to create and use custom "detectors" and "categorizers" (models), and writable subdirectories are required so each user of LabGym can have their own, protected directory for detectors and models.

The LabGym application does not currently provide a mechanism for specifying these subdirectories at runtime, and as such, expects to see them in the LabGym installation folder.

The following steps will show you how to create your own instance of the LabGym Python module, using the prerequistes already installed for you on Matilda

LabGym Setup

Select a location in your writable space where you would like to install the LabGym module with the detectors and models subdirectories. For this example, we will use a location of /home/s/someuser/LabGym (or ~/LabGym).

First, login to Matilda using an X-windows session:

ssh -X [email protected]

Once logged-in, you can proceed with the installation of the LabGym module:

module load LabGym/2.4.5
python3 -m pip install LabGym --prefix=/home/s/someuser/LabGym

Once LabGym has been successfully installed, you can verify its operation using the following:

export PYTHONPATH=/home/s/someuser/LabGym/lib/python3.10/site-packages:$PYTHONPATH
export PATH=/home/s/someuser/LabGym/bin:$PATH
LabGym

At this point, the LabGym GUI should popup on your workstation.

LabGym Runtime

Each time you execute a LabGym job on one of Matilda's nodes, you must make sure to execute the "module load" and "export" commands shown above, at least once during in your session prior to running LabGym. Provided below is a workflow example of this process:

Login to Matilda and execute an interactive job with X11 forwarding (a GPU node is strongly recommended):

ssh -X [email protected]
salloc -N 1 -n 5 -c 1 --gres=gpu:1 -t 1:00:00 --x11

After executing the "salloc" command above, you will see what appears to be a new login to Matilda scroll in your terminal. This command allocates resources on the cluster, but you will still be on the login node. To connect to your interactive session, run the command:

squeue -u <your NetID>

Note the job number of the job you just allocated and the Node it is running on. Now, establish a X-session to that node:

ssh -X hpc-gpu-p0#

Once your interactive job is live on Matilda, start LabGym as follows:

module load LabGym/2.4.5
export PYTHONPATH=/home/s/someuser/LabGym/lib/python3.10/site-packages:$PYTHONPATH
export PATH=/home/s/someuser/LabGym/bin:$PATH
LabGym

You can streamline this process somewhat by adding the "exports" to your ~/.bashrc file, so that those will be set each time you login anywhere on Matilda. However, be aware that your PYTHONPATH and PATH will always be modified, and this may impact other Python applications.


CategoryHPC