forked from mila-iqia/training
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.env
72 lines (53 loc) · 1.6 KB
/
config.env
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/bin/bash
if [[ -z "${BASE}" ]]; then
echo BASE not defined!
exit 1
fi
# -----
# Check for GPUs SMI util
BIN="$(command -v nvidia-smi; true)"
if [[ -z "$BIN" ]]; then
BIN="$(command -v rocm-smi; true)"
fi
if [[ -z "$BIN" ]]; then
echo 'Missing accelerator management binary, are you sure you installed the drivers ?'
echo 'Are they in PATH ?'
fi
if [[ -z "${SMI_PRINT}" ]]; then
$BIN
export SMI_PRINT=1
fi
# -----
export PROJECT_ROOT=$(dirname "$0")
# Change location if you want to download somewhere else
# Data Directories
export DATA_DIRECTORY=$BASE/data
export OUTPUT_DIRECTORY=$BASE/output
export TEMP_DIRECTORY=$BASE/tmp
mkdir -p $TEMP_DIRECTORY
mkdir -p $OUTPUT_DIRECTORY
mkdir -p $DATA_DIRECTORY
export REPORT_PATH=$OUTPUT_DIRECTORY/bench_results
# ---------------
source ./compute_resource.sh
# ---------------
# if no CGROUP have been defined use all the resource
if [[ ! -v CGROUP ]]; then
CGROUP=memory:all
fi
if [[ ! -v MASTER_PORT ]]; then
export MASTER_PORT=$(python -c "import socket; s = socket.socket(socket.AF_INET, socket.SOCK_STREAM);s.bind(('',0)); print(s.getsockname()[1]); s.close()")
fi
export MASTER_ADDR=localhost
# Command used to execute benchmarks
export EXEC="exec"
# Enable download dataset to generate fake data to use instead of downloading the dataset
export FAKE_DATASET=1
# Use validation for training (reduce download times)
# export USE_VALIDATION=1
# Download datasets using academic torrent
# export USE_ACADEMIC_TORRENT=1
export PATH=$PATH
if [[ -z "${SINGULARITY_NAME}" ]]; then
sync; sysctl vm.drop_caches=3 > /dev/null 2>&1
fi