-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sort input/output in PreProcessPrediction #1638
base: master
Are you sure you want to change the base?
Conversation
88770fd
to
a0c8875
Compare
Thank you. We used the code from this pr, and solved the out-memory problem in our production system. |
Thanks for the bug report and the PR. I think this is best fixed in (TF) direct_session (tensorflow/tensorflow#39743) than in TF serving. Though I am wondering, why do you have so many keys in your setup. If the input/output ordering is kept consistent across requests, we should not have these many keys. no? |
I think I didn't make it clear, the root cause is the
Then the
|
For example:
There are 3 inputs, "feature1", "feature2" and "feature3" in
|
a0c8875
to
7916b6d
Compare
In direct_session.cc https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/common_runtime/direct_session.cc#L1514, it always emplaces key to executors_, then a lot of keys are added to map, which leads to a lot of memory usage.
If 10 input tensors, then there are 10! = 3,628,800 kinds of keys, memory usage is very big.
please check attached file.
serving_nommap.0042.heap.base0007.pdf
Also check issue #1215
I'm not sure fix TF code or TF serving code would be better, so I submitted another PR tensorflow/tensorflow#39743, please help check.