User Tools

Site Tools


techstaff:slurm

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
techstaff:slurm [2018/03/08 09:59] – [Storage] kauffmantechstaff:slurm [2019/10/08 17:24] – [Notice] kauffman
Line 1: Line 1:
 ===== Notice ===== ===== Notice =====
-**2017-08-31**: Configuration change to allow allocation on CPUs and RAM. Please read the 'Default Quotasection under https://howto.cs.uchicago.edu/techstaff:slurm#usage  +**2019-10-08**: New computer nodes added under the partiton ''%%genfast%%''
 ====== Peanut Job Submission Cluster ====== ====== Peanut Job Submission Cluster ======
  
Line 66: Line 65:
  
 Create a directory on the scratch partition if you don't already have one: Create a directory on the scratch partition if you don't already have one:
-<code>user@slurm1:~$ mkdir -p /scratch/$USER+<code>user@slurm1:~$ mkdir -p /scratch/$USER</code>
  
 Change into my scratch directory: Change into my scratch directory:
Line 98: Line 97:
 | **debug** | The partition your job will be submitted to if none is specified. The purpose of this partition is to make sure your code is running as it should before submitting a long running job to the general queue. | | **debug** | The partition your job will be submitted to if none is specified. The purpose of this partition is to make sure your code is running as it should before submitting a long running job to the general queue. |
 | **general** | All jobs that have been thoroughly tested can be submitted here. This partition will have access to more nodes and will process most of the jobs. If you need to use the ''%%--exclusive%%'' flag it should be done here.| | **general** | All jobs that have been thoroughly tested can be submitted here. This partition will have access to more nodes and will process most of the jobs. If you need to use the ''%%--exclusive%%'' flag it should be done here.|
-| **gpu** | Contains servers with graphics cards. As of May 2016 there is only one node containing a Tesla M2090. You will be forced to use this server exclusively for now. Please keep your time in interactive mode to a minimum.|+| **pascal** | 2018-05-04: 1x Nvidia GTX1080. You will be forced to use this server exclusively for now. Please keep your time in interactive mode to a minimum.| 
 +| **titan** | 2018-05-04: 4x Nvidia GTX1080Ti. This partition is shared and you MUST use the ''%%--gres%%'' to specify the resources you wish to use. It is also encouraged to specify cpu and memory.|
  
 ====== Job Submission ====== ====== Job Submission ======
Line 111: Line 111:
 | ^ SLURM ^ Example ^ | ^ SLURM ^ Example ^
 ^ Submit a batch serial job | sbatch | sbatch runscript.sh | ^ Submit a batch serial job | sbatch | sbatch runscript.sh |
-^ Run a script interatively | srun | srun --pty -p interact -t 10 --mem 1000 \\ /bin/bash \\ /bin/hostname |+^ Run a script interactively | srun | srun --pty -p interact -t 10 --mem 1000 \\ /bin/bash \\ /bin/hostname |
 ^ Kill a job | scancel | scancel 4585 | ^ Kill a job | scancel | scancel 4585 |
 ^ View status of queues | squeue | squeue -u cnetid | ^ View status of queues | squeue | squeue -u cnetid |
Line 245: Line 245:
  
 ====== Using the GPU ====== ====== Using the GPU ======
