Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VowpalWabbit WASM in a Cloudflare Worker #4704

Open
tizmagik opened this issue Nov 19, 2024 · 0 comments
Open

VowpalWabbit WASM in a Cloudflare Worker #4704

tizmagik opened this issue Nov 19, 2024 · 0 comments
Labels
Documentation Issue in samples or documentation

Comments

@tizmagik
Copy link

tizmagik commented Nov 19, 2024

Description

I'm looking to deploy VW WASM (via the JS bindings) in a Cloudflare Worker. There were a number of issues with the JS wrapper that prevented developing locally via Miniflare, but that's a separate issue. I was finally able to get something going locally by using Cloudflare's Vitest worker pool which runs the worker via workerd which is how it would be run in production -- however I get the following error:

failed to asynchronously prepare wasm: CompileError: WebAssembly.instantiate(): Wasm code generation disallowed by embedder
Aborted(CompileError: WebAssembly.instantiate(): Wasm code generation disallowed by embedder)
RuntimeError: Aborted(CompileError: WebAssembly.instantiate(): Wasm code generation disallowed by embedder). Build with -sASSERTIONS for more info.
    at abort (Users/developer/project/node_modules/.pnpm/@vowpalwabbit+vowpalwabbit@0.0.8/node_modules/@vowpalwabbit/vowpalwabbit/dist/vw-wasm.js?mf_vitest_no_cjs_esm_shim:9:5434)
    at Users/developer/project/node_modules/.pnpm/@vowpalwabbit+vowpalwabbit@0.0.8/node_modules/@vowpalwabbit/vowpalwabbit/dist/vw-wasm.js?mf_vitest_no_cjs_esm_shim:9:4274190

My assumption is this is due to Cloudflare disallowing WASM code generation

How to unblock?

Does VowpalWabbit publish the built WASM module anywhere? Or any insight on the above error and how I could work around it? Many thanks in advance!

@tizmagik tizmagik added the Documentation Issue in samples or documentation label Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Issue in samples or documentation
Projects
None yet
Development

No branches or pull requests

1 participant