Comments (6)
Thanks for the explanation!
from batched-fn.
Hi, you might want to start by putting timing code in the handler
closure, e.g. right here:
batched-fn/examples/example.rs
Lines 36 to 38 in 93b3ffc
That will tell you how it takes to process each batch at a given batch size.
In general (for deep learning models, at least) I would set max_batch_size
as large as you can without running out of memory, and max_delay
small relative to the time it takes to process a batch.
from batched-fn.
Hi, thanks for the suggestion. That helps! I have one more question, how about channel_cap
?
from batched-fn.
When you set channel_cap
, batched_fn!
will internally use a bounded flume channel instead of an unbounded one. As a result, calls to your batched fn might return Error::Full
.
One reason you might want to use this feature is to return 503 errors when your server is getting too many requests at once. In particular, set channel_cap
to some number greater than max_batch_size
and then catch Error::Full
in your server code, and return a 503 error when that happens.
from batched-fn.
I realize the documentation about channel_cap
has been lacking, so here's this: #19
from batched-fn.
You're welcome!
from batched-fn.
Related Issues (7)
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 batched-fn.