Add logic to limit binaryCache size
TensorFlow.js version
@tensorflow/tfjs ^1.7.0
Browser version
Electron ^6.0.0
Describe the problem or feature request
(This is a feature request based off the issue reported in #604)
We would like to be able to set a limit (or have it automatically maintained) for the internal cache. Running many operations on tensors of varying length (10,000 variable length audio files) causes a GPU memory leak not detectable via tf.memory. This is because a new texture is cached for each different length tensor. Our memory usage skyrockets and tanks the performance of our application.
We understand this can be fixed by trimming/padding the audio files to a fixed length, and this would have the added advantage of better caching, however it feels wrong to have this performance hit if a user does not want to, or cannot fix the length of their input tensors.
Having the ability to either dispose() or remove caching for certain operations would be very useful.
We also would like to keep our models in memory and cached so calling tf.backend.dispose would not work.
Code to reproduce the bug / link to feature request
Reproduction example at #604.
Please let me know if there is already a way to achieve this,
Thanks, keep up the good work!
+1, same problem
Hi, @eschirtz
Apologize for the delayed response and Just to confirm, May I know your issue got resolved or you're still looking to implement this feature from our end ?
Could you please refer this comment which may help you to resolve your issue ? Thank you!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you.
Closing as stale. Please @mention us if this needs more attention.