Skip to content

Commit 5c04cbf

Browse files
committed
version bump v0.3.0
1 parent 9710cbc commit 5c04cbf

File tree

3 files changed

+59
-32
lines changed

3 files changed

+59
-32
lines changed

README.md

+54-27
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,63 @@ The command line utility help is as follows:
2222
```
2323
Usage: construe [OPTIONS] COMMAND [ARGS]...
2424
25+
A utility for executing inferencing benchmarks.
26+
2527
Options:
26-
--version Show the version and exit.
27-
-d, --device TEXT specify the pytorch device to run on e.g. cpu, mps or
28-
cuda
29-
-e, --env TEXT name of the experimental environment for comparison
30-
(default is hostname)
31-
-h, --help Show this message and exit.
28+
--version Show the version and exit.
29+
-o, --out TEXT specify the path to write the benchmark
30+
results to
31+
-d, --device TEXT specify the pytorch device to run on e.g. cpu,
32+
mps or cuda
33+
-e, --env TEXT name of the experimental environment for
34+
comparison (default is hostname)
35+
-c, --count INTEGER specify the number of times to run each
36+
benchmark
37+
-l, --limit INTEGER limit the number of instances to inference on
38+
in each benchmark
39+
-D, --datadir TEXT specify the location to download datasets to
40+
-M, --modeldir TEXT specify the location to download models to
41+
-S, --sample / --no-sample use sample dataset instead of full dataset for
42+
benchmark
43+
-C, --cleanup / --no-cleanup cleanup all downloaded datasets after the
44+
benchmark is run
45+
-Q, --verbose / --quiet specify the verbosity of the output and
46+
progress bars
47+
-h, --help Show this message and exit.
3248
3349
Commands:
34-
basic
35-
moondream
50+
basic Runs basic dot product performance benchmarks.
51+
datasets Helper utility for managing the dataset cache.
52+
models Helper utility for managing the models cache.
53+
moondream Executes image-to-text inferencing benchmarks.
54+
run Executes all available benchmarks.
55+
whisper Executes audio-to-text inferencing benchmarks.
56+
```
57+
58+
## Run Benchmarks
59+
60+
You can either run all available benchamrks (excluding some, or specifying which benchmarks to include) or you can run an individual benchmark. To run all benchmarks:
61+
62+
```
63+
$ construe -e "MacBook Pro 2022 M1" run
64+
```
65+
66+
This will run all available benchmarks. The `-e` flag specifies the environment for comparison purposes and the results will be saved as a JSON file on the local disk.
67+
68+
When running each benchmark, the model and dataset for that benchmark is downloaded, the benchmark is executed, then the model and dataset are cleaned up. If you do not want the data to be cleaned up use the `-C` or `--no-cleanup` flag to cache the models and datasets between runs.
69+
70+
If you would like to limit the number of instances per run you can use the `-l` or `--limit` flag; this might speed up the benchmarks if you're just trying to get a simple sense of inferening on the device. You can also specify the `-c` or `--count` flag to run each benchmark multiple times on the same instances to get more detailed results.
71+
72+
To run an individual benchmark, run it by name; for example to run the `whisper` speech-to-text benchmark:
73+
74+
```
75+
$ construe whisper
76+
```
77+
78+
Alternatively if you want to exclude `whisper` (e.g. run all benchmarks but `whisper`), use the `-E` or `--exclude` flag as follows:
79+
80+
```
81+
$ construe run -E whisper
3682
```
3783

3884
## Basic Benchmarks
@@ -62,25 +108,6 @@ Options:
62108
-h, --help Show this message and exit.
63109
```
64110

65-
## Moondream Benchmarks
66-
67-
The [moondream](https://huggingface.co/vikhyatk/moondream2) package contains small image-to-text computer vision models that can be used in the first step of a [content moderation](https://www.cloudraft.io/blog/content-moderation-using-llamaindex-and-llm) workflow (e.g. image to text, moderate text). This benchmark executes the model for _encoding_ and _inferencing_ on a small number of images and reports the average time for both operations and the line-by-line memory usage of the model.
68-
69-
It can be run as follows:
70-
71-
```
72-
$ construe moondream
73-
```
74-
75-
Command usage is as follows:
76-
77-
```
78-
Usage: construe moondream [OPTIONS]
79-
80-
Options:
81-
-h, --help Show this message and exit.
82-
```
83-
84111
## Model References
85112

86113
1. Image to Text: [Moondream (vikhyatk/moondream2)](https://huggingface.co/vikhyatk/moondream2)

construe/__main__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -195,14 +195,14 @@ def main(
195195

196196
@main.command()
197197
@click.option(
198-
"-e",
198+
"-E",
199199
"--exclude",
200200
default=None,
201201
type=click.Choice(BENCHMARKS.keys(), case_sensitive=False),
202202
help="specify benchmarks to exclude from runner",
203203
)
204204
@click.option(
205-
"-i",
205+
"-I",
206206
"--include",
207207
default=None,
208208
type=click.Choice(BENCHMARKS.keys(), case_sensitive=False),

construe/version.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
# Module version and package information
66
__version_info__ = {
77
"major": 0,
8-
"minor": 2,
8+
"minor": 3,
99
"micro": 0,
10-
"releaselevel": "alpha",
10+
"releaselevel": "beta",
1111
"post": 0,
12-
"serial": 2,
12+
"serial": 3,
1313
}
1414

1515

0 commit comments

Comments
 (0)