[DNNL] Add TensorRequisite concept. Multi instance support#11345
[DNNL] Add TensorRequisite concept. Multi instance support#11345masahi merged 1 commit intoapache:mainfrom
Conversation
|
Please fix the build. |
cca999f to
03726da
Compare
|
Can you make the coding style consistent with the rest of the codebase? We are not supposed to use |
|
Yes, I can. Could you please indicate particular places you treat as violation of coding style? I was trying to keep original code style as much as possible.
This statement slightly contradicts with TVM recommendation (Google style) and other TVM code base. Do you mean I should use |
|
Yes, sorry I meant we should use |
|
There is a conflict due to the merge of #11111 |
0372e45 to
84e221e
Compare
|
@masahi, I'm slightly confused with coding style. In my patch I would like to add several more similar util functions. And what naming I should use? |
|
Yeah, how about this: I don't think using I brought this up just because I saw a lot of uses of the style like |
Allow to use DNNL runtime in multi instance mode. Thread safe execution of Run() method. Signed-off-by: Alexander Peskov <peskovnn@gmail.com>
84e221e to
ee39484
Compare
|
@masahi Thank you for explanation about mandatory and recommendation part of code style. |
Summary
There are several limitation which prevent DNNL runtime from using in multi instance mode. This patch tries to eliminate some of them.
Multi instance mode means: call Run() method concurrently from several threads for single instance of DNNLJSONRuntime.
Particularly changed for multi instance support:
Other improvements:
Details
Introduced indirect handling of memory objects. New objects are TensorRequisite and TensorRegistry.
TensorRequisite - describe sequence of transformation on top of some source tensor.
TensorRegistry - implement matching of TensorRequisite described tensor and real dnnl::memory objects.
This concept allows to:
Some pseudo code to demonstrate concept: