-
Notifications
You must be signed in to change notification settings - Fork 650
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
Initial integration of Wasi-nn #1225
Conversation
@Ahmedounet Thanks for uploading the PR, it is really useful! Not sure why you closed the PR, is it due to the CI check failures? It might take some efforts to resolve the CI issues, I am wandering whether we can refactor the PR and upload it by ourselves? We will add you to help review once it is finished. And of cause, you can resolve the issues and open it again by yourself. There are several suggestions:
Thanks. |
Hi @wenyongh, Thanks for the feedback! We are working on it in our fork, you will get the PR back once it is stable and tested. May I take this oportunity to ask some questions?
Thank you very much! |
Hi, for the structure defintions, we had better align them to the current coding style, for example: typedef enum TensorType {
...
} TensorType;
typedef struct Tensor {
TensorDimensions dimensions;
TensorType type;
TensorData data;
} Tensor; For the serialization issue, my understanding is there are two isses: struct Tensor_app { /* struct in wasm app */
uint32 dimensions_offset;
...;
};
struct Tensor_native { /* struct in native */
void *dimensions;
}; Then we can validation the app's offset firstly, and then convert it to the pointer (absolute address): Tensor_app *tensor_app;
Tensor_native *tensor_native;
if (!validate_app_addr(tensor_app->dimensions_offset, sizeof(uint32)) {
return_error;
}
tensor_native->dimensions = (void *)addr_app_to_native(iovec_app->dimensions_offset);
use tensor_native to call tensorflow API
What the tests are? If it is a simple test like unit test, maybe you can put it under
|
Initial integration of WASI-NN based on bytecodealliance#1225: - Implement the library core/iwasm/libraries/wasi-nn - Support TensorFlow, CPU, F32 at the first stage - Add cmake variable `-DWAMR_BUILD_WASI_NN` - Add test case based on Docker image and update document Refer to bytecodealliance#1573
Tflite Inference model Load function implementation following witx conventions of wasi-nn.