Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
a0550cbc
Unverified
Commit
a0550cbc
authored
Jul 09, 2024
by
Kevin H. Luu
Committed by
GitHub
Jul 09, 2024
Browse files
Add support for multi-node on CI (#5955)
Signed-off-by:
kevin
<
kevin@anyscale.com
>
parent
08c5bdec
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
77 additions
and
0 deletions
+77
-0
.buildkite/run-multi-node-test.sh
.buildkite/run-multi-node-test.sh
+77
-0
No files found.
.buildkite/run-multi-node-test.sh
0 → 100755
View file @
a0550cbc
#!/bin/bash
set
-euox
pipefail
if
[[
$#
-lt
3
]]
;
then
echo
"Please provide the number of nodes and GPU per node."
exit
1
fi
NUM_NODES
=
$1
NUM_GPUS
=
$2
DOCKER_IMAGE
=
$3
shift
3
COMMANDS
=(
"
$@
"
)
if
[
${#
COMMANDS
[@]
}
-ne
$NUM_NODES
]
;
then
echo
"The number of commands must be equal to the number of nodes."
echo
"Number of nodes:
$NUM_NODES
"
echo
"Number of commands:
${#
COMMANDS
[@]
}
"
exit
1
fi
echo
"List of commands"
for
command
in
"
${
COMMANDS
[@]
}
"
;
do
echo
$command
done
start_network
()
{
docker network create
--subnet
=
192.168.10.0/24 docker-net
}
start_nodes
()
{
for
node
in
$(
seq
0
$((
$NUM_NODES
-
1
))
)
;
do
GPU_DEVICES
=
'"device='
for
node_gpu
in
$(
seq
0
$((
$NUM_GPUS
-
1
))
)
;
do
DEVICE_NUM
=
$((
$node
*
$NUM_GPUS
+
$node_gpu
))
GPU_DEVICES+
=
$((
$DEVICE_NUM
))
if
[
$node_gpu
-lt
$((
$NUM_GPUS
-
1
))
]
;
then
GPU_DEVICES+
=
','
fi
done
GPU_DEVICES+
=
'"'
# echo "Starting node$node with GPU devices: $GPU_DEVICES"
docker run
-d
--gpus
"
$GPU_DEVICES
"
--name
node
$node
--network
docker-net
--ip
192.168.10.
$((
10
+
$node
))
--rm
$DOCKER_IMAGE
tail
-f
/dev/null
done
}
run_nodes
()
{
for
node
in
$(
seq
0
$((
$NUM_NODES
-
1
))
)
;
do
GPU_DEVICES
=
'"device='
for
node_gpu
in
$(
seq
0
$((
$NUM_GPUS
-
1
))
)
;
do
DEVICE_NUM
=
$((
$node
*
$NUM_GPUS
+
$node_gpu
))
GPU_DEVICES+
=
$((
$DEVICE_NUM
))
if
[
$node_gpu
-lt
$((
$NUM_GPUS
-
1
))
]
;
then
GPU_DEVICES+
=
','
fi
done
GPU_DEVICES+
=
'"'
echo
"Running node
$node
with GPU devices:
$GPU_DEVICES
"
if
[
$node
-lt
$((
$NUM_NODES
-
1
))
]
;
then
docker
exec
-d
node
$node
/bin/bash
-c
"
${
COMMANDS
[
$node
]
}
"
else
docker
exec
node
$node
/bin/bash
-c
"
${
COMMANDS
[
$node
]
}
"
fi
done
}
cleanup
()
{
for
node
in
$(
seq
0
$((
$NUM_NODES
-
1
))
)
;
do
docker stop node
$node
done
docker network
rm
docker-net
}
trap
cleanup EXIT
start_network
start_nodes
run_nodes
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