How to portably use this proposal?
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 20/100
- issue の種類
- 機能追加
- 明瞭さ
- 説明が足りない
- 活発さ
- 停滞
- 技術スタック
- wasm
- 領域
- compilers
調査の方向性
提案の現在の設計と、この issue で説明されているポータビリティ上の懸念から始めます。これには、f16x8 と f32x4 の例、および CPU の能力によるエンジンの動作が含まれます。ファイル、テスト、エントリポイントは指定されていません。完了とするには、ユーザーと実装者向けに、エコシステムとエンジンのポータビリティについて合意された方向性を文書化する必要があります。
索引モデルが issue の本文から書いたものです。
説明
Hello! I had some comments during the CG meeting today but I wanted to elaborate on them in an issue here. My concern stems from not knowing how consumers will end up using this proposal in a bit more of an abstract sense beyond "well you just use it". My understanding is that "if you know what you're doing" you would first have a target platform in mind (e.g. arm64 or some specific machine), you'd then ensure that there's an engine to use there (e.g. all your own users use one browser or something like that), and then you'd get the instructions into a wasm binary and measure to make sure everything works. What I'm curious about is what to do if you don't fall into the bucket of "if you know what you're doing".
Put more concretely the current trajectory of this proposal looks like it's going to have two key properties that users would need to consider:
- A wide performance gap on machines that natively support this proposal and machines that require emulation for the proposal.
- Depending on the final level of complexity for engines it may also not be reasonable to expect to be able to run this proposal on older cpus which don't have even enough support for "ok we can at least mostly emulate things". (for example only sse2 on x64 or pre-8.2 on arm64 -- I'm not certain the complexity here on either s390x or riscv64)
The rest of my comments here are under the assumption that (1) and (2) are true. Ideally I think that those would both be fixed, but given the nature of this proposal I don't think it's easy to do that. Personally I like the idea of exposing hardware capabilities in wasm, but my thinking here is exploring the consequences of (1) and (2) and adoption in ecosystem libraries.
Personally I don't have any experience with 16-bit floats or the applications that use them. One hypothetical use case, which may not be reasonable, would be something along the lines of: a library has the ability to use f16x8 but also has the ability to use f32x4. On supporting hardware f16x8 is the fastest but f32x4 is faster on hardware that doesn't support f16x8 natively (or via emulation of f16x8). In this situation a library has no means of internally selecting which algorithm to use. This means that the implementation detail of float width would need to be bubbled up to users of the library, and that can increase complexity in the sense that every library with this decision would have to bubble up knobs of which to use at runtime.
Another possible concern for a library like this is whether or not to even include f16x8 instructions. For example let's assume that this proposal is phase 4, implemented in all engines, and has been stable for a year or so. Even in this situation should this hypothetical library use f16x8 by default? Or should it provide a compile time flag to disable support? This is relevent, for example, if users want to use the library in engines on platforms where the engine does not have support for this proposal (e.g. the fallback to old hardware is too complex).
Overall an answer to all of this could be: "it's expected all users of this proposal know what they're doing" or something like that. My concerns go away in this situation because library authors would "know what they're doing", applications using these libraries would "know what they're doing", and engines would be communicating with these "in-the-know" users for what platforms need to support things. For example if it turns out no one has a use case for supporting this proposal with sse2-only cpus then that would just never happen and no one would ever see the error of "your cpu is too old to run this module". This in my opinion of course touches on the concerns of wasm being "universally portable" though to a degree, but not if the users of this proposal are expected to be only a few critical ones and not necessarily see widespread adoption.
Personally though my naive way to answer these concerns of mine would be to (a) add the ability to detect whether these instructions are "fast" and (b) allow engines to implement these instructions with a trap. That would provide libraries the ability to internally detect which algorithm to use and everything could always be turned on by default. Engines that don't want to implement the proposal could only do the validation parts and then trap at runtime (and the detection instruction would say "no"). I realize though that this touches on other concerns about the determinism of wasm but I at least personally feel like that ship has sailed with the relaxed-simd proposal and would prefer to lean in to exposing the intrinsic nature of how hardware is different and modules get run on different hardware.
Apologies for the long issue, happy to discuss here more too! Also I realize I'm not a key stakeholder in this proposal nor in simd-related things. I've done various bits and pieces of wasm simd in Rust and Wasmtime for various architectures but I don't use simd day-in-and-day-out nor am I aware of users of Wasmtime, for example, that are cpu-bound and heavily reliant on simd things.
- 主要言語
- WebAssembly
- スター
- 14
- フォーク
- 0
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
WebAssembly/fp16 のほかの issue
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
WebAssembly/fp16#11 · コメント 1 件 · リアクション 1 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 38/100
WebAssembly/fp16#10 · コメント 6 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
WebAssembly/fp16#8 · コメント 1 件 ·
-
Hardware supportオープン
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
WebAssembly/fp16#7 · コメント 2 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
WebAssembly/fp16#6 · コメント 1 件 · リアクション 1 件 ·
WebAssembly/fp16 の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
メンテナーはふだん 1 日以内に返信
-
DAE2 crashes on call.without.effects with a non ref.func expression対応中かも @stevenfontanella が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
WebAssembly/binaryen#9404 ·
メンテナーはふだん 1 日以内に返信
-
area:compiler effort:S impact:med platform:windows type:bug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
area:Analysis enhancement
難易度 1/5 1〜3時間 初心者へのやさしさ 69/100
facebookresearch/atlas-lean#5118 ·
メンテナーはふだん 1 日以内に返信
-
C-bugfix
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
Quantinuum/hugr#3354 ·
メンテナーはふだん 1 日以内に返信