From 3f454dd3ce42dfb024f076b6d51c865798eed834 Mon Sep 17 00:00:00 2001 From: Ostrzyciel Date: Sat, 13 Jan 2024 19:30:03 +0100 Subject: [PATCH] Code cleanup, update README --- README.md | 27 ++++++++++++++----- bin/car.sh | 2 +- bin/fall_multiple.sh | 2 +- .../benchmark/util/GrpcConnector.scala | 1 - .../benchmark/util/ImageToTensor.scala | 1 - 5 files changed, 22 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 8a7f160..f8791cf 100644 --- a/README.md +++ b/README.md @@ -24,19 +24,32 @@ Where `` are the arguments to the benchmark driver: - host – host to send requests to - port – port to send requests to - For `car`: - - batchSize – size of each batch - - intervalMillis – interval between batches in milliseconds - - nBatches – number of batches to generate + - batchSize – size of batches sent to the MIS + - intervalMillis – interval between vehicle scans in milliseconds + - nBatches – number of vehicle scans to generate - host – host to send requests to - port – port to send requests to ### Data -TODO +The inference data should be placed in the `/worker/data` directory of the container. The directory structure should be as follows: + +- `/worker/data` + - `accel.csv` – acceleration data, downloaded from [here](https://github.com/Modular-ML-inference/ml-usecase/blob/main/fall_detection/data/test_accel.csv) + - `car` – directory containing the subset of the [CarDD dataset](https://cardd-ustc.github.io/), obtained using the instructions [here](https://github.com/Modular-ML-inference/ml-usecase). ### Benchmark scripts -TODO +The `bin` directory contains Bash scripts useful for reproducing the experiments from the paper. The scripts use the aforementioned Docker container and assume that the data is placed in the `./data` directory on the host machine, the results are then saved in the `./out` directory. + +- `fall.sh` – fall detection benchmark, using only one client at a time (used in the tests with the GWEN). +- `fall_multiple.sh` – fall detection benchmark, using multiple clients at a time (used in the tests with the x86-64 server). +- `car.sh` – scratch detection benchmark. + +All scripts take two positional arguments: + +- Hostname/IP of the Modular Inference Server +- Port of the Modular Inference Server ### Examples @@ -44,9 +57,9 @@ TODO ```bash java -jar /app/benchmark-assembly.jar fall 10 500 100 10.0.0.2 8080 ``` -- Run the `car` test with 5 images per batch, 2 minutes (120000 ms) between batches, 100 batches, sending to `localhost:8080`: +- Run the `car` test with 4 images per batch, 3 minutes (180000 ms) between scans, 15 vehicle scans, sending to `localhost:8080`: ```bash - java -jar /app/benchmark-assembly.jar car 5 120000 100 10.0.0.2 8080 + java -jar /app/benchmark-assembly.jar car 4 180000 15 10.0.0.2 8080 ``` ## Authors diff --git a/bin/car.sh b/bin/car.sh index 2ac9cd0..1c44014 100644 --- a/bin/car.sh +++ b/bin/car.sh @@ -3,7 +3,7 @@ set -eux BATCHES="1 4 16" -CLIENTS="1 4 16" +CLIENTS="1 2 4" docker pull ghcr.io/modular-ml-inference/benchmark-driver:main diff --git a/bin/fall_multiple.sh b/bin/fall_multiple.sh index a46d665..cba7f6a 100644 --- a/bin/fall_multiple.sh +++ b/bin/fall_multiple.sh @@ -3,7 +3,7 @@ set -eux DEVICES="10 40 160" -CLIENTS="$3" +CLIENTS="1 4 16" docker pull ghcr.io/modular-ml-inference/benchmark-driver:main diff --git a/src/main/scala/eu/assistiot/inference/benchmark/util/GrpcConnector.scala b/src/main/scala/eu/assistiot/inference/benchmark/util/GrpcConnector.scala index 04c5aa9..6984e2f 100644 --- a/src/main/scala/eu/assistiot/inference/benchmark/util/GrpcConnector.scala +++ b/src/main/scala/eu/assistiot/inference/benchmark/util/GrpcConnector.scala @@ -10,6 +10,5 @@ class GrpcConnector(host: String, port: Int)(using ActorSystem): .withTls(false) .withChannelBuilderOverrides(_.maxInboundMessageSize(Int.MaxValue)) - // TODO: inverse broadcast val client = ExtendedInferenceServiceClient(clientSettings) diff --git a/src/main/scala/eu/assistiot/inference/benchmark/util/ImageToTensor.scala b/src/main/scala/eu/assistiot/inference/benchmark/util/ImageToTensor.scala index 4e3666b..afe81ee 100644 --- a/src/main/scala/eu/assistiot/inference/benchmark/util/ImageToTensor.scala +++ b/src/main/scala/eu/assistiot/inference/benchmark/util/ImageToTensor.scala @@ -2,7 +2,6 @@ package eu.assistiot.inference.benchmark package util import com.google.protobuf.ByteString -import stream.encoding.CarEncodingFlow import java.awt.image.BufferedImage