You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm on a 2020 MacBook Pro with M1 chip. I downloaded binaryen-version_122-arm64-macos.tar.gz from GitHub Releases, and attempted to run it on this Wasm file as follows:
In particular, I started with prospero.wat which I generated from prospero.vm using the code in that PR I linked, then ran it through wasm-opt like this:
cargo run prospero-opt.wasm --reverse --export main backprop --wat -o prospero-opt-grad.wat
That also worked fine. Finally I ran prospero-opt-grad.wat through wasm-opt, which fails as detailed above. Also, to clarify, the "91 kB" number in this issue title comes from running this command:
Adding -all fixes the error. This module does need features enabled due to use of at least multivalue.
The crash looks like an OOM - we accumulate all errors before printing, and it seems like there are just so many we run out of memory. I didn't check specifically why, but it might be the incredibly-deeply nested call $f32_mins - we may be trying to print out each nesting, leading to quadratic time.
We do need to accumulate errors before printing, for determinism, but perhaps we can stop after a fixed number, to avoid this...
Issue
I've put my input file
prospero-opt-grad.wat
in a GitHub Gist here: https://gist.github.com/samestep/ca2333b48a0aac67dab4bba4e51be92dI'm on a 2020 MacBook Pro with M1 chip. I downloaded
binaryen-version_122-arm64-macos.tar.gz
from GitHub Releases, and attempted to run it on this Wasm file as follows:This ran for 9 seconds and then crashed with the following error output:
Context
This came up in samestep/floretta#7 while I was experimenting with automatic differentiation of Wasm for an example computation graph with 8k nodes to see how well it would work on a single large function without control flow.
In particular, I started with
prospero.wat
which I generated fromprospero.vm
using the code in that PR I linked, then ran it throughwasm-opt
like this:That worked fine. Then I took
prospero-opt.wasm
and ran it through my Floretta tool at commit919c361
, like this:That also worked fine. Finally I ran
prospero-opt-grad.wat
throughwasm-opt
, which fails as detailed above. Also, to clarify, the "91 kB" number in this issue title comes from running this command:wasm-tools parse prospero-opt-grad.wat -o prospero-opt-grad.wasm && wc -c prospero-opt-grad.wasm
The same
wasm-opt
error still happens when running onprospero-opt-grad.wasm
instead ofprospero-opt-grad.wat
.The text was updated successfully, but these errors were encountered: