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

Benchmark tool freeze with tfjs@3.4.0 #4934

Closed
lina128 opened this issue Apr 15, 2021 · 2 comments · Fixed by #4957
Closed

Benchmark tool freeze with tfjs@3.4.0 #4934

lina128 opened this issue Apr 15, 2021 · 2 comments · Fixed by #4957
Labels
type:bug Something isn't working

Comments

@lina128
Copy link
Collaborator

lina128 commented Apr 15, 2021

The benchmark tool freeze (no response) with the latest tfjs@3.4.0 release. https://tensorflow.github.io/tfjs/e2e/benchmarks/local-benchmark/index.html

@lina128 lina128 added the type:bug Something isn't working label Apr 15, 2021
@pyu10055
Copy link
Collaborator

@lina128 this may related to #4932

@google-ml-butler
Copy link

Are you satisfied with the resolution of your issue?
Yes
No

mattsoulanille added a commit that referenced this issue Apr 22, 2021
Without the linker option `PTHREAD_POOL_SIZE` set, the wasm backend does not create any webworkers and spins forever waiting for them to be created (crashing the browser). This PR sets `PTHREAD_POOL_SIZE` to `Math.min(4, Math.max(1, (navigator.hardwareConcurrency || 1) / 2))`, meaning it will use half of the logical cores available up to a max of 4 (or only 1 if `navigator.hardwareConcurrency` is not available). See [this comment](emscripten-core/emscripten#10263 (comment)) for details on why this works. This option apparently supersedes the value passed to [`pthreadpool_create` in `backend.cc`](https://github.com/tensorflow/tfjs/blob/c9dfebddfa34f531d2f0c363b6ea574a9fe9745d/tfjs-backend-wasm/src/cc/backend.cc#L65-L66), but its current setting should match the value computed in the `.cc` file. Fixes #4932 

This PR also fixes a bug where webworkers created by the wasm backend were not removed when `dispose` is called. Fixes #4796.

Fixes #4934 as well.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants