forked from tensorflow/tfjs-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Always test for a fence with gl2.clientWaitSync(sync, 0, 0) (tensorfl…
…ow#1529) Fixes tensorflow/tfjs#1145 The smallest repro is calling .data() 3 times without waiting: ```ts tf.ENV.set('WEBGL_CPU_FORWARD', false) tf.ENV.set('WEBGL_SIZE_UPLOAD_UNIFORM', 0); tf.square(3).data(); tf.square(3).data(); tf.square(3).data(); ``` There are 3 fences that are in parallel. And on the next tick the binary search tests only the middle fence and sees that it is done, and assumes the first fence is done too. But since we never explicitly tested fence[0].isDone(), Chrome gives a warning. The warnings started showing up more often when Layers started doing parallel reads of the scalar loss values: tensorflow/tfjs-layers#398 I changed the binary search to linear search so we also test all fences up to the one that is not done.
- Loading branch information
Showing
2 changed files
with
29 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters