Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add threading support based on wasi-threads #101538

Closed
yamt opened this issue Feb 3, 2023 · 7 comments
Closed

Add threading support based on wasi-threads #101538

yamt opened this issue Feb 3, 2023 · 7 comments
Labels
OS-wasi type-feature A feature request or enhancement

Comments

@yamt
Copy link
Contributor

yamt commented Feb 3, 2023

Feature or enhancement

use wasi-threads via wasi-sdk

Pitch

Previous discussion

Linked PRs

@yamt yamt added the type-feature A feature request or enhancement label Feb 3, 2023
yamt added a commit to yamt/cpython that referenced this issue Feb 3, 2023
eg.
```
autoconf
export WASI_SDK_PATH=/opt/wasi-sdk-19.5g0236e959edbc
./Tools/wasm/wasm_build.py wasi-threads build
~/git/toywasm/b.thread/toywasm --wasi --wasi-dir . --wasi-dir ~/git/garbage/py/th2 -- builddir/wasi-threads/python.wasm ~/git/garbage/py/th2/thread.py
```

* I used an unreleased version of wasi-sdk

* I used toywasm to test because wasmtime doesn't have
  necessary functionality yet.
yamt added a commit to yamt/cpython that referenced this issue Feb 3, 2023
eg.
```
autoconf
export WASI_SDK_PATH=/opt/wasi-sdk-19.5g0236e959edbc
./Tools/wasm/wasm_build.py wasi-threads build
~/git/toywasm/b.thread/toywasm --wasi --wasi-dir . --wasi-dir ~/git/garbage/py/th2 -- builddir/wasi-threads/python.wasm ~/git/garbage/py/th2/thread.py
```

* I used an unreleased version of wasi-sdk

* I used toywasm to test because wasmtime doesn't have
  necessary functionality yet.
@brettcannon
Copy link
Member

My concerns about supporting this is that wasi-threads is only at phase 1 of (I believe) 4, so this is not close to being available publicly as part of WASI itself.

The WASI SDK support is also not released yet (although I see the OP is the author of the support that's in their main branch 😉). I also don't know how many WASI runtimes support this proposal (e.g. wasmtime doesn't, but does wasmer, wasmedge, iwasm/WAMR, etc.?). Basically this seems very experimental and I would prefer we were not providing direct support and thus the ones that will get the bug reports on the feature.

As such, I'm unfortunately going to need to reject this feature request. Maybe Singlestore Labs or VMWare via their builds would be up for taking this on? Otherwise I would suggest keeping a fork going with your changes and release your own build if you're trying to get testing for wasi-threads specifically.

@brettcannon brettcannon closed this as not planned Won't fix, can't repro, duplicate, stale Feb 10, 2023
@yamt
Copy link
Contributor Author

yamt commented Feb 11, 2023

My concerns about supporting this is that wasi-threads is only at phase 1 of (I believe) 4, so this is not close to being available publicly as part of WASI itself.

The WASI SDK support is also not released yet (although I see the OP is the author of the support that's in their main branch 😉). I also don't know how many WASI runtimes support this proposal (e.g. wasmtime doesn't, but does wasmer, wasmedge, iwasm/WAMR, etc.?). Basically this seems very experimental and I would prefer we were not providing direct support and thus the ones that will get the bug reports on the feature.

wasmtime support has been landed in the meantime.
wamr has a support on a dev branch.

As such, I'm unfortunately going to need to reject this feature request. Maybe Singlestore Labs or VMWare via their builds would be up for taking this on? Otherwise I would suggest keeping a fork going with your changes and release your own build if you're trying to get testing for wasi-threads specifically.

@brettcannon
Copy link
Member

We can re-evaluate once wasi-sdk has support in a release.

@yamt
Copy link
Contributor Author

yamt commented Feb 17, 2023

a prerelease of wasi-sdk with wasi-threads support: https://github.com/WebAssembly/wasi-sdk/releases/tag/wasi-sdk-20%2Bthreads

@yamt
Copy link
Contributor Author

yamt commented Apr 3, 2023

We can re-evaluate once wasi-sdk has support in a release.

now a wasi-sdk release with wasi-threads is available: https://github.com/WebAssembly/wasi-sdk/releases/tag/wasi-sdk-20

@arhadthedev arhadthedev reopened this Apr 3, 2023
@brettcannon
Copy link
Member

The "experimental support" and "use at your own risk" parts of the release notes at https://github.com/WebAssembly/wasi-sdk/releases/tag/wasi-sdk-20 are still not enough for me to be willing to take on the support burden of keeping wasi-threads working in main.

brettcannon added a commit that referenced this issue Jun 22, 2023
Co-authored-by: Brett Cannon <brett@python.org>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
bentasker pushed a commit to bentasker/cpython that referenced this issue Jun 23, 2023
Co-authored-by: Brett Cannon <brett@python.org>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Jul 17, 2023
(cherry picked from commit d8f87cd)

Co-authored-by: YAMAMOTO Takashi <yamamoto@midokura.com>
Co-authored-by: Brett Cannon <brett@python.org>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
erlend-aasland added a commit that referenced this issue Jul 17, 2023
…06834)

(cherry picked from commit d8f87cd)

Co-authored-by: YAMAMOTO Takashi <yamamoto@midokura.com>
Co-authored-by: Brett Cannon <brett@python.org>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
@brettcannon
Copy link
Member

Threading support is in, so closing (although it's currently broken; see #111046).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OS-wasi type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

4 participants