Closed
Bug 1749788
Opened 4 years ago
Closed 4 years ago
Make wasm simd lichess/stockfish fast with AVX2
Categories
(Core :: JavaScript: WebAssembly, enhancement, P3)
Core
JavaScript: WebAssembly
Tracking
()
RESOLVED
FIXED
100 Branch
| Tracking | Status | |
|---|---|---|
| firefox100 | --- | fixed |
People
(Reporter: yury, Assigned: yury)
References
Details
Attachments
(2 files)
The wasm version source code of lichess engine is available at https://github.com/hi-ogawa/Stockfish . Unfortunately, it relies on threads to be present, means it needs to be run and benchmarked in browser context. After my preliminary runs, the enabling AVX does not provides meaningful win in performance (~1%). Here is the list of SIMD ops used in the code minus ops we already implemented for AVX, or irrelevant:
- f64x2.mul
- f64x2.replace_lane
- i16x8.add, i16x8.sub
- i16x8.extend_high_i8x16_s, i16x8.extend_low_i8x16_s
- i16x8.max_s, i16x8.min_s
- i32x4.abs, i32x4.sub
- i32x4.dot_i16x8_s
- i32x4.max_s, i32x4.max_u, i32x4.min_s
- i32x4.replace_lane
- i32x4.shl, i32x4.shr_s, i32x4.shr_u w/const
- i64x2.add, i64x2.sub
- i64x2.shl, i64x2.shr_s w/const
- i8x16.narrow_i16x8_u
- i8x16.replace_lane
- i8x16.shuffle
- v128.bitselect
| Assignee | ||
Comment 1•4 years ago
|
||
| Assignee | ||
Comment 2•4 years ago
|
||
- Implement {i8x16,i16x8,i32x4,f32x4,f64x2}.replace_lane
- Fix i64x2.splat for AVX2 and make it faster for non-AVX2
Depends on D139051
Updated•4 years ago
|
Attachment #9264439 -
Attachment description: WIP: Bug 1749788 - Implement simple binary SIMD operations for AVX encoding. → Bug 1749788 - Implement simple binary SIMD operations for AVX encoding. r?jseward
Updated•4 years ago
|
Attachment #9264476 -
Attachment description: WIP: Bug 1749788 - Fix replace_lane and i64x2.splat for AVX. → Bug 1749788 - Fix replace_lane and i64x2.splat for AVX. r?jseward
Pushed by ydelendik@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/ae6d99fecf42
Implement simple binary SIMD operations for AVX encoding. r=jseward
https://hg.mozilla.org/integration/autoland/rev/99317db06b7c
Fix replace_lane and i64x2.splat for AVX. r=jseward
Comment 4•4 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/ae6d99fecf42
https://hg.mozilla.org/mozilla-central/rev/99317db06b7c
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
status-firefox100:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → 100 Branch
You need to log in
before you can comment on or make changes to this bug.
Description
•