-
Notifications
You must be signed in to change notification settings - Fork 106
Turn dag local context dict into array #582
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
- In TF: verify that model inputs names correspond to model inputs ops (and not just for any op)
…tensors (instead of the DagLocalContext dict). Every op holds the indices of its input and output tensors, and uses this array to load and store them in turn.
Codecov Report
@@ Coverage Diff @@
## master #582 +/- ##
==========================================
+ Coverage 74.27% 74.28% +0.01%
==========================================
Files 39 39
Lines 6083 5997 -86
==========================================
- Hits 4518 4455 -63
+ Misses 1565 1542 -23
Continue to review full report at Codecov.
|
- Save the indices of the tensors to persist as values in persistTensors dict, and release TensorsNamesToIndices before DAG run.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome job, this looks really good to me. Let's kill mangling!
src/DAG/dag.h
Outdated
* @param index The index of the tensor in the Dag shared array to return | ||
* @return The tensor of the given index (NULL is returned if this tensor hasn't been realized yet) | ||
*/ | ||
RAI_Tensor *Dag_GetInternalTensor(RedisAI_RunInfo *rinfo, size_t index); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RAI_Tensor *Dag_GetInternalTensor(RedisAI_RunInfo *rinfo, size_t index); | |
RAI_Tensor *Dag_GetTensorFromGlobalCtx(RedisAI_RunInfo *rinfo, size_t index); |
src/DAG/dag.h
Outdated
* @param index The index to put in the given tensor in the Dag shared array. | ||
* @param t The tensor to shallow copy and store in the given index. | ||
*/ | ||
void Dag_SetInternalTensor(RedisAI_RunInfo *rinfo, size_t index, RAI_Tensor *t); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
void Dag_SetInternalTensor(RedisAI_RunInfo *rinfo, size_t index, RAI_Tensor *t); | |
void Dag_SetTensorInGlobalCtx(RedisAI_RunInfo *rinfo, size_t index, RAI_Tensor *t); |
Turn dag local context dict into array
Introduce a shared array in DAG runInfo that stores DAG intermediate tensors (instead of the DagLocalContext dict). Every DAG operation holds the indices of its input and output tensors, and uses this array to load and store them in turn.