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
{{ message }}
Repository navigation
[BUG] target-lexicon does not compile to riscv32 #1704
Thanks a lot, this is very helpful.
It would be pretty cool to get wasmer running inside risc0. It could save a lot of cycles running an AoT-compiled WASM module vs an interpreted one from wasmi.
I think what we really want is the ability to have WASM transpile into RISC-V, which would indeed save a lot of cycles, and would be done at build time, which means we wouldn't need to get wasmer running inside the guest. This is something we've been thinking about but isn't on the near term roadmap just yet.
Agreed, that would be the most efficient way to go about it.
Does this mean that the WASM needs to be compiled to a custom target like riscv32im-risc0-zkvm-elf? There are already some runtimes like wasmer and WAMR that can compile to riscv64 and riscv32 targets respectively. I'd be happy to help contribute here anyway I can.
I think what we really want is the ability to have WASM transpile into RISC-V, which would indeed save a lot of cycles, and would be done at build time, which means we wouldn't need to get wasmer running inside the guest. This is something we've been thinking about but isn't on the near term roadmap just yet.
Yep, This would be amazing to see if we could compile down wasm-unknownn to riscV target. But can you elaborate a bit on how it would reduce down the computation cycles ?
Compared to running an interpreter, AoT should always win, assuming that it takes anywhere from 2-10 cycles for the interpreter to run a single WASM instruction.
Activity
linear commentedon Apr 23, 2024
ZKVM-415 [BUG] `target-lexicon` does not compile to riscv32
SchmErik commentedon Apr 24, 2024
Awesome! I love that project! ... but I'm not sure if it works inside the guest. So there's an open PR here: bytecodealliance/target-lexicon#96 that will add the code. I've pinged the maintainer so hopefully it will be merged/enabled soon... In the meantime you can patch your crate using the directions here: https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html#the-patch-section
0xRampey commentedon Apr 24, 2024
Thanks a lot, this is very helpful.
It would be pretty cool to get wasmer running inside
risc0. It could save a lot of cycles running an AoT-compiled WASM module vs an interpreted one fromwasmi.flaub commentedon Apr 24, 2024
I think what we really want is the ability to have WASM transpile into RISC-V, which would indeed save a lot of cycles, and would be done at build time, which means we wouldn't need to get wasmer running inside the guest. This is something we've been thinking about but isn't on the near term roadmap just yet.
0xRampey commentedon Apr 30, 2024
Agreed, that would be the most efficient way to go about it.
Does this mean that the WASM needs to be compiled to a custom target like
riscv32im-risc0-zkvm-elf? There are already some runtimes like wasmer and WAMR that can compile toriscv64andriscv32targets respectively. I'd be happy to help contribute here anyway I can.flaub commentedon Apr 30, 2024
Yeah, WAMR looks really interesting!
nlok5923 commentedon May 1, 2024
Yep, This would be amazing to see if we could compile down wasm-unknownn to riscV target. But can you elaborate a bit on how it would reduce down the computation cycles ?
flaub commentedon May 1, 2024
Compared to running an interpreter, AoT should always win, assuming that it takes anywhere from 2-10 cycles for the interpreter to run a single WASM instruction.