-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
Hello,
Thanks for this project - it helped me when exploring DeepFilterNet inference in WebAssembly. I followed your contents on that repo: Rikorose/DeepFilterNet#430, Rikorose/DeepFilterNet#472
I took a look at tract (https://github.com/sonos/tract) and it has WASM SIMD128 support for some of its operators e.g. MatMul (which will boost performance).
If you modify libDF/Cargo.toml to add this:
[profile.release]
opt-level = 3 # or "z"
lto = "fat" # or "thin"
codegen-units = 1
panic = "abort"
[package.metadata.wasm-pack.profile.dev]
wasm-opt = ['--enable-simd', '-O4']
[package.metadata.wasm-pack.profile.profiling]
wasm-opt = ['--enable-simd', '-O4']
[package.metadata.wasm-pack.profile.release]
wasm-opt = ['--enable-simd', '-O4']
And in build_wasm_package.sh:
cd ./libDF/
# Set Rust flags to enable WASM SIMD instructions and optimize for size.
export RUSTFLAGS="-C target-feature=+simd128 -C opt-level=z -C link-arg=-s"
wasm-pack build --target web --no-typescript --features "wasm"
You may notice better performance in your web demo!
grazder
Metadata
Metadata
Assignees
Labels
No labels