Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
OpenPCDet
Commits
53c259f4
Unverified
Commit
53c259f4
authored
Apr 07, 2023
by
jihan.yang
Committed by
GitHub
Apr 07, 2023
Browse files
Add another slurm training script (#1312)
* add another slurm training script
parent
83954d03
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
0 deletions
+30
-0
tools/scripts/slurm_train_v2.sh
tools/scripts/slurm_train_v2.sh
+30
-0
No files found.
tools/scripts/slurm_train_v2.sh
0 → 100644
View file @
53c259f4
#!/usr/bin/env bash
set
-x
PARTITION
=
$1
JOB_NAME
=
$2
GPUS
=
$3
PY_ARGS
=
${
@
:4
}
GPUS_PER_NODE
=
${
GPUS_PER_NODE
:-
8
}
CPUS_PER_TASK
=
${
CPUS_PER_TASK
:-
40
}
SRUN_ARGS
=
${
SRUN_ARGS
:-
""
}
while
true
do
PORT
=
$((
((
RANDOM
<<
15
)|RANDOM) % 49152 + 10000 ))
status="
$(
nc
-z
127.0.0.1
$PORT
< /dev/null &>/dev/null
;
echo
$?
)
"
if [ "
${
status
}
" != "0" ]; then
break;
fi
done
echo
$PORT
srun -p
${
PARTITION
}
\
--job-name=
${
JOB_NAME
}
\
--gres=gpu:
${
GPUS_PER_NODE
}
\
--cpus-per-task=
${
CPUS_PER_TASK
}
\
--kill-on-bad-exit=1
\
${
SRUN_ARGS
}
\
python -m torch.distributed.launch --nproc_per_node=
${
GPUS_PER_NODE
}
train.py --launcher pytorch --tcp_port
${
PORT
}
${
PY_ARGS
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment