parent
24fc351b02
commit
3d051a2e53
@ -0,0 +1,124 @@
|
|||||||
|
# This Makefile builds a variety of synthetic and real-world applications ported to SLEdge
|
||||||
|
#
|
||||||
|
# Some of the tests generate experimental results in the form of charts of *.csv files. Refer to
|
||||||
|
# the relevant directory for specifics.
|
||||||
|
|
||||||
|
# gocr - GNU Optical Character Recognition
|
||||||
|
./runtime/bin/gocr_wasm.so:
|
||||||
|
make gocr.install -C ./runtime/tests
|
||||||
|
|
||||||
|
PHONY: gocr__by_dpi
|
||||||
|
gocr__by_dpi: ./runtime/bin/gocr_wasm.so
|
||||||
|
# cd ./runtime/experiments/applications/ocr/by_dpi && ./install.sh
|
||||||
|
cd ./runtime/experiments/applications/ocr/by_dpi && ./run.sh
|
||||||
|
|
||||||
|
PHONY: gocr__by_font
|
||||||
|
gocr__by_font: ./runtime/bin/gocr_wasm.so
|
||||||
|
cd ./runtime/experiments/applications/ocr/by_font && ./run.sh
|
||||||
|
|
||||||
|
PHONY: gocr__by_word
|
||||||
|
gocr__by_word: ./runtime/bin/gocr_wasm.so
|
||||||
|
cd ./runtime/experiments/applications/ocr/by_word && ./run.sh
|
||||||
|
|
||||||
|
PHONY: gocr__fivebyeight
|
||||||
|
gocr__fivebyeight: ./runtime/bin/gocr_wasm.so
|
||||||
|
cd ./runtime/experiments/applications/ocr/fivebyeight && ./run.sh
|
||||||
|
|
||||||
|
PHONY: gocr__handwriting
|
||||||
|
gocr__handwriting: ./runtime/bin/gocr_wasm.so
|
||||||
|
cd ./runtime/experiments/applications/ocr/handwriting && ./run.sh
|
||||||
|
|
||||||
|
PHONY: gocr__hyde
|
||||||
|
gocr__hyde: ./runtime/bin/gocr_wasm.so
|
||||||
|
cd ./runtime/experiments/applications/ocr/hyde && ./run.sh
|
||||||
|
|
||||||
|
PHONY: gocr_all
|
||||||
|
gocr__all: \
|
||||||
|
gocr__by_dpi \
|
||||||
|
gocr__by_font \
|
||||||
|
gocr__by_word \
|
||||||
|
gocr__fivebyeight \
|
||||||
|
gocr__handwriting \
|
||||||
|
gocr__hyde
|
||||||
|
|
||||||
|
# Extended Kalman Filter applied to binary GPS data
|
||||||
|
./runtime/bin/ekf_wasm.so:
|
||||||
|
make ekf.install -C ./runtime/tests
|
||||||
|
|
||||||
|
PHONY: ekf__by_iteration
|
||||||
|
ekf__by_iteration: ./runtime/bin/ekf_wasm.so
|
||||||
|
cd ./runtime/experiments/applications/ekf/by_iteration && ./run.sh
|
||||||
|
|
||||||
|
PHONY: ekf__one_iteration
|
||||||
|
ekf__one_iteration: ./runtime/bin/ekf_wasm.so
|
||||||
|
cd ./runtime/experiments/applications/ekf/one_iteration && ./run.sh
|
||||||
|
|
||||||
|
PHONY: ekf__all
|
||||||
|
ekf__all: \
|
||||||
|
ekf__by_iteration \
|
||||||
|
ekf__one_iteration
|
||||||
|
|
||||||
|
# CIFAR10-based Image Classification
|
||||||
|
./runtime/bin/cifar10_wasm.so:
|
||||||
|
make cifar10.install -C ./applications
|
||||||
|
|
||||||
|
PHONY: cifar10__image_classification
|
||||||
|
cifar10__image_classification: ./runtime/bin/cifar10_wasm.so
|
||||||
|
cd ./runtime/experiments/applications/imageclassification && ./run.sh
|
||||||
|
|
||||||
|
PHONY: cifar10__all
|
||||||
|
cifar10__all: \
|
||||||
|
cifar10__image_classification
|
||||||
|
|
||||||
|
# SOD Computer Vision / ML Applications
|
||||||
|
# https://sod.pixlab.io/
|
||||||
|
|
||||||
|
# SOD - Image Resize
|
||||||
|
./runtime/bin/resize_wasm.so:
|
||||||
|
make resize_image.install -C ./applications
|
||||||
|
|
||||||
|
# Commented out command installs imagemagick. Requires password for sudo to install
|
||||||
|
PHONY: sod__image_resize__test
|
||||||
|
sod__image_resize__test: ./runtime/bin/resize_wasm.so
|
||||||
|
# cd ./runtime/experiments/applications/imageresize/test && ./install.sh
|
||||||
|
cd ./runtime/experiments/applications/imageresize/test && ./run.sh
|
||||||
|
|
||||||
|
PHONY: sod__image_resize__by_resolution
|
||||||
|
sod__image_resize__by_resolution: ./runtime/bin/resize_wasm.so
|
||||||
|
# cd ./runtime/experiments/applications/imageresize/by_resolution && ./install.sh
|
||||||
|
cd ./runtime/experiments/applications/imageresize/by_resolution && ./run.sh
|
||||||
|
|
||||||
|
# SOD - License Plate Detection
|
||||||
|
./runtime/bin/lpd_wasm.so:
|
||||||
|
make license_plate_detection.install -C ./applications
|
||||||
|
|
||||||
|
PHONY: sod__lpd__by_plate_count
|
||||||
|
sod__lpd__by_plate_count: ./runtime/bin/lpd_wasm.so
|
||||||
|
cd ./runtime/experiments/applications/licenseplate/by_plate_count && ./run.sh
|
||||||
|
|
||||||
|
PHONY: sod__all
|
||||||
|
sod__all: sod__image_resize__test sod__image_resize__by_resolution sod__lpd__by_plate_count
|
||||||
|
|
||||||
|
# Scheduler Experiments with synthetic workloads
|
||||||
|
./runtime/bin/fibonacci_wasm.so:
|
||||||
|
make fibonacci.install -C ./applications
|
||||||
|
|
||||||
|
PHONY: fibonacci__bimodal
|
||||||
|
fibonacci__bimodal: ./runtime/bin/fibonacci_wasm.so
|
||||||
|
cd ./runtime/experiments/bimodal/ && ./run.sh
|
||||||
|
|
||||||
|
./runtime/bin/empty_wasm.so:
|
||||||
|
make empty.install -C ./applications
|
||||||
|
|
||||||
|
PHONY: empty__concurrency
|
||||||
|
empty__concurrency: ./runtime/bin/empty_wasm.so
|
||||||
|
# ./runtime/experiments/concurrency/ && install.sh
|
||||||
|
./runtime/experiments/concurrency/ && run.sh
|
||||||
|
|
||||||
|
all: \
|
||||||
|
gocr__all \
|
||||||
|
ekf__all \
|
||||||
|
cifar10__all \
|
||||||
|
sod__all \
|
||||||
|
fibonacci__bimodal \
|
||||||
|
empty__concurrency
|
@ -1,193 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# Test Driver Script
|
|
||||||
# TODO: Consider refactoring into Make infrastructure
|
|
||||||
|
|
||||||
if [[ $0 != "./test.sh" ]]; then
|
|
||||||
echo "Must run in same directory as ./test.sh"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
base_dir=$(pwd)
|
|
||||||
|
|
||||||
declare -ra tests=(
|
|
||||||
ocr_hyde
|
|
||||||
ocr_handwriting
|
|
||||||
ocr_fivebyeight
|
|
||||||
ocr_by_word
|
|
||||||
ocr_by_font
|
|
||||||
ocr_by_dpi
|
|
||||||
ekf_by_iteration
|
|
||||||
ekf_one_iteration
|
|
||||||
image_classification
|
|
||||||
image_resize
|
|
||||||
image_resize_by_resolution
|
|
||||||
lpd_by_plate_count
|
|
||||||
bimodal
|
|
||||||
concurrency
|
|
||||||
)
|
|
||||||
|
|
||||||
declare -a failed_tests=()
|
|
||||||
|
|
||||||
# OCR Tests
|
|
||||||
# FIXME: OCR tests seem to sporadically fail and then work on rerun.
|
|
||||||
ocr_hyde() {
|
|
||||||
make gocr.install -C "$base_dir/runtime/tests" || exit 1
|
|
||||||
pushd "$base_dir/runtime/experiments/applications/ocr/hyde" || exit 1
|
|
||||||
./run.sh || failed_tests+=("ocr_hyde")
|
|
||||||
popd || exit 1
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
ocr_handwriting() {
|
|
||||||
make gocr.install -C "$base_dir/runtime/tests" || exit 1
|
|
||||||
pushd "$base_dir/runtime/experiments/applications/ocr/handwriting" || exit 1
|
|
||||||
./run.sh || failed_tests+=("ocr_handwriting")
|
|
||||||
popd || exit 1
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
ocr_fivebyeight() {
|
|
||||||
make gocr.install -C "$base_dir/runtime/tests" || exit 1
|
|
||||||
pushd "$base_dir/runtime/experiments/applications/ocr/fivebyeight" || exit 1
|
|
||||||
./run.sh || failed_tests+=("ocr_fivebyeight")
|
|
||||||
popd || exit 1
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
ocr_by_word() {
|
|
||||||
make gocr.install -C "$base_dir/runtime/tests" || exit 1
|
|
||||||
pushd "$base_dir/runtime/experiments/applications/ocr/by_word" || exit 1
|
|
||||||
# ./install.sh || exit 1
|
|
||||||
./run.sh || failed_tests+=("ocr_by_word")
|
|
||||||
popd || exit 1
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
ocr_by_font() {
|
|
||||||
make gocr.install -C "$base_dir/runtime/tests" || exit 1
|
|
||||||
pushd "$base_dir/runtime/experiments/applications/ocr/by_font" || exit 1
|
|
||||||
# ./install.sh || exit 1
|
|
||||||
./run.sh || failed_tests+=("ocr_by_font")
|
|
||||||
popd || exit 1
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
ocr_by_dpi() {
|
|
||||||
make gocr.install -C "$base_dir/runtime/tests" || exit 1
|
|
||||||
pushd "$base_dir/runtime/experiments/applications/ocr/by_dpi" || exit 1
|
|
||||||
# ./install.sh || exit 1
|
|
||||||
./run.sh || failed_tests+=("ocr_by_dpi")
|
|
||||||
popd || exit 1
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
# EKF Tests
|
|
||||||
ekf_by_iteration() {
|
|
||||||
make ekf.install -C "$base_dir/runtime/tests" || exit 1
|
|
||||||
pushd "$base_dir/runtime/experiments/applications/ekf/by_iteration" || exit 1
|
|
||||||
./run.sh || failed_tests+=("ekf_by_iteration")
|
|
||||||
popd || exit 1
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
ekf_one_iteration() {
|
|
||||||
make ekf.install -C "$base_dir/runtime/tests" || exit 1
|
|
||||||
pushd "$base_dir/runtime/experiments/applications/ekf/one_iteration" || exit 1
|
|
||||||
./run.sh || failed_tests+=("ekf_one_iteration")
|
|
||||||
popd || exit 1
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
# cifar10 Tests
|
|
||||||
image_classification() {
|
|
||||||
make cifar10.install -C "$base_dir/runtime/tests" || exit 1
|
|
||||||
pushd "$base_dir/runtime/experiments/applications/imageclassification" || exit 1
|
|
||||||
./run.sh || failed_tests+=("image_classification")
|
|
||||||
popd || exit 1
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
image_resize() {
|
|
||||||
make resize.install -C "$base_dir/runtime/tests" || exit 1
|
|
||||||
pushd "$base_dir/runtime/experiments/applications/imageresize/test" || exit 1
|
|
||||||
# ./install.sh || exit 1
|
|
||||||
./run.sh || failed_tests+=("image_resize")
|
|
||||||
popd || exit 1
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
image_resize_by_resolution() {
|
|
||||||
make resize.install -C "$base_dir/runtime/tests" || exit 1
|
|
||||||
pushd "$base_dir/runtime/experiments/applications/imageresize/by_resolution" || exit 1
|
|
||||||
# ./install.sh || exit 1
|
|
||||||
./run.sh || failed_tests+=("image_resize_resolution")
|
|
||||||
popd || exit 1
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
lpd_by_plate_count() {
|
|
||||||
make lpd.install -C "$base_dir/runtime/tests" || exit 1
|
|
||||||
pushd "$base_dir/runtime/experiments/applications/licenseplate/by_plate_count" || exit 1
|
|
||||||
./run.sh || failed_tests+=("lpd_by_plate_count")
|
|
||||||
popd || exit 1
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
bimodal() {
|
|
||||||
echo "Bimodal"
|
|
||||||
make fibonacci.install -C "$base_dir/runtime/tests" || exit 1
|
|
||||||
pushd "$base_dir/runtime/experiments/bimodal/" || exit 1
|
|
||||||
# ./install.sh || exit 1
|
|
||||||
./run.sh || failed_tests+=("bimodal")
|
|
||||||
popd || exit 1
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
concurrency() {
|
|
||||||
echo "Concurrency"
|
|
||||||
make empty.install -C "$base_dir/runtime/tests" || exit 1
|
|
||||||
pushd "$base_dir/runtime/experiments/concurrency/" || exit 1
|
|
||||||
# ./install.sh || exit 1
|
|
||||||
./run.sh || failed_tests+=("concurrency")
|
|
||||||
popd || exit 1
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
main() {
|
|
||||||
cd "$base_dir/awsm" && cargo build --release || exit 1
|
|
||||||
make all -C "$base_dir/runtime" || exit 1
|
|
||||||
|
|
||||||
if (($# == 0)); then
|
|
||||||
# If no arguments are provided, run all tests
|
|
||||||
for test in "${tests[@]}"; do
|
|
||||||
echo "[[$test]]"
|
|
||||||
"$test"
|
|
||||||
done
|
|
||||||
|
|
||||||
else
|
|
||||||
# Otherwise, only run the tests passed as arguments
|
|
||||||
for test in "$@"; do
|
|
||||||
if [[ ! " ${tests[*]} " =~ " ${test} " ]]; then
|
|
||||||
printf "Error: %s is not a known test\n" "$test"
|
|
||||||
return 1
|
|
||||||
else
|
|
||||||
"$test"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
fi
|
|
||||||
|
|
||||||
local -i failure_count=${#failed_tests[@]}
|
|
||||||
if ((failure_count > 0)); then
|
|
||||||
printf "Failed Tests\n"
|
|
||||||
for test in "${failed_tests[@]}"; do
|
|
||||||
printf "\t%s\n" "$test"
|
|
||||||
done
|
|
||||||
exit 1
|
|
||||||
else
|
|
||||||
printf "All tests passed\n"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
main "$@"
|
|
Loading…
Reference in new issue