WebAssembly/wasi-parallel

List the available parallelism devices

abrown opened this issue · 0 comments

The current version of the API only allows hinting to the runtime what kind of device the program wants to use for parallelism, with no guarantee that the expected device is of the hinted kind: wasi_parallel::get_device(GPU) is allowed to return a handle to a CPU device (e.g., when no GPU is present).

If programs could list the available devices and query these for certain parallel properties, they could make better choices about what device to use, how to split up the kernel's work (e.g., with the num_threads and block_size parameters), and even whether to choose between parallel or sequential execution. On the flip side, listing the available devices could give a malicious program the ability to fingerprint a system.

This issue raises two questions:

  1. Should we add a way to list devices: wasi_parallel::get_devices() -> list<device_information>? What should device_information contain?
  2. What should the position be on fingerprinting? Some WASI users in standalone environments might not be as concerned as the browser community and community input would help. Also, there may be ways to limit what device information is available (e.g., number of threads vs device model number) and/or allow runtimes to return empty values.