-===== Paths ===== + 
-You will need to add the following to your $PATH and $LD_LIBRARY_PATH.+===== GRES Multiple GPU's on one system ===== 
 +GRES: Generic Resource. As of 2018-05-04 these only include GPU's. 
 + 
 +Jobs will not be allocated any generic resources unless specifically requested at job submit time using the ''%%--gres%%'' option supported by the ''%%salloc%%'', ''%%sbatch%%'' and ''%%srun%%'' commands. The option requires an argument specifying which generic resources are required and how many resources. The resource specification is of the form ''%%name[:type:count]%%''. The name is the same name as specified by the GresTypes and Gres configuration parameters. type identifies a specific type of that generic resource (e.g. a specific model of GPU). count specifies how many resources are required and has a default value of 1. For example: 
 +<code>sbatch --gres=gpu:titan:2 ....</code> 
 + 
 +Jobs will be allocated specific generic resources as needed to satisfy the request. If the job is suspended, those resources do not become available for use by other jobs. 
 + 
 +Job steps can be allocated generic resources from those allocated to the job using the ''%%--gres%%'' option with the ''%%srun%%'' command as described above. By default, a job step will be allocated all of the generic resources allocated to the job. If desired, the job step may explicitly specify a different generic resource count than the job. This design choice was based upon a scenario where each job executes many job steps. If job steps were granted access to all generic resources by default, some job steps would need to explicitly specify zero generic resource counts, which we considered more confusing. The job step can be allocated specific generic resources and those resources will not be available to other job steps. A simple example is shown below. 
 + 
 +==== Ok, but I don't want to read the wall of text above ==== 
 +Fine. 
 + 
 +The ''%%--gres%%'' (man srun) is required if you want to make use of a gpu. 
 + 
 +<code> 
 +  --gpu=gpu:   # where 'N' is the number of GPUs requested. 
 +                 # Please try to limit yourself to one GPU per person. 
 +</code> 
 + 
 +Example when using tensorflow: 
 + 
 +Given the file ''%%f%%'':    
 +<code> 
 +#!/usr/bin/env python3 
 +from tensorflow.python.client import device_lib 
 +print(device_lib.list_local_devices()) 
 +</code> 
 + 
 +Here we can see that no GPU was allocated to us because we did not specify the ''%%--gres%%'' option 
 +<code> 
 +user@bulldozer:~srun -p titan --pty /bin/bash 
 +user@gpu3:~$ ./f 2>&1 | grep physical_device_desc 
 +user@gpu3:~$ 
 +</code> 
 + 
 +If we request only 1 GPU. 
 +<code> 
 +user@bulldozer:~$ srun -p titan --pty --gres=gpu:1 /bin/bash 
 +user@gpu3:~$ ./f 2>&1 | grep physical_device_desc 
 +physical_device_desc: "device: 0, name: GeForce GTX 1080 Ti, pci bus id: 0000:19:00.0, compute capability: 6.1" 
 +</code> 
 + 
 +If we request 2 GPUs. 
 +<code> 
 +user@bulldozer:~$ srun -p titan --pty --gres=gpu:2 /bin/bash 
 +user@gpu3:~$ ./f 2>&1 | grep physical_device_desc 
 +physical_device_desc: "device: 0, name: GeForce GTX 1080 Ti, pci bus id: 0000:19:00.0, compute capability: 6.1" 
 +physical_device_desc: "device: 1, name: GeForce GTX 1080 Ti, pci bus id: 0000:1a:00.0, compute capability: 6.1" 
 +</code> 
 + 
 +If we request more GPUs then are available. 
 +<code> 
 +kauffman3@bulldozer:~$ srun -p titan --pty --gres=gpu:5 /bin/bash 
 +srun: error: Unable to allocate resources: Requested node configuration is not available 
 +</code> 
 + 
 +==== Cool, but how do I know where and what resources are available ==== 
 +Turns out the ''%%sinfo%%'' command is super useful. 
 +<code> 
 +sinfo -O partition,nodelist,gres,features,available 
 +PARTITION           NODELIST            GRES                FEATURES            AVAIL                
 +debug*              slurm1              (null)              (null)              up                   
 +general             slurm[2-6,8]        (null)              (null)              up                   
 +pascal              gpu2                gpu:gtx1080:      'pascal,gtx1080'    up                   
 +titan               gpu3                gpu:gtx1080ti:    'pascal,gtx1080ti'  up  
 +</code> 
 + 
 +FEATURES: Is actually just an arbitrary string in the configuration file that defines a node. However, techstaff hopes it actually provides some useful info. 
 + 
 +GRES: Don't depend on this being accurate, however it will definitely give you a clue as to how many generic resources are in a partition. 
 + 
 + 
 +==== Checking how many Generic RESources are being consumed ==== 
 + 
 +Simple use the ''%%-O%%'' option for ''%%squeue%%'' and you can see how many generic resources any particular job is consuming. 
 +<code> 
 +$ squeue -O username,nodelist,gres 
 +USER                NODELIST            GRES                 
 +someusername        gpu3                gpu:1                
 +otherusername       gpu3                gpu:3                
 +... 
 +</code> 
 + 
 + 
 +===== Environment Variables ===== 
 + 
 +==== CUDA_HOME, LD_LIBRARY_PATH ==== 
 + 
 +Please make sure you specify $CUDA_HOME and if you want to take advantage of CUDNN libraries you will need to append /usr/local/cuda-x.x/lib64 to the $LD_LIBRARY_PATH environment variable. 
 + 
 +  cuda_version=9.2 
 +  export CUDA_HOME=/usr/local/cuda-${cuda_version} 
 +  export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CUDA_HOME/lib64 
 + 
 +Currently we support the same versions of CUDA that the latest version of CUDNN supports. This is not written in stone and we can accommodate most other versions if required; just let techstaff know what your needs are. 
 + 
 +==== PATH ==== 
 +You may also need to add the following to your ''%%$PATH%%''
  
   export PATH=$PATH:/usr/local/cuda/bin   export PATH=$PATH:/usr/local/cuda/bin
-  export LD_LIBRARY_PATH=$LD_LIBRARY_PATH=/usr/local/cuda/lib+ 
 +==== CUDA_VISIBLE_DEVICES ==== 
 +Do not set this variable. It will be set for you by SLURM. 
 + 
 +The variable name is actually misleading; since it does NOT mean the amount of devices, but rather the physical device number assigned by the kernel (e.g. /dev/nvidia2). 
 + 
 +For example: If you requested multiple gpu's from SLURM (--gres=gpu:2), the CUDA_VISIBLE_DEVICES variable should contain two numbers(0-3 in this case) separated by a comma (e.g. 1,3).
  
  
Line 307: Line 411:
 STDERR should be blank. STDERR should be blank.
 ====== More ====== ====== More ======
-If you feel this documentation is lacking in some way please let techstaff know. Email [[techstaff@cs.uchicago.edu]], call (773-702-1031), or stop by our office (Ryerson 154).+If you feel this documentation is lacking in some way please let techstaff know. Email [[techstaff@cs.uchicago.edu]], call (773-702-1031), or stop by our office (Crerar 357).
/var/lib/dokuwiki/data/pages/techstaff/slurm.txt · Last modified: 2021/01/06 16:13 by kauffman

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki