Skip to content

Adjust workload sizes to ~100M Wasm instruction executed#318

Merged
fitzgen merged 7 commits into
bytecodealliance:mainfrom
fitzgen:sightglass-adjust-workload-sizes
Jun 24, 2026
Merged

Adjust workload sizes to ~100M Wasm instruction executed#318
fitzgen merged 7 commits into
bytecodealliance:mainfrom
fitzgen:sightglass-adjust-workload-sizes

Conversation

@fitzgen

@fitzgen fitzgen commented Jun 24, 2026

Copy link
Copy Markdown
Member

Running ~100M Wasm instructions takes ~.1 seconds, so this seems like a pretty reasonable number (100 execution iterations will take ~10 seconds (compilation adds more time ofc)).

Also make a few more benchmarks read their input from disk so it is easily tunable and also impossible for the optimizer to const-eval the whole benchmark away.

@fitzgen fitzgen requested a review from cfallin June 24, 2026 20:30
@fitzgen fitzgen force-pushed the sightglass-adjust-workload-sizes branch from d4def4b to e403091 Compare June 24, 2026 20:49
int fdflags, int *opened_fd);

WASI_IMPORT("fd_read")
int wasi_fd_read(int fd, const wasi_iovec_t *iovs, size_t iovs_len, size_t *nread);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A little unfortunate to bake in WASIp1 -- if we have refactor-energy here, maybe we could point it toward using wasi-sdk instead?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can look into this in a follow up

// This benchmark is built with Emscripten, whose libc filesystem does not reach
// WASI preopened directories. So, like the splay and blake3-simd benchmarks, we
// read the workload size from disk by calling the WASI `path_open`/`fd_read`
// syscalls directly. This lets the workload be resized without recompiling.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Likewise here -- use wasi-sdk instead?

Comment thread benchmarks/intgemm-simd/benchmark.cpp Outdated
@fitzgen fitzgen merged commit 3ab06d5 into bytecodealliance:main Jun 24, 2026
12 checks passed
@fitzgen fitzgen deleted the sightglass-adjust-workload-sizes branch June 24, 2026 22:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants