Explorar o código

Update README.md

Qndre %!s(int64=2) %!d(string=hai) anos
pai
achega
127c7b7813
Modificáronse 1 ficheiros con 65 adicións e 3 borrados
  1. 65 3
      README.md

+ 65 - 3
README.md

@@ -170,16 +170,78 @@ qdel <job-ID>
 ```
 ### GPU Job
 
-Now we'll run a simple pytorch mnist example this time using a GPU.
+Now we'll run a simple pytorch mnist example this time using a GPU. Slightly different when using myriad (https://www.rc.ucl.ac.uk/docs/Example_Jobscripts/#gpu-job-script-example)[https://www.rc.ucl.ac.uk/docs/Example_Jobscripts/#gpu-job-script-example].
 
 ```
-	
+##!/bin/bash -l
+#$ -l tmem=16G
+#$ -l h_rt=50:0:0
+# Use this flag for a gpu job
+#$ -l gpu=true
+#$ -S /bin/bash
+#$ -j y
+#$ -N 
+# Useful to redirect logs
+#$ -o /home/<ucl-id>/hpc-tutorial/jobs/logs
+
+hostname
+date
+SOURCE_DIR='/home/<ucl-id>/hpc-tutorial'
+export PYTHONPATH=$PYTHONPATH:$SOURCE_DIR
+cd $SOURCE_DIR || exit
+source /share/apps/source_files/cuda/cuda-10.1.source
+conda activate hpc-example
+
+python pl_examples/image_classifier_4_lightning_module.py
+date
+```
+
+### Simple grid search
+
+Best part about using the cluster is the number of GPUs. This next one is an example of how to define a simple grid search using a config file and an array job.
+
+
+```
+##!/bin/bash -l
+#$ -l tmem=16G
+#$ -l h_rt=50:0:0
+# Use this flag for a gpu job
+#$ -l gpu=true
+#$ -S /bin/bash
+#$ -j y
+#$ -N 
+# Useful to redirect logs
+#$ -o /home/<ucl-id>/hpc-tutorial/jobs/logs
+# Defines array of jobs
+#$ -t 1:4
+# Max number of jobs running at once
+#$ -tc 4
+
+hostname
+date
+SOURCE_DIR='/home/<ucl-id>/hpc-tutorial'
+export PYTHONPATH=$PYTHONPATH:$SOURCE_DIR
+cd $SOURCE_DIR || exit
+source /share/apps/source_files/cuda/cuda-10.1.source
+conda activate hpc-example
+
+
+CONFIG_PATH='jobs/configs/lr-grid.csv'
+
+ROW=$SGE_TASK_ID
+LINE=$(sed -n $((ROW + 1))'{p;q}' "$CONFIG_PATH")
+ARGS=($(echo "$LINE"))
+
+LR=${ARGS[0]}
+
+python pl_examples/image_classifier_4_lightning_module.py -model.lr $LR
+date
 ```
 
 ## Hyperopt
 ![Network Diagram](images/network_diagram_hyperopt.png)
 
-My job script
+Possible to do more complicate stuff too... Here using mongodb and hyperopt to pull new hyperparameters from a database.
 
 ```
 #$ -l tmem=16G