Skip to content

Commit

Permalink
directly use legion executable post installation
Browse files Browse the repository at this point in the history
  • Loading branch information
goliaro committed Jul 11, 2023
1 parent 6d38f15 commit a7524c4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/python_interface_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,22 @@ set -x
set -e

check_python_interface() {
# Usage: check_python_interface {python, legion_python}
# Usage: check_python_interface {python, legion_python} {before-installation, after-installation}
GPUS=1
BATCHSIZE=$((GPUS * 64))
FSIZE=14048
ZSIZE=12192
interpreter=${1:-python}
installation_status=${2:-"before-installation"}
if [[ "$interpreter" == "python" ]]; then
EXE="python"
echo "Running a single-GPU Python test to check the Python interface (native python interpreter)"
$EXE "$FF_HOME"/examples/python/keras/seq_mnist_mlp.py -ll:gpu "$GPUS" -ll:fsize "$FSIZE" -ll:zsize "$ZSIZE" -b ${BATCHSIZE} --only-data-parallel
elif [[ "$interpreter" == "legion_python" ]]; then
EXE="$FF_HOME"/python/legion_python
if [[ "$installation_status" == "after-installation" ]]; then
EXE="legion_python"
fi
echo "Running a single-GPU Python test to check the Python interface (legion_python interpreter)"
$EXE "$FF_HOME"/examples/python/keras/seq_mnist_mlp.py -ll:py 1 -ll:gpu "$GPUS" -ll:fsize "$FSIZE" -ll:zsize "$ZSIZE" -b ${BATCHSIZE} --only-data-parallel
else
Expand Down Expand Up @@ -48,7 +52,7 @@ elif [[ "$installation_status" == "after-installation" ]]; then
# Import flexflow.core module in Python
python -c "import flexflow.core; exit()"
# Run a single-gpu test using the legion_python interpreter
check_python_interface legion_python
check_python_interface legion_python after-installation
# Run a single-gpu test using the native python interpreter
check_python_interface python
else
Expand Down

0 comments on commit a7524c4

Please sign in to comment.