-
Notifications
You must be signed in to change notification settings - Fork 106
String tensor support #832
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
…disAI into string_tensor_support
Codecov Report
@@ Coverage Diff @@
## master #832 +/- ##
==========================================
+ Coverage 79.97% 81.22% +1.24%
==========================================
Files 53 55 +2
Lines 8009 8126 +117
==========================================
+ Hits 6405 6600 +195
+ Misses 1604 1526 -78
Continue to review full report at Codecov.
|
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.
please see tensor.h/tensor.c comments
please add:
- script to create onnx model
- DAG tests
- v4 encoding
src/redis_ai_objects/tensor.c
Outdated
size_t RAI_TensorByteSize(RAI_Tensor *t) { | ||
// TODO: as per dlpack it should be | ||
// size *= (t->dtype.bits * t->dtype.lanes + 7) / 8; | ||
// todo: change after verify that blob size is initialized properly |
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.
TODO?
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.
This upper TODO is old (Luca?), and I don't really understand what it means. Should I remove it?
About the other todo - will do.
… remove deep copy (not used)
@@ -1,29 +1,6 @@ | |||
import onnx | |||
from onnx import helper, TensorProto, ModelProto, defs | |||
|
|||
|
|||
def make_model(graph, **kwargs): # type: (GraphProto, **Any) -> ModelProto |
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.
let's validate ONNX versions vs ONNXRuntime versions here please
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.
Validated - using ONNX 1.8.0 when running this script will create a model that runs properly on ONNXRuntime 1.8.1.
Note that if we use ONNX latest (1.10.1), Opset version is 15, while ONNXRuntime 1.8.1 supports up to 14. I assume that ONNXRumtime will support Opset version 15...
…disAI into string_tensor_support
redis> AI.TENSORSET mytensor STRING 1 2 VALUES first second | ||
OK |
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.
please have a dedicated section regarding strings
how they should be provided by blob and by values.
consider doing so in a different PR involving documentation for BOOL
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.
OK, will do in a new PR
We introduce string tensor for RedisAI, which are tensors in which every element is a null-terminated string (we support utf-8 format).
This PR adds the following capabilities:
AI_TENSORSET <KEY> string <shape_1> [<shape_2> ...] [BLOB <blob> | VALUES <str_1> ...]
todo: