This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
research:ml [2019/07/08 15:16] kgovender |
research:ml [2021/12/09 16:42] (current) |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | If you are making use of Jupyter notebook to write your python scripts then you first need to make sure you export the .py file from Jupyter and then copy it onto the cluster | ||
| - | Also ensure job is copied | + | If you are looking for information on Tensorflow, please go to [[guide: |
| - | ===== Running Tensorflow on CPU nodes ===== | + | ======Machine Learning====== |
| - | To test a job on a compute node first get onto an interactive node with the following: | + | The CHPC supports Machine Learning (ML) activities at the CHPC. More than a just a simulation of AI, machine learning is now applied to modelling areas of science where traditional mathematical models struggle |
| - | qsub -I -P YOURPROGRAMME(E.G. CSCI1234) -q smp -l select=1: | ||
| - | |||
| - | Once on an interactive node (cnodeNNNN) you need to load up the appropriate modules: | ||
| - | |||
| - | | ||
| - | | ||
| - | |||
| - | Then | ||
| - | |||
| - | cd / | ||
| - | |||
| - | Finally run | ||
| - | |||
| - | | ||
| - | |||
| - | If you import matplotlib in your python script you may end up with the following error: | ||
| - | |||
| - | | ||
| - | |||
| - | If so then add the following to your python script before resubmitting | ||
| - | |||
| - | | ||
| - | | ||
| - | ===== Running Tensorflow on GPU nodes ===== | ||
| - | |||
| - | As with CPU version you can test your python jobs on an interactive node: | ||
| - | |||
| - | qsub -I -P YOURPROGRAMME(E.G. CSCI1234) -q gpu_1 -l select=1: | ||
| - | |||
| - | Once on an interactive node (gpuNNNN) you need to load up appropriate modules: | ||
| - | |||
| - | | ||
| - | | ||
| - | | ||
| - | |||
| - | Then | ||
| - | |||
| - | cd / | ||
| - | |||
| - | When running on a single GPU you need to include the following in your .py file to ensure that not all the CPU's on the node get consumed, thereby resulting in your job being killed by the scheduler | ||
| - | |||
| - | session_conf = tf.ConfigProto(intra_op_parallelism_threads=10, | ||
| - | sess = tf.Session(config=session_conf) | ||
| - | |||
| - | Finally run | ||
| - | |||
| - | | ||
| - | |||
| - | If you wish to run jobs through the scheduler then there are scripts on the login node that can help you setup a PBS submission script | ||
| - | |||
| - | Once you are on the login node just type **qtensorflow_cpu** (CPU version of Tensorflow) or **qtensorflow_gpu** (GPU version of tensorflow) | ||
| - | |||
| - | Examples of what is needed when running the above scripts are provided below: | ||
| - | |||
| - | EXAMPLE1 | ||
| - | Enter research programme name | ||
| - | | ||
| - | Enter python script name (with .py extension) | ||
| - | | ||
| - | Enter total walltime (hour: | ||
| - | 2:00 | ||
| - | Enter email address | ||
| - | | ||
| - | | ||
| - | Do you wish to submit job to cluster (y/n) | ||
| - | y | ||
| - | |||
| - | EXAMPLE2 | ||
| - | Enter research programme name | ||
| - | | ||
| - | Enter python script name (with .py extension) | ||
| - | | ||
| - | Enter total walltime (hour: | ||
| - | |||
| - | Enter email address | ||
| - | | ||
| - | | ||
| - | Do you wish to submit job to cluster (y/n) | ||
| - | y | ||
| - | |||
| - | Please take note of empty space in EXAMPLE2. This corresponds to the enter key | ||