Skip to content

Conversation

@brendandahl
Copy link

Update CMake configuration and utility functions to enable compilation
with Emscripten. This includes setting Wasm-specific flags like
memory64 and SIMD, implementing platform-specific memory detection, and
adding guards for features like OpenSSL that may be unavailable in a
web environment.

Qualify color constants and APIClient with the gcpp namespace in
gemma/api_client.cc to resolve potential symbol lookup issues.
Update CMake configuration and utility functions to enable compilation
with Emscripten. This includes setting Wasm-specific flags like
memory64 and SIMD, implementing platform-specific memory detection, and
adding guards for features like OpenSSL that may be unavailable in a
web environment.
@brendandahl
Copy link
Author

For a little more context, we'd like to start using gemma.cpp in some experimental Wasm AI benchmarks. If you're interested, I can also add CI testing for this configuration and help keep it green if needed.

Copy link
Member

@jan-wassenberg jan-wassenberg left a comment

Choose a reason for hiding this comment

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

Nice. Benchmark sounds interesting, is there any info you can share?
Sure, we'd welcome a PR to add the CI and your help keeping it green.

@jan-wassenberg jan-wassenberg added the copybara-import Trigger Copybara for merging pull requests label Feb 12, 2026
@brendandahl
Copy link
Author

There's some more info on the benchmarks in this repo. Currently, it's mainly transformers.js (ONNX) and LiteRT workloads, but we'd like to add some more. We're still trying to figure out if we want to put Gemma.cpp in the default suite (what contributes to the overall score) since downloading such a big model would be slow. Gemma.cpp can at least go in the experimental benchmarks that devs can look at though.

We're planning to use the benchmarks to guide generating optimized Wasm SIMD from LLVM, improve v8 performance, and help see the impact of the FP16 proposal for Wasm.

In regards to the model size, is there a smaller model (<2B) that could be used for the benchmark that would simulate a similar workload?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

copybara-import Trigger Copybara for merging pull requests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants