Skip to content

Instantly share code, notes, and snippets.

View JackBurdick's full-sized avatar

Jack Burdick JackBurdick

View GitHub Profile
########## Personal aliases
# code ide
alias c="code "
## add ll
alias ll='ls -lGaf'
alias l='ls -lFG'
alias l.='ls -dGF .*'
alias lg='ll |grep --colour=auto '
@JackBurdick
JackBurdick / create_segmented_img_with_border.m
Created February 7, 2017 21:52
create a mask + size of structuring element
%% Initialization
main_directory = 'isbi-segmentation-dataset'; % parent directory
% dialation size
strel_size = 25;
% select one or the other.. test or train
img_type = 'test';
% img_type = 'train';
@JackBurdick
JackBurdick / .theanorc
Created January 19, 2017 02:08
correct theano config file
[global]
device = gpu
floatX = float32
[cuda]
root = /cm/local/apps/cuda/libs/current
[lib]
cnmem=1
@JackBurdick
JackBurdick / run_your_file.sh
Last active January 19, 2017 03:04
submit job through SLURM
#!/bin/bash
#SBATCH -t 20 # time limit of job, in minutes.. USED ONLY FOR TESTING [REMOVE AS NEEDED]
#SBATCH -p gpu # which queue to submit to
#SBATCH --gres=gpu:1 # tell the sbatch script to allocate GPU resources
#SBATCH -o gpu_python_%j.out # File to which STDOUT will be written
#SBATCH -e gpu_python_%j.err # File to which STDERR will be written
#SBATCH --mail-type=END # Type of email notification- BEGIN,END,FAIL,ALL
#SBATCH [email protected] # Email to which notifications will be sent
THEANO_FLAGS=mode=FAST_RUN,device=gpu,config.dnn.enabled=True,floatX=float32 python mnhist_test_fromFile.py
#!/bin/bash
#SBATCH -t 20 # time limit of job, in minutes.. just using now for testing
#SBATCH -p gpu # which queue to submit to
#SBATCH -o gpu_python_%j.out # File to which STDOUT will be written
#SBATCH -e gpu_python_%j.err # File to which STDERR will be written
#SBATCH --mail-type=END # Type of email notification- BEGIN,END,FAIL,ALL
#SBATCH [email protected] # Email to which notifications will be sent
THEANO_FLAGS=mode=FAST_RUN,device=gpu,floatX=float32 python test_GPU_or_CPU.py
[global]
device = gpu
floatX = float32
[cuda]
root = /cm/local/apps/cuda/libs/current
[lib]
cnmem=1
@JackBurdick
JackBurdick / output.txt
Created January 14, 2017 19:34
eric response
I can test your workflow if you give me the steps. These are the steps I conducted to verify the environment.
salloc –N 1 –p gpu
# Gives me node084
ssh node084
module load cuda75/toolkit/7.5.18
module load python/anaconda
# Testing out CUDA (optional and not required, but this is how you would do it)q
cd $CUDA_SDK
./verify_cuda75.sh
@JackBurdick
JackBurdick / .theanorc
Created January 14, 2017 19:10
theano config file
[global]
device = gpu
floatX = float32
[cuda]
root = /cm/local/apps/cuda/libs/current
@JackBurdick
JackBurdick / test_GPU_or_CPU.py
Created January 14, 2017 19:07
python file to check gpu vs cpu
from theano import function, config, shared, sandbox
import theano.tensor as T
import numpy
import time
vlen = 10 * 30 * 768 # 10 x #cores x # threads per core
iters = 1000
rng = numpy.random.RandomState(22)
x = shared(numpy.asarray(rng.rand(vlen), config.floatX))
@JackBurdick
JackBurdick / testScript_gpu_check.sh
Created January 14, 2017 19:04
sbatch check gpu
#!/bin/bash
#SBATCH -t 20 # time limit of job, in minutes.. just using now for testing
#SBATCH -p gpu # which queue to submit to
#SBATCH -n 40 # TEST FROM DR M
#SBATCH -N 2 # TEST FROM DR M
#SBATCH -o gpu_python_%j.out # File to which STDOUT will be written
#SBATCH -e gpu_python_%j.err # File to which STDERR will be written
#SBATCH --mail-type=END # Type of email notification- BEGIN,END,FAIL,ALL
#SBATCH [email protected] # Email to which notifications will be sent