-
Notifications
You must be signed in to change notification settings - Fork 13
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
Add a PyTorch worker #212
base: main
Are you sure you want to change the base?
Add a PyTorch worker #212
Conversation
Build failed! |
1 similar comment
Build failed! |
|
||
if (parameters->has("input_shape")) { | ||
std::string shape_str = parameters->get<std::string>("input_shape"); | ||
this->input_shape = parseShape(shape_str, this->input_dim, ","); |
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.
how does this system work if there are multiple input or output tensors of different sizes? e.g. for yolo, there will be multiple output tensors
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.
I'm considering adding this in the next PR.
That will also work with the added object-detection model test. These can be put in one PR.
For the implementation, I'm thinking passing the input shapes like "224,224,3;28,28,1". Tensors separated by ";" and each dim separated by ","
What do you think? Any thoughts?
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.
also, i'm a bit unclear about how the multiple tensors would work with the batch?
We currently define the input PT tensor as
// Initialize a PT tensor with required shape
std::vector<int64_t> new_input_shape = {tensors};
std::copy(this->input_shape.begin(), this->input_shape.end(),
std::back_inserter(new_input_shape));
In this case, how would the PT tensor definition look like with multiple shapes?
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.
The PT+ZenDNN implementation you copied here did not support multiple input/output tensors so your code will need to be updated for that. This is why I wanted a test for a non object classification model to check the generality of yours.
Build failed! |
…Test with models from PyTorch model zoo including MNIST classifer, Resnet50 etc. Updated the download script and the docker scripts as well. Signed-off-by: Chi Zhang <[email protected]>
Signed-off-by: Chi Zhang <[email protected]>
…pdate the docstring of mnist_postprocess* Gate the src/workers CMake by enabling libPytorch via the env variable ENABLE_PYTORCH* Add a device parameter for the pytorch worker Signed-off-by: Chi Zhang <[email protected]>
Build failed! |
Summary of Changes
Closes #211
Motivation
We need to add a PyTorch worker that accepts the name of an PyTorch model file as an argument and compiles and evaluates it.
Implementation
Notes
There will be a new image built with PyTorch environment