Comments (4)
I recommend using accelerate
. For more information, please refer to https://huggingface.co/docs/accelerate/usage_guides/memory or https://towardsdatascience.com/a-batch-too-large-finding-the-batch-size-that-fits-on-gpus-aef70902a9f1. I personally prefer the former as I find it to be much cleaner.
from nobrainer.
Unfortunately, accelerate
only supports pytorch. Probably, will have to wait until tensorflow is supported.
from nobrainer.
Unfortunately, tensorflow doesn't have decorators/functions to auto-scale batch size like how lightning/accelerate for pytorch does.
However, here's a naive example of accomplishing this.
@satra let me know your thoughts about where in the codebase should this go, API or docs.
from nobrainer.
perhaps add that as a more generic utility function, and the api can use an enum like AUTO_TUNE_BATCH
to indicate whether that function should be called or the provided batch size used. however, as we know this is not always a function of largest batch size possible given memory requirements. hence we should consider situations where we don't need all the memory and could even request shards corresponding to the more optimal batch size.
from nobrainer.
Related Issues (20)
- CI to stop if http connection failures occur HOT 4
- Typo in processing.segmentation.Segmentation HOT 1
- Fix PGAN issues HOT 7
- Remove redundant method
- Could this have been a typo?
- Redundancy in serializing shapes of feature and label volumes
- suggested refactoring to avoid OOM errors HOT 1
- explicit repeat of dataset before calling fit method HOT 2
- map_labels fails for n_classes > 1 HOT 1
- typo: replace label_mapping with mapping
- Shape mismatch at the output on unet when n_classes > 1 HOT 4
- Add data count to tfrecords HOT 6
- remove redundant argument HOT 1
- brainy training script failing at validation for kwyk records
- specifying full file path as part of shard template fails with "File Not Found Error" HOT 4
- Refactor code to identify correct steps per epoch HOT 1
- model evaluation on random samples during training is not straightforward HOT 3
- Modify mapping function to mask out segments that are surplus in the label volume HOT 2
- refactor code to calculate records per shard using n_volumes and number of shards HOT 2
- Sharding doesn't result in examples of specified size HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nobrainer.