diff --git a/Cargo.toml b/Cargo.toml index 1e618b1..fd38826 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -32,5 +32,6 @@ exclude = [ "benchmarks/shootout-switch", "benchmarks/shootout-xblabla20", "benchmarks/shootout-xchacha20", - "engines/native/libengine" + "benchmarks/tract-onnx-image-classification", + "engines/native/libengine", ] diff --git a/benchmarks/all.suite b/benchmarks/all.suite index 05b932e..da7a21c 100644 --- a/benchmarks/all.suite +++ b/benchmarks/all.suite @@ -117,3 +117,4 @@ shootout/shootout-switch.wasm shootout/shootout-xblabla20.wasm shootout/shootout-xchacha20.wasm spidermonkey/benchmark.wasm +tract-onnx-image-classification/benchmark.wasm diff --git a/benchmarks/libsodium/Dockerfile b/benchmarks/libsodium/Dockerfile index d38cf13..dd5708c 100644 --- a/benchmarks/libsodium/Dockerfile +++ b/benchmarks/libsodium/Dockerfile @@ -5,9 +5,9 @@ RUN apt update && apt install -y wget xz-utils unzip git # Download and extract the latest stable version of Zig and retrieve the # `stable` branch of libsodium that can be built by it. WORKDIR / -RUN wget https://ziglang.org/download/0.11.0/zig-linux-x86_64-0.11.0.tar.xz -RUN tar --extract --verbose --file=zig-linux-x86_64-0.11.0.tar.xz -ENV PATH="${PATH}:/zig-linux-x86_64-0.11.0" +RUN wget https://ziglang.org/download/0.12.0/zig-linux-x86_64-0.12.0.tar.xz +RUN tar --extract --verbose --file=zig-linux-x86_64-0.12.0.tar.xz +ENV PATH="${PATH}:/zig-linux-x86_64-0.12.0" RUN echo "zig version = $(zig version)" RUN wget https://github.com/jedisct1/libsodium/archive/stable.zip RUN unzip stable.zip diff --git a/benchmarks/libsodium/libsodium-aead_aegis128l.wasm b/benchmarks/libsodium/libsodium-aead_aegis128l.wasm index 4d7ce0c..4a919c5 100755 Binary files a/benchmarks/libsodium/libsodium-aead_aegis128l.wasm and b/benchmarks/libsodium/libsodium-aead_aegis128l.wasm differ diff --git a/benchmarks/libsodium/libsodium-aead_aegis256.wasm b/benchmarks/libsodium/libsodium-aead_aegis256.wasm index ffd454e..f260b16 100755 Binary files a/benchmarks/libsodium/libsodium-aead_aegis256.wasm and b/benchmarks/libsodium/libsodium-aead_aegis256.wasm differ diff --git a/benchmarks/libsodium/libsodium-aead_aes256gcm.wasm b/benchmarks/libsodium/libsodium-aead_aes256gcm.wasm index e23b35a..eae5a53 100755 Binary files a/benchmarks/libsodium/libsodium-aead_aes256gcm.wasm and b/benchmarks/libsodium/libsodium-aead_aes256gcm.wasm differ diff --git a/benchmarks/libsodium/libsodium-aead_aes256gcm2.wasm b/benchmarks/libsodium/libsodium-aead_aes256gcm2.wasm index 5b600c1..60cd3c7 100755 Binary files a/benchmarks/libsodium/libsodium-aead_aes256gcm2.wasm and b/benchmarks/libsodium/libsodium-aead_aes256gcm2.wasm differ diff --git a/benchmarks/libsodium/libsodium-aead_chacha20poly1305.wasm b/benchmarks/libsodium/libsodium-aead_chacha20poly1305.wasm index 47ea48e..3a10957 100755 Binary files a/benchmarks/libsodium/libsodium-aead_chacha20poly1305.wasm and b/benchmarks/libsodium/libsodium-aead_chacha20poly1305.wasm differ diff --git a/benchmarks/libsodium/libsodium-aead_chacha20poly13052.wasm b/benchmarks/libsodium/libsodium-aead_chacha20poly13052.wasm index d063c5b..20efb42 100755 Binary files a/benchmarks/libsodium/libsodium-aead_chacha20poly13052.wasm and b/benchmarks/libsodium/libsodium-aead_chacha20poly13052.wasm differ diff --git a/benchmarks/libsodium/libsodium-aead_xchacha20poly1305.wasm b/benchmarks/libsodium/libsodium-aead_xchacha20poly1305.wasm index ed9d633..a39ba3b 100755 Binary files a/benchmarks/libsodium/libsodium-aead_xchacha20poly1305.wasm and b/benchmarks/libsodium/libsodium-aead_xchacha20poly1305.wasm differ diff --git a/benchmarks/libsodium/libsodium-auth.wasm b/benchmarks/libsodium/libsodium-auth.wasm index b1f25e1..5290a89 100755 Binary files a/benchmarks/libsodium/libsodium-auth.wasm and b/benchmarks/libsodium/libsodium-auth.wasm differ diff --git a/benchmarks/libsodium/libsodium-auth2.wasm b/benchmarks/libsodium/libsodium-auth2.wasm index f3f4ed1..9f2cacf 100755 Binary files a/benchmarks/libsodium/libsodium-auth2.wasm and b/benchmarks/libsodium/libsodium-auth2.wasm differ diff --git a/benchmarks/libsodium/libsodium-auth3.wasm b/benchmarks/libsodium/libsodium-auth3.wasm index af53299..84fe310 100755 Binary files a/benchmarks/libsodium/libsodium-auth3.wasm and b/benchmarks/libsodium/libsodium-auth3.wasm differ diff --git a/benchmarks/libsodium/libsodium-auth5.wasm b/benchmarks/libsodium/libsodium-auth5.wasm index fe827fb..d8f142a 100755 Binary files a/benchmarks/libsodium/libsodium-auth5.wasm and b/benchmarks/libsodium/libsodium-auth5.wasm differ diff --git a/benchmarks/libsodium/libsodium-auth6.wasm b/benchmarks/libsodium/libsodium-auth6.wasm index c3584b6..1f88ec0 100755 Binary files a/benchmarks/libsodium/libsodium-auth6.wasm and b/benchmarks/libsodium/libsodium-auth6.wasm differ diff --git a/benchmarks/libsodium/libsodium-auth7.wasm b/benchmarks/libsodium/libsodium-auth7.wasm index 663b390..8047e29 100755 Binary files a/benchmarks/libsodium/libsodium-auth7.wasm and b/benchmarks/libsodium/libsodium-auth7.wasm differ diff --git a/benchmarks/libsodium/libsodium-box.wasm b/benchmarks/libsodium/libsodium-box.wasm index f048ce7..6d33ded 100755 Binary files a/benchmarks/libsodium/libsodium-box.wasm and b/benchmarks/libsodium/libsodium-box.wasm differ diff --git a/benchmarks/libsodium/libsodium-box2.wasm b/benchmarks/libsodium/libsodium-box2.wasm index a628077..daf1d04 100755 Binary files a/benchmarks/libsodium/libsodium-box2.wasm and b/benchmarks/libsodium/libsodium-box2.wasm differ diff --git a/benchmarks/libsodium/libsodium-box7.wasm b/benchmarks/libsodium/libsodium-box7.wasm index 8ca7348..1fc47a7 100755 Binary files a/benchmarks/libsodium/libsodium-box7.wasm and b/benchmarks/libsodium/libsodium-box7.wasm differ diff --git a/benchmarks/libsodium/libsodium-box8.wasm b/benchmarks/libsodium/libsodium-box8.wasm index 98710e8..78b2552 100755 Binary files a/benchmarks/libsodium/libsodium-box8.wasm and b/benchmarks/libsodium/libsodium-box8.wasm differ diff --git a/benchmarks/libsodium/libsodium-box_easy.wasm b/benchmarks/libsodium/libsodium-box_easy.wasm index af56dcf..3ecf181 100755 Binary files a/benchmarks/libsodium/libsodium-box_easy.wasm and b/benchmarks/libsodium/libsodium-box_easy.wasm differ diff --git a/benchmarks/libsodium/libsodium-box_easy2.wasm b/benchmarks/libsodium/libsodium-box_easy2.wasm index cd7c825..62dfdb3 100755 Binary files a/benchmarks/libsodium/libsodium-box_easy2.wasm and b/benchmarks/libsodium/libsodium-box_easy2.wasm differ diff --git a/benchmarks/libsodium/libsodium-box_seal.wasm b/benchmarks/libsodium/libsodium-box_seal.wasm index ea9f880..12db429 100755 Binary files a/benchmarks/libsodium/libsodium-box_seal.wasm and b/benchmarks/libsodium/libsodium-box_seal.wasm differ diff --git a/benchmarks/libsodium/libsodium-box_seed.wasm b/benchmarks/libsodium/libsodium-box_seed.wasm index 9c8d034..0577434 100755 Binary files a/benchmarks/libsodium/libsodium-box_seed.wasm and b/benchmarks/libsodium/libsodium-box_seed.wasm differ diff --git a/benchmarks/libsodium/libsodium-chacha20.wasm b/benchmarks/libsodium/libsodium-chacha20.wasm index a496999..18e32da 100755 Binary files a/benchmarks/libsodium/libsodium-chacha20.wasm and b/benchmarks/libsodium/libsodium-chacha20.wasm differ diff --git a/benchmarks/libsodium/libsodium-codecs.wasm b/benchmarks/libsodium/libsodium-codecs.wasm index 96fee58..227cc49 100755 Binary files a/benchmarks/libsodium/libsodium-codecs.wasm and b/benchmarks/libsodium/libsodium-codecs.wasm differ diff --git a/benchmarks/libsodium/libsodium-core1.wasm b/benchmarks/libsodium/libsodium-core1.wasm index 45b2950..ad5a546 100755 Binary files a/benchmarks/libsodium/libsodium-core1.wasm and b/benchmarks/libsodium/libsodium-core1.wasm differ diff --git a/benchmarks/libsodium/libsodium-core2.wasm b/benchmarks/libsodium/libsodium-core2.wasm index 68c248f..585fb38 100755 Binary files a/benchmarks/libsodium/libsodium-core2.wasm and b/benchmarks/libsodium/libsodium-core2.wasm differ diff --git a/benchmarks/libsodium/libsodium-core3.wasm b/benchmarks/libsodium/libsodium-core3.wasm index c834017..dd70249 100755 Binary files a/benchmarks/libsodium/libsodium-core3.wasm and b/benchmarks/libsodium/libsodium-core3.wasm differ diff --git a/benchmarks/libsodium/libsodium-core4.wasm b/benchmarks/libsodium/libsodium-core4.wasm index 1e047af..54bb4fe 100755 Binary files a/benchmarks/libsodium/libsodium-core4.wasm and b/benchmarks/libsodium/libsodium-core4.wasm differ diff --git a/benchmarks/libsodium/libsodium-core5.wasm b/benchmarks/libsodium/libsodium-core5.wasm index 31fb464..420e610 100755 Binary files a/benchmarks/libsodium/libsodium-core5.wasm and b/benchmarks/libsodium/libsodium-core5.wasm differ diff --git a/benchmarks/libsodium/libsodium-core6.wasm b/benchmarks/libsodium/libsodium-core6.wasm index c0dd79a..0556628 100755 Binary files a/benchmarks/libsodium/libsodium-core6.wasm and b/benchmarks/libsodium/libsodium-core6.wasm differ diff --git a/benchmarks/libsodium/libsodium-core_ed25519.wasm b/benchmarks/libsodium/libsodium-core_ed25519.wasm index b305689..ce42aa4 100755 Binary files a/benchmarks/libsodium/libsodium-core_ed25519.wasm and b/benchmarks/libsodium/libsodium-core_ed25519.wasm differ diff --git a/benchmarks/libsodium/libsodium-core_ristretto255.wasm b/benchmarks/libsodium/libsodium-core_ristretto255.wasm index 143ddee..da0dbb0 100755 Binary files a/benchmarks/libsodium/libsodium-core_ristretto255.wasm and b/benchmarks/libsodium/libsodium-core_ristretto255.wasm differ diff --git a/benchmarks/libsodium/libsodium-ed25519_convert.wasm b/benchmarks/libsodium/libsodium-ed25519_convert.wasm index 3202587..44a8937 100755 Binary files a/benchmarks/libsodium/libsodium-ed25519_convert.wasm and b/benchmarks/libsodium/libsodium-ed25519_convert.wasm differ diff --git a/benchmarks/libsodium/libsodium-generichash.wasm b/benchmarks/libsodium/libsodium-generichash.wasm index 66e89ad..ad28a9f 100755 Binary files a/benchmarks/libsodium/libsodium-generichash.wasm and b/benchmarks/libsodium/libsodium-generichash.wasm differ diff --git a/benchmarks/libsodium/libsodium-generichash2.wasm b/benchmarks/libsodium/libsodium-generichash2.wasm index 92d976e..4c9457f 100755 Binary files a/benchmarks/libsodium/libsodium-generichash2.wasm and b/benchmarks/libsodium/libsodium-generichash2.wasm differ diff --git a/benchmarks/libsodium/libsodium-generichash3.wasm b/benchmarks/libsodium/libsodium-generichash3.wasm index e0f241f..f89e6fa 100755 Binary files a/benchmarks/libsodium/libsodium-generichash3.wasm and b/benchmarks/libsodium/libsodium-generichash3.wasm differ diff --git a/benchmarks/libsodium/libsodium-hash.wasm b/benchmarks/libsodium/libsodium-hash.wasm index a02b25c..012a6bd 100755 Binary files a/benchmarks/libsodium/libsodium-hash.wasm and b/benchmarks/libsodium/libsodium-hash.wasm differ diff --git a/benchmarks/libsodium/libsodium-hash3.wasm b/benchmarks/libsodium/libsodium-hash3.wasm index 18e0763..7d69c32 100755 Binary files a/benchmarks/libsodium/libsodium-hash3.wasm and b/benchmarks/libsodium/libsodium-hash3.wasm differ diff --git a/benchmarks/libsodium/libsodium-kdf.wasm b/benchmarks/libsodium/libsodium-kdf.wasm index 909931b..28d4e2a 100755 Binary files a/benchmarks/libsodium/libsodium-kdf.wasm and b/benchmarks/libsodium/libsodium-kdf.wasm differ diff --git a/benchmarks/libsodium/libsodium-kdf_hkdf.wasm b/benchmarks/libsodium/libsodium-kdf_hkdf.wasm index 9625a4a..8fcf2bb 100755 Binary files a/benchmarks/libsodium/libsodium-kdf_hkdf.wasm and b/benchmarks/libsodium/libsodium-kdf_hkdf.wasm differ diff --git a/benchmarks/libsodium/libsodium-keygen.wasm b/benchmarks/libsodium/libsodium-keygen.wasm index 823a29e..108a94d 100755 Binary files a/benchmarks/libsodium/libsodium-keygen.wasm and b/benchmarks/libsodium/libsodium-keygen.wasm differ diff --git a/benchmarks/libsodium/libsodium-kx.wasm b/benchmarks/libsodium/libsodium-kx.wasm index 7cfacef..aa8e816 100755 Binary files a/benchmarks/libsodium/libsodium-kx.wasm and b/benchmarks/libsodium/libsodium-kx.wasm differ diff --git a/benchmarks/libsodium/libsodium-metamorphic.wasm b/benchmarks/libsodium/libsodium-metamorphic.wasm index bb9af3e..73d9f23 100755 Binary files a/benchmarks/libsodium/libsodium-metamorphic.wasm and b/benchmarks/libsodium/libsodium-metamorphic.wasm differ diff --git a/benchmarks/libsodium/libsodium-misuse.wasm b/benchmarks/libsodium/libsodium-misuse.wasm index 16da6e0..4738ccf 100755 Binary files a/benchmarks/libsodium/libsodium-misuse.wasm and b/benchmarks/libsodium/libsodium-misuse.wasm differ diff --git a/benchmarks/libsodium/libsodium-onetimeauth.wasm b/benchmarks/libsodium/libsodium-onetimeauth.wasm index d46e864..970d225 100755 Binary files a/benchmarks/libsodium/libsodium-onetimeauth.wasm and b/benchmarks/libsodium/libsodium-onetimeauth.wasm differ diff --git a/benchmarks/libsodium/libsodium-onetimeauth2.wasm b/benchmarks/libsodium/libsodium-onetimeauth2.wasm index 16da6e0..4738ccf 100755 Binary files a/benchmarks/libsodium/libsodium-onetimeauth2.wasm and b/benchmarks/libsodium/libsodium-onetimeauth2.wasm differ diff --git a/benchmarks/libsodium/libsodium-onetimeauth7.wasm b/benchmarks/libsodium/libsodium-onetimeauth7.wasm index 12c9053..817f7d5 100755 Binary files a/benchmarks/libsodium/libsodium-onetimeauth7.wasm and b/benchmarks/libsodium/libsodium-onetimeauth7.wasm differ diff --git a/benchmarks/libsodium/libsodium-pwhash_argon2i.wasm b/benchmarks/libsodium/libsodium-pwhash_argon2i.wasm index 90afbde..12ac634 100755 Binary files a/benchmarks/libsodium/libsodium-pwhash_argon2i.wasm and b/benchmarks/libsodium/libsodium-pwhash_argon2i.wasm differ diff --git a/benchmarks/libsodium/libsodium-pwhash_argon2id.wasm b/benchmarks/libsodium/libsodium-pwhash_argon2id.wasm index 0daee2d..a8f4672 100755 Binary files a/benchmarks/libsodium/libsodium-pwhash_argon2id.wasm and b/benchmarks/libsodium/libsodium-pwhash_argon2id.wasm differ diff --git a/benchmarks/libsodium/libsodium-pwhash_scrypt.wasm b/benchmarks/libsodium/libsodium-pwhash_scrypt.wasm index 74654b6..cade6ec 100755 Binary files a/benchmarks/libsodium/libsodium-pwhash_scrypt.wasm and b/benchmarks/libsodium/libsodium-pwhash_scrypt.wasm differ diff --git a/benchmarks/libsodium/libsodium-pwhash_scrypt_ll.wasm b/benchmarks/libsodium/libsodium-pwhash_scrypt_ll.wasm index f5e4195..72f81fa 100755 Binary files a/benchmarks/libsodium/libsodium-pwhash_scrypt_ll.wasm and b/benchmarks/libsodium/libsodium-pwhash_scrypt_ll.wasm differ diff --git a/benchmarks/libsodium/libsodium-randombytes.wasm b/benchmarks/libsodium/libsodium-randombytes.wasm index 5a67974..e359ac8 100755 Binary files a/benchmarks/libsodium/libsodium-randombytes.wasm and b/benchmarks/libsodium/libsodium-randombytes.wasm differ diff --git a/benchmarks/libsodium/libsodium-scalarmult.wasm b/benchmarks/libsodium/libsodium-scalarmult.wasm index 21131af..aa8498f 100755 Binary files a/benchmarks/libsodium/libsodium-scalarmult.wasm and b/benchmarks/libsodium/libsodium-scalarmult.wasm differ diff --git a/benchmarks/libsodium/libsodium-scalarmult2.wasm b/benchmarks/libsodium/libsodium-scalarmult2.wasm index c30466c..052bdc1 100755 Binary files a/benchmarks/libsodium/libsodium-scalarmult2.wasm and b/benchmarks/libsodium/libsodium-scalarmult2.wasm differ diff --git a/benchmarks/libsodium/libsodium-scalarmult5.wasm b/benchmarks/libsodium/libsodium-scalarmult5.wasm index ff2727d..b50ce05 100755 Binary files a/benchmarks/libsodium/libsodium-scalarmult5.wasm and b/benchmarks/libsodium/libsodium-scalarmult5.wasm differ diff --git a/benchmarks/libsodium/libsodium-scalarmult6.wasm b/benchmarks/libsodium/libsodium-scalarmult6.wasm index b3d85af..077742e 100755 Binary files a/benchmarks/libsodium/libsodium-scalarmult6.wasm and b/benchmarks/libsodium/libsodium-scalarmult6.wasm differ diff --git a/benchmarks/libsodium/libsodium-scalarmult7.wasm b/benchmarks/libsodium/libsodium-scalarmult7.wasm index 82e8e2f..d6d3c70 100755 Binary files a/benchmarks/libsodium/libsodium-scalarmult7.wasm and b/benchmarks/libsodium/libsodium-scalarmult7.wasm differ diff --git a/benchmarks/libsodium/libsodium-scalarmult8.wasm b/benchmarks/libsodium/libsodium-scalarmult8.wasm index 795d816..901a76c 100755 Binary files a/benchmarks/libsodium/libsodium-scalarmult8.wasm and b/benchmarks/libsodium/libsodium-scalarmult8.wasm differ diff --git a/benchmarks/libsodium/libsodium-scalarmult_ed25519.wasm b/benchmarks/libsodium/libsodium-scalarmult_ed25519.wasm index 9e1ff3e..db5fb5e 100755 Binary files a/benchmarks/libsodium/libsodium-scalarmult_ed25519.wasm and b/benchmarks/libsodium/libsodium-scalarmult_ed25519.wasm differ diff --git a/benchmarks/libsodium/libsodium-scalarmult_ristretto255.wasm b/benchmarks/libsodium/libsodium-scalarmult_ristretto255.wasm index 8511b6f..6ef9808 100755 Binary files a/benchmarks/libsodium/libsodium-scalarmult_ristretto255.wasm and b/benchmarks/libsodium/libsodium-scalarmult_ristretto255.wasm differ diff --git a/benchmarks/libsodium/libsodium-secretbox.wasm b/benchmarks/libsodium/libsodium-secretbox.wasm index 82208f8..1b14fbf 100755 Binary files a/benchmarks/libsodium/libsodium-secretbox.wasm and b/benchmarks/libsodium/libsodium-secretbox.wasm differ diff --git a/benchmarks/libsodium/libsodium-secretbox2.wasm b/benchmarks/libsodium/libsodium-secretbox2.wasm index d53fedc..85f7acd 100755 Binary files a/benchmarks/libsodium/libsodium-secretbox2.wasm and b/benchmarks/libsodium/libsodium-secretbox2.wasm differ diff --git a/benchmarks/libsodium/libsodium-secretbox7.wasm b/benchmarks/libsodium/libsodium-secretbox7.wasm index cd8b93c..26127c3 100755 Binary files a/benchmarks/libsodium/libsodium-secretbox7.wasm and b/benchmarks/libsodium/libsodium-secretbox7.wasm differ diff --git a/benchmarks/libsodium/libsodium-secretbox8.wasm b/benchmarks/libsodium/libsodium-secretbox8.wasm index d119b5b..086d0e9 100755 Binary files a/benchmarks/libsodium/libsodium-secretbox8.wasm and b/benchmarks/libsodium/libsodium-secretbox8.wasm differ diff --git a/benchmarks/libsodium/libsodium-secretbox_easy.wasm b/benchmarks/libsodium/libsodium-secretbox_easy.wasm index 074647d..276adbc 100755 Binary files a/benchmarks/libsodium/libsodium-secretbox_easy.wasm and b/benchmarks/libsodium/libsodium-secretbox_easy.wasm differ diff --git a/benchmarks/libsodium/libsodium-secretbox_easy2.wasm b/benchmarks/libsodium/libsodium-secretbox_easy2.wasm index 224c2ec..62bfc43 100755 Binary files a/benchmarks/libsodium/libsodium-secretbox_easy2.wasm and b/benchmarks/libsodium/libsodium-secretbox_easy2.wasm differ diff --git a/benchmarks/libsodium/libsodium-secretstream_xchacha20poly1305.wasm b/benchmarks/libsodium/libsodium-secretstream_xchacha20poly1305.wasm index 7894d4b..989d0d9 100755 Binary files a/benchmarks/libsodium/libsodium-secretstream_xchacha20poly1305.wasm and b/benchmarks/libsodium/libsodium-secretstream_xchacha20poly1305.wasm differ diff --git a/benchmarks/libsodium/libsodium-shorthash.wasm b/benchmarks/libsodium/libsodium-shorthash.wasm index 014eddb..d00100c 100755 Binary files a/benchmarks/libsodium/libsodium-shorthash.wasm and b/benchmarks/libsodium/libsodium-shorthash.wasm differ diff --git a/benchmarks/libsodium/libsodium-sign.wasm b/benchmarks/libsodium/libsodium-sign.wasm index bed6fe5..cdbe3d9 100755 Binary files a/benchmarks/libsodium/libsodium-sign.wasm and b/benchmarks/libsodium/libsodium-sign.wasm differ diff --git a/benchmarks/libsodium/libsodium-siphashx24.wasm b/benchmarks/libsodium/libsodium-siphashx24.wasm index 1dde036..5fb01e8 100755 Binary files a/benchmarks/libsodium/libsodium-siphashx24.wasm and b/benchmarks/libsodium/libsodium-siphashx24.wasm differ diff --git a/benchmarks/libsodium/libsodium-sodium_core.wasm b/benchmarks/libsodium/libsodium-sodium_core.wasm index 118966d..57d81d1 100755 Binary files a/benchmarks/libsodium/libsodium-sodium_core.wasm and b/benchmarks/libsodium/libsodium-sodium_core.wasm differ diff --git a/benchmarks/libsodium/libsodium-sodium_utils.wasm b/benchmarks/libsodium/libsodium-sodium_utils.wasm index 1231868..27455c7 100755 Binary files a/benchmarks/libsodium/libsodium-sodium_utils.wasm and b/benchmarks/libsodium/libsodium-sodium_utils.wasm differ diff --git a/benchmarks/libsodium/libsodium-sodium_version.wasm b/benchmarks/libsodium/libsodium-sodium_version.wasm index a79ef05..0158fd9 100755 Binary files a/benchmarks/libsodium/libsodium-sodium_version.wasm and b/benchmarks/libsodium/libsodium-sodium_version.wasm differ diff --git a/benchmarks/libsodium/libsodium-stream.wasm b/benchmarks/libsodium/libsodium-stream.wasm index b8f953f..640eee2 100755 Binary files a/benchmarks/libsodium/libsodium-stream.wasm and b/benchmarks/libsodium/libsodium-stream.wasm differ diff --git a/benchmarks/libsodium/libsodium-stream2.wasm b/benchmarks/libsodium/libsodium-stream2.wasm index 6dee1b6..a3e471b 100755 Binary files a/benchmarks/libsodium/libsodium-stream2.wasm and b/benchmarks/libsodium/libsodium-stream2.wasm differ diff --git a/benchmarks/libsodium/libsodium-stream3.wasm b/benchmarks/libsodium/libsodium-stream3.wasm index b446fca..e2d127f 100755 Binary files a/benchmarks/libsodium/libsodium-stream3.wasm and b/benchmarks/libsodium/libsodium-stream3.wasm differ diff --git a/benchmarks/libsodium/libsodium-stream4.wasm b/benchmarks/libsodium/libsodium-stream4.wasm index 58905d0..aeb2999 100755 Binary files a/benchmarks/libsodium/libsodium-stream4.wasm and b/benchmarks/libsodium/libsodium-stream4.wasm differ diff --git a/benchmarks/libsodium/libsodium-verify1.wasm b/benchmarks/libsodium/libsodium-verify1.wasm index 6145637..e7425ea 100755 Binary files a/benchmarks/libsodium/libsodium-verify1.wasm and b/benchmarks/libsodium/libsodium-verify1.wasm differ diff --git a/benchmarks/libsodium/libsodium-xchacha20.wasm b/benchmarks/libsodium/libsodium-xchacha20.wasm index 34a18f0..79aab3f 100755 Binary files a/benchmarks/libsodium/libsodium-xchacha20.wasm and b/benchmarks/libsodium/libsodium-xchacha20.wasm differ diff --git a/benchmarks/tract-onnx-image-classification/.gitignore b/benchmarks/tract-onnx-image-classification/.gitignore new file mode 100644 index 0000000..5938305 --- /dev/null +++ b/benchmarks/tract-onnx-image-classification/.gitignore @@ -0,0 +1,3 @@ +/rust-benchmark/target +/rust-benchmark/Cargo.lock +/assets/mobilenetv2-7.onnx diff --git a/benchmarks/tract-onnx-image-classification/Dockerfile b/benchmarks/tract-onnx-image-classification/Dockerfile new file mode 100644 index 0000000..cecfcd8 --- /dev/null +++ b/benchmarks/tract-onnx-image-classification/Dockerfile @@ -0,0 +1,14 @@ +FROM rust:1.75 +RUN rustup target add wasm32-wasi +WORKDIR /usr/src +ADD rust-benchmark rust-benchmark +ADD assets assets +ADD setup.sh setup.sh +RUN ./setup.sh +WORKDIR /usr/src/rust-benchmark +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +RUN cargo build --release --target wasm32-wasi +RUN mkdir /benchmark +RUN cp target/wasm32-wasi/release/benchmark.wasm /benchmark/ +# We output the Wasm file to the `/benchmark` directory, where the client +# expects it. diff --git a/benchmarks/tract-onnx-image-classification/README.md b/benchmarks/tract-onnx-image-classification/README.md new file mode 100644 index 0000000..b8c9be0 --- /dev/null +++ b/benchmarks/tract-onnx-image-classification/README.md @@ -0,0 +1,7 @@ +# Image Classification Wasmtime Benchmark + +A benchmark that runs an image classifier in pure Wasm. This can be used to +benchmark the performance of float heavy computations. + +Note that the classifier model is not included in the repo because it is large +and is instead downloaded if needed when running the `setup.sh` script. diff --git a/benchmarks/tract-onnx-image-classification/assets/.gitignore b/benchmarks/tract-onnx-image-classification/assets/.gitignore new file mode 100644 index 0000000..b722e9e --- /dev/null +++ b/benchmarks/tract-onnx-image-classification/assets/.gitignore @@ -0,0 +1 @@ +!.gitignore \ No newline at end of file diff --git a/benchmarks/tract-onnx-image-classification/benchmark.stderr.expected b/benchmarks/tract-onnx-image-classification/benchmark.stderr.expected new file mode 100644 index 0000000..e69de29 diff --git a/benchmarks/tract-onnx-image-classification/benchmark.stdout.expected b/benchmarks/tract-onnx-image-classification/benchmark.stdout.expected new file mode 100644 index 0000000..d319a28 --- /dev/null +++ b/benchmarks/tract-onnx-image-classification/benchmark.stdout.expected @@ -0,0 +1 @@ +[Classification { label: "tiger", score: 17.559244 }, Classification { label: "tiger cat", score: 14.740076 }, Classification { label: "zebra", score: 12.357242 }] diff --git a/benchmarks/tract-onnx-image-classification/benchmark.wasm b/benchmarks/tract-onnx-image-classification/benchmark.wasm new file mode 100755 index 0000000..e236ebd Binary files /dev/null and b/benchmarks/tract-onnx-image-classification/benchmark.wasm differ diff --git a/benchmarks/tract-onnx-image-classification/input.png b/benchmarks/tract-onnx-image-classification/input.png new file mode 100644 index 0000000..5249f6e Binary files /dev/null and b/benchmarks/tract-onnx-image-classification/input.png differ diff --git a/benchmarks/tract-onnx-image-classification/rust-benchmark/Cargo.toml b/benchmarks/tract-onnx-image-classification/rust-benchmark/Cargo.toml new file mode 100644 index 0000000..331672e --- /dev/null +++ b/benchmarks/tract-onnx-image-classification/rust-benchmark/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "benchmark" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[lib] +crate-type = ["cdylib"] + +[dependencies] +anyhow = "1.0" +bytes = "1.5.0" +prost = "0.11.0" +image = { version = "0.25.1", features = ["png"], default-features = false } +tract-onnx = "0.21.4" diff --git a/benchmarks/tract-onnx-image-classification/rust-benchmark/src/lib.rs b/benchmarks/tract-onnx-image-classification/rust-benchmark/src/lib.rs new file mode 100644 index 0000000..3d41ed9 --- /dev/null +++ b/benchmarks/tract-onnx-image-classification/rust-benchmark/src/lib.rs @@ -0,0 +1,1101 @@ +use std::cell::RefCell; + +use prost::Message; +use tract_onnx::prelude::*; + +#[link(wasm_import_module = "bench")] +extern "C" { + fn start(); + fn end(); +} + +const IMAGE_PATH: &str = "input.png"; + +#[derive(Debug)] +struct Classification { + label: String, + #[allow(dead_code)] + score: f32, +} + +type Model = SimplePlan, Graph>>; + +thread_local! { + static MODEL: RefCell> = RefCell::new(None); +} + +/// An image classification model trained on ImageNet dataset. +/// The model itself is not included in the source code of this example. +/// If you see a compile error here, then download the model from: +/// https://github.com/onnx/models/tree/main/validated/vision/classification/mobilenet +/// See the `setup.sh` script for details. +const IMAGENET: &'static [u8] = include_bytes!("../../assets/mobilenetv2-7.onnx"); + +/// Constructs a runnable model from the serialized ONNX model in `IMAGENET`. +fn setup() -> TractResult<()> { + let bytes = bytes::Bytes::from_static(IMAGENET); + let proto: tract_onnx::pb::ModelProto = tract_onnx::pb::ModelProto::decode(bytes)?; + let model = tract_onnx::onnx() + .model_for_proto_model(&proto)? + .into_optimized()? + .into_runnable()?; + MODEL.with_borrow_mut(|m| { + *m = Some(model); + }); + Ok(()) +} + +/// Runs the model on the given image and returns top three labels. +fn classify(image: &[u8]) -> Result, anyhow::Error> { + MODEL.with_borrow(|model| { + let model = model.as_ref().unwrap(); + let image = image::load_from_memory(&image)?.to_rgb8(); + + // The model accepts an image of size 224x224px. + let image = + image::imageops::resize(&image, 224, 224, image::imageops::FilterType::Triangle); + + // Preprocess the input according to + // https://github.com/onnx/models/tree/main/validated/vision/classification/mobilenet#preprocessing. + const MEAN: [f32; 3] = [0.485, 0.456, 0.406]; + const STD: [f32; 3] = [0.229, 0.224, 0.225]; + let tensor = tract_ndarray::Array4::from_shape_fn((1, 3, 224, 224), |(_, c, y, x)| { + (image[(x as u32, y as u32)][c] as f32 / 255.0 - MEAN[c]) / STD[c] + }); + + let result = model.run(tvec!(Tensor::from(tensor).into()))?; + + let mut scores: Vec<_> = result[0] + .to_array_view::()? + .into_iter() + .zip(0..) + .collect(); + + scores.sort_by(|a, b| b.0.partial_cmp(&a.0).unwrap()); + + let labels = scores + .iter() + .take(3) + .map(|(score, i)| Classification { + label: LABELS[*i as usize].to_string(), + score: **score, + }) + .collect(); + Ok(labels) + }) +} + +#[export_name = "_start"] +fn _start() { + setup().unwrap(); + let image = std::fs::read(IMAGE_PATH).unwrap(); + unsafe { start() }; + let result = classify(&image).unwrap(); + unsafe { end() }; + assert_eq!(result[0].label, "tiger"); + println!("{:?}", result); +} + +/// The set of 1000 ImageNet class labels. +const LABELS: [&'static str; 1000] = [ + "tench", + "goldfish", + "great white shark", + "tiger shark", + "hammerhead", + "electric ray", + "stingray", + "cock", + "hen", + "ostrich", + "brambling", + "goldfinch", + "house finch", + "junco", + "indigo bunting", + "robin", + "bulbul", + "jay", + "magpie", + "chickadee", + "water ouzel", + "kite", + "bald eagle", + "vulture", + "great grey owl", + "european fire salamander", + "common newt", + "eft", + "spotted salamander", + "axolotl", + "bullfrog", + "tree frog", + "tailed frog", + "loggerhead", + "leatherback turtle", + "mud turtle", + "terrapin", + "box turtle", + "banded gecko", + "common iguana", + "american chameleon", + "whiptail", + "agama", + "frilled lizard", + "alligator lizard", + "gila monster", + "green lizard", + "african chameleon", + "komodo dragon", + "african crocodile", + "american alligator", + "triceratops", + "thunder snake", + "ringneck snake", + "hognose snake", + "green snake", + "king snake", + "garter snake", + "water snake", + "vine snake", + "night snake", + "boa constrictor", + "rock python", + "indian cobra", + "green mamba", + "sea snake", + "horned viper", + "diamondback", + "sidewinder", + "trilobite", + "harvestman", + "scorpion", + "black and gold garden spider", + "barn spider", + "garden spider", + "black widow", + "tarantula", + "wolf spider", + "tick", + "centipede", + "black grouse", + "ptarmigan", + "ruffed grouse", + "prairie chicken", + "peacock", + "quail", + "partridge", + "african grey", + "macaw", + "sulphur-crested cockatoo", + "lorikeet", + "coucal", + "bee eater", + "hornbill", + "hummingbird", + "jacamar", + "toucan", + "drake", + "red-breasted merganser", + "goose", + "black swan", + "tusker", + "echidna", + "platypus", + "wallaby", + "koala", + "wombat", + "jellyfish", + "sea anemone", + "brain coral", + "flatworm", + "nematode", + "conch", + "snail", + "slug", + "sea slug", + "chiton", + "chambered nautilus", + "dungeness crab", + "rock crab", + "fiddler crab", + "king crab", + "american lobster", + "spiny lobster", + "crayfish", + "hermit crab", + "isopod", + "white stork", + "black stork", + "spoonbill", + "flamingo", + "little blue heron", + "american egret", + "bittern", + "crane", + "limpkin", + "european gallinule", + "american coot", + "bustard", + "ruddy turnstone", + "red-backed sandpiper", + "redshank", + "dowitcher", + "oystercatcher", + "pelican", + "king penguin", + "albatross", + "grey whale", + "killer whale", + "dugong", + "sea lion", + "chihuahua", + "japanese spaniel", + "maltese dog", + "pekinese", + "shih-tzu", + "blenheim spaniel", + "papillon", + "toy terrier", + "rhodesian ridgeback", + "afghan hound", + "basset", + "beagle", + "bloodhound", + "bluetick", + "black-and-tan coonhound", + "walker hound", + "english foxhound", + "redbone", + "borzoi", + "irish wolfhound", + "italian greyhound", + "whippet", + "ibizan hound", + "norwegian elkhound", + "otterhound", + "saluki", + "scottish deerhound", + "weimaraner", + "staffordshire bullterrier", + "american staffordshire terrier", + "bedlington terrier", + "border terrier", + "kerry blue terrier", + "irish terrier", + "norfolk terrier", + "norwich terrier", + "yorkshire terrier", + "wire-haired fox terrier", + "lakeland terrier", + "sealyham terrier", + "airedale", + "cairn", + "australian terrier", + "dandie dinmont", + "boston bull", + "miniature schnauzer", + "giant schnauzer", + "standard schnauzer", + "scotch terrier", + "tibetan terrier", + "silky terrier", + "soft-coated wheaten terrier", + "west highland white terrier", + "lhasa", + "flat-coated retriever", + "curly-coated retriever", + "golden retriever", + "labrador retriever", + "chesapeake bay retriever", + "german short-haired pointer", + "vizsla", + "english setter", + "irish setter", + "gordon setter", + "brittany spaniel", + "clumber", + "english springer", + "welsh springer spaniel", + "cocker spaniel", + "sussex spaniel", + "irish water spaniel", + "kuvasz", + "schipperke", + "groenendael", + "malinois", + "briard", + "kelpie", + "komondor", + "old english sheepdog", + "shetland sheepdog", + "collie", + "border collie", + "bouvier des flandres", + "rottweiler", + "german shepherd", + "doberman", + "miniature pinscher", + "greater swiss mountain dog", + "bernese mountain dog", + "appenzeller", + "entlebucher", + "boxer", + "bull mastiff", + "tibetan mastiff", + "french bulldog", + "great dane", + "saint bernard", + "eskimo dog", + "malamute", + "siberian husky", + "dalmatian", + "affenpinscher", + "basenji", + "pug", + "leonberg", + "newfoundland", + "great pyrenees", + "samoyed", + "pomeranian", + "chow", + "keeshond", + "brabancon griffon", + "pembroke", + "cardigan", + "toy poodle", + "miniature poodle", + "standard poodle", + "mexican hairless", + "timber wolf", + "white wolf", + "red wolf", + "coyote", + "dingo", + "dhole", + "african hunting dog", + "hyena", + "red fox", + "kit fox", + "arctic fox", + "grey fox", + "tabby", + "tiger cat", + "persian cat", + "siamese cat", + "egyptian cat", + "cougar", + "lynx", + "leopard", + "snow leopard", + "jaguar", + "lion", + "tiger", + "cheetah", + "brown bear", + "american black bear", + "ice bear", + "sloth bear", + "mongoose", + "meerkat", + "tiger beetle", + "ladybug", + "ground beetle", + "long-horned beetle", + "leaf beetle", + "dung beetle", + "rhinoceros beetle", + "weevil", + "fly", + "bee", + "ant", + "grasshopper", + "cricket", + "walking stick", + "cockroach", + "mantis", + "cicada", + "leafhopper", + "lacewing", + "dragonfly", + "damselfly", + "admiral", + "ringlet", + "monarch", + "cabbage butterfly", + "sulphur butterfly", + "lycaenid", + "starfish", + "sea urchin", + "sea cucumber", + "wood rabbit", + "hare", + "angora", + "hamster", + "porcupine", + "fox squirrel", + "marmot", + "beaver", + "guinea pig", + "sorrel", + "zebra", + "hog", + "wild boar", + "warthog", + "hippopotamus", + "ox", + "water buffalo", + "bison", + "ram", + "bighorn", + "ibex", + "hartebeest", + "impala", + "gazelle", + "arabian camel", + "llama", + "weasel", + "mink", + "polecat", + "black-footed ferret", + "otter", + "skunk", + "badger", + "armadillo", + "three-toed sloth", + "orangutan", + "gorilla", + "chimpanzee", + "gibbon", + "siamang", + "guenon", + "patas", + "baboon", + "macaque", + "langur", + "colobus", + "proboscis monkey", + "marmoset", + "capuchin", + "howler monkey", + "titi", + "spider monkey", + "squirrel monkey", + "madagascar cat", + "indri", + "indian elephant", + "african elephant", + "lesser panda", + "giant panda", + "barracouta", + "eel", + "coho", + "rock beauty", + "anemone fish", + "sturgeon", + "gar", + "lionfish", + "puffer", + "abacus", + "abaya", + "academic gown", + "accordion", + "acoustic guitar", + "aircraft carrier", + "airliner", + "airship", + "altar", + "ambulance", + "amphibian", + "analog clock", + "apiary", + "apron", + "ashcan", + "assault rifle", + "backpack", + "bakery", + "balance beam", + "balloon", + "ballpoint", + "band aid", + "banjo", + "bannister", + "barbell", + "barber chair", + "barbershop", + "barn", + "barometer", + "barrel", + "barrow", + "baseball", + "basketball", + "bassinet", + "bassoon", + "bathing cap", + "bath towel", + "bathtub", + "beach wagon", + "beacon", + "beaker", + "bearskin", + "beer bottle", + "beer glass", + "bell cote", + "bib", + "bicycle-built-for-two", + "bikini", + "binder", + "binoculars", + "birdhouse", + "boathouse", + "bobsled", + "bolo tie", + "bonnet", + "bookcase", + "bookshop", + "bottlecap", + "bow", + "bow tie", + "brass", + "brassiere", + "breakwater", + "breastplate", + "broom", + "bucket", + "buckle", + "bulletproof vest", + "bullet train", + "butcher shop", + "cab", + "caldron", + "candle", + "cannon", + "canoe", + "can opener", + "cardigan", + "car mirror", + "carousel", + "carpenter's kit", + "carton", + "car wheel", + "cash machine", + "cassette", + "cassette player", + "castle", + "catamaran", + "cd player", + "cello", + "cellular telephone", + "chain", + "chainlink fence", + "chain mail", + "chain saw", + "chest", + "chiffonier", + "chime", + "china cabinet", + "christmas stocking", + "church", + "cinema", + "cleaver", + "cliff dwelling", + "cloak", + "clog", + "cocktail shaker", + "coffee mug", + "coffeepot", + "coil", + "combination lock", + "computer keyboard", + "confectionery", + "container ship", + "convertible", + "corkscrew", + "cornet", + "cowboy boot", + "cowboy hat", + "cradle", + "crane", + "crash helmet", + "crate", + "crib", + "crock pot", + "croquet ball", + "crutch", + "cuirass", + "dam", + "desk", + "desktop computer", + "dial telephone", + "diaper", + "digital clock", + "digital watch", + "dining table", + "dishrag", + "dishwasher", + "disk brake", + "dock", + "dogsled", + "dome", + "doormat", + "drilling platform", + "drum", + "drumstick", + "dumbbell", + "dutch oven", + "electric fan", + "electric guitar", + "electric locomotive", + "entertainment center", + "envelope", + "espresso maker", + "face powder", + "feather boa", + "file", + "fireboat", + "fire engine", + "fire screen", + "flagpole", + "flute", + "folding chair", + "football helmet", + "forklift", + "fountain", + "fountain pen", + "four-poster", + "freight car", + "french horn", + "frying pan", + "fur coat", + "garbage truck", + "gasmask", + "gas pump", + "goblet", + "go-kart", + "golf ball", + "golfcart", + "gondola", + "gong", + "gown", + "grand piano", + "greenhouse", + "grille", + "grocery store", + "guillotine", + "hair slide", + "hair spray", + "half track", + "hammer", + "hamper", + "hand blower", + "hand-held computer", + "handkerchief", + "hard disc", + "harmonica", + "harp", + "harvester", + "hatchet", + "holster", + "home theater", + "honeycomb", + "hook", + "hoopskirt", + "horizontal bar", + "horse cart", + "hourglass", + "ipod", + "iron", + "jack-o'-lantern", + "jean", + "jeep", + "jersey", + "jigsaw puzzle", + "jinrikisha", + "joystick", + "kimono", + "knee pad", + "knot", + "lab coat", + "ladle", + "lampshade", + "laptop", + "lawn mower", + "lens cap", + "letter opener", + "library", + "lifeboat", + "lighter", + "limousine", + "liner", + "lipstick", + "loafer", + "lotion", + "loudspeaker", + "loupe", + "lumbermill", + "magnetic compass", + "mailbag", + "mailbox", + "maillot", + "maillot", + "manhole cover", + "maraca", + "marimba", + "mask", + "matchstick", + "maypole", + "maze", + "measuring cup", + "medicine chest", + "megalith", + "microphone", + "microwave", + "military uniform", + "milk can", + "minibus", + "miniskirt", + "minivan", + "missile", + "mitten", + "mixing bowl", + "mobile home", + "model t", + "modem", + "monastery", + "monitor", + "moped", + "mortar", + "mortarboard", + "mosque", + "mosquito net", + "motor scooter", + "mountain bike", + "mountain tent", + "mouse", + "mousetrap", + "moving van", + "muzzle", + "nail", + "neck brace", + "necklace", + "nipple", + "notebook", + "obelisk", + "oboe", + "ocarina", + "odometer", + "oil filter", + "organ", + "oscilloscope", + "overskirt", + "oxcart", + "oxygen mask", + "packet", + "paddle", + "paddlewheel", + "padlock", + "paintbrush", + "pajama", + "palace", + "panpipe", + "paper towel", + "parachute", + "parallel bars", + "park bench", + "parking meter", + "passenger car", + "patio", + "pay-phone", + "pedestal", + "pencil box", + "pencil sharpener", + "perfume", + "petri dish", + "photocopier", + "pick", + "pickelhaube", + "picket fence", + "pickup", + "pier", + "piggy bank", + "pill bottle", + "pillow", + "ping-pong ball", + "pinwheel", + "pirate", + "pitcher", + "plane", + "planetarium", + "plastic bag", + "plate rack", + "plow", + "plunger", + "polaroid camera", + "pole", + "police van", + "poncho", + "pool table", + "pop bottle", + "pot", + "potter's wheel", + "power drill", + "prayer rug", + "printer", + "prison", + "projectile", + "projector", + "puck", + "punching bag", + "purse", + "quill", + "quilt", + "racer", + "racket", + "radiator", + "radio", + "radio telescope", + "rain barrel", + "recreational vehicle", + "reel", + "reflex camera", + "refrigerator", + "remote control", + "restaurant", + "revolver", + "rifle", + "rocking chair", + "rotisserie", + "rubber eraser", + "rugby ball", + "rule", + "running shoe", + "safe", + "safety pin", + "saltshaker", + "sandal", + "sarong", + "sax", + "scabbard", + "scale", + "school bus", + "schooner", + "scoreboard", + "screen", + "screw", + "screwdriver", + "seat belt", + "sewing machine", + "shield", + "shoe shop", + "shoji", + "shopping basket", + "shopping cart", + "shovel", + "shower cap", + "shower curtain", + "ski", + "ski mask", + "sleeping bag", + "slide rule", + "sliding door", + "slot", + "snorkel", + "snowmobile", + "snowplow", + "soap dispenser", + "soccer ball", + "sock", + "solar dish", + "sombrero", + "soup bowl", + "space bar", + "space heater", + "space shuttle", + "spatula", + "speedboat", + "spider web", + "spindle", + "sports car", + "spotlight", + "stage", + "steam locomotive", + "steel arch bridge", + "steel drum", + "stethoscope", + "stole", + "stone wall", + "stopwatch", + "stove", + "strainer", + "streetcar", + "stretcher", + "studio couch", + "stupa", + "submarine", + "suit", + "sundial", + "sunglass", + "sunglasses", + "sunscreen", + "suspension bridge", + "swab", + "sweatshirt", + "swimming trunks", + "swing", + "switch", + "syringe", + "table lamp", + "tank", + "tape player", + "teapot", + "teddy", + "television", + "tennis ball", + "thatch", + "theater curtain", + "thimble", + "thresher", + "throne", + "tile roof", + "toaster", + "tobacco shop", + "toilet seat", + "torch", + "totem pole", + "tow truck", + "toyshop", + "tractor", + "trailer truck", + "tray", + "trench coat", + "tricycle", + "trimaran", + "tripod", + "triumphal arch", + "trolleybus", + "trombone", + "tub", + "turnstile", + "typewriter keyboard", + "umbrella", + "unicycle", + "upright", + "vacuum", + "vase", + "vault", + "velvet", + "vending machine", + "vestment", + "viaduct", + "violin", + "volleyball", + "waffle iron", + "wall clock", + "wallet", + "wardrobe", + "warplane", + "washbasin", + "washer", + "water bottle", + "water jug", + "water tower", + "whiskey jug", + "whistle", + "wig", + "window screen", + "window shade", + "windsor tie", + "wine bottle", + "wing", + "wok", + "wooden spoon", + "wool", + "worm fence", + "wreck", + "yawl", + "yurt", + "web site", + "comic book", + "crossword puzzle", + "street sign", + "traffic light", + "book jacket", + "menu", + "plate", + "guacamole", + "consomme", + "hot pot", + "trifle", + "ice cream", + "ice lolly", + "french loaf", + "bagel", + "pretzel", + "cheeseburger", + "hotdog", + "mashed potato", + "head cabbage", + "broccoli", + "cauliflower", + "zucchini", + "spaghetti squash", + "acorn squash", + "butternut squash", + "cucumber", + "artichoke", + "bell pepper", + "cardoon", + "mushroom", + "granny smith", + "strawberry", + "orange", + "lemon", + "fig", + "pineapple", + "banana", + "jackfruit", + "custard apple", + "pomegranate", + "hay", + "carbonara", + "chocolate sauce", + "dough", + "meat loaf", + "pizza", + "potpie", + "burrito", + "red wine", + "espresso", + "cup", + "eggnog", + "alp", + "bubble", + "cliff", + "coral reef", + "geyser", + "lakeside", + "promontory", + "sandbar", + "seashore", + "valley", + "volcano", + "ballplayer", + "groom", + "scuba diver", + "rapeseed", + "daisy", + "yellow lady's slipper", + "corn", + "acorn", + "hip", + "buckeye", + "coral fungus", + "agaric", + "gyromitra", + "stinkhorn", + "earthstar", + "hen-of-the-woods", + "bolete", + "ear", + "toilet tissue", +]; diff --git a/benchmarks/tract-onnx-image-classification/setup.sh b/benchmarks/tract-onnx-image-classification/setup.sh new file mode 100755 index 0000000..3634b29 --- /dev/null +++ b/benchmarks/tract-onnx-image-classification/setup.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +set -euxo pipefail + +MODEL_URL="https://www.github.com/onnx/models/raw/main/validated/vision/classification/mobilenet/model/mobilenetv2-7.onnx?download=:" +MODEL_FILE="assets/mobilenetv2-7.onnx" + +mkdir -p assets + +if [ ! -f $MODEL_FILE ]; then + echo "Downloading model to $MODEL_FILE" + + if which wget >/dev/null ; then + wget $MODEL_URL -O $MODEL_FILE + elif which curl >/dev/null ; then + curl -vL $MODEL_URL -o $MODEL_FILE + else + echo "Couldn't find wget or curl." + echo "Please download manually from \"$MODEL_URL\" and save the file in $MODEL_FILE." + fi +fi