CNTK icon indicating copy to clipboard operation
CNTK copied to clipboard

Memory management and avoiding crashes during multiple item evaluations / multithreading

Open LowerySJ opened this issue 10 years ago • 4 comments

Hello, CNTK community. I'm trying to figure out how to put CNTK into a C# data processing pipeline.

For the CNTK network evaluation block I see I have two techniques:

  1. Passing multiple items in a single C# eval.dll call, as described here: #589.
  2. Creating multiple instances of the CNTK model and running them on separate threads, as described in the wiki.

When I pass too many items (technique 1) I get crashes with an error deep in the Math Library. Is there any built-in functionality for determining the best way to go about this or do I have to figure it out on my own?

I figured I would write a module to load a network and evaluate one item and estimate the system resources that took and based on that information determine the best way to use techniques 1 and 2 to evaluate all my items.

Any thoughts? Thanks for any help.

Cowabunga!

LowerySJ avatar Sep 30 '16 23:09 LowerySJ

You need to decide by yourself which method to use for evaluating multiple items. It is very dependent on your application scenario and system configuraiton. Please note that method 1 only works with Eval interface that does not support sparse input. We are currently working on CNTK V2, which provides better support both on batch input and multiple threads evaluation. The V2 beta will be released in a couple of weeks.

zhouwangzw avatar Oct 01 '16 06:10 zhouwangzw

Ok thank you. I'll leave post open if anyone else wants to add.

LowerySJ avatar Oct 03 '16 17:10 LowerySJ

The new CNTK Library Eval API supports parallel evaluation with parameter sharing. You can find examples: here.

zhouwangzw avatar Jul 10 '17 14:07 zhouwangzw

I am closing the issue. Please feel free to re-open it if needed.

zhouwangzw avatar Jul 10 '17 14:07 zhouwangzw