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.
WebGL Backend: Centralize async reading of data, postpone disposal if…
… a pending read (tensorflow#859) BUG FEATURE PERF All the work involves only the WebGL backend. - Centralize async reading of data in a single setTimeout loop - Postpone disposal if there is a pending read - Use LRU cache to page textures out of the GPU memory and into CPU (Avoids crashing browser) - Some optimizations: - Cache the `ext.GPU_DISJOINT_EXT` parameter since reading it is expensive - Do binary search for queryIsDone since checking is expensive - Reuse download buffers for readPixels to minimize js memory trashing Did a stress test using demos/mnist_eager where I made tensor.dispose() a no-op. There is significant slowdown (~10x) due to constant downloads and js GC trashing memory, but the browser doesn't crash. The optimizations I did were motivated by the profiling from this stress test. Fixes tensorflow/tfjs#394
- Loading branch information
Showing
15 changed files
with
368 additions
and
67 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,6 @@ node_modules/ | |
karma.conf.js | ||
*.tgz | ||
*.log | ||
dist/**/*.js.map | ||
.travis.yml | ||
CONTRIBUTING.md | ||
tslint.json | ||
|
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
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
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
Oops, something went wrong.