-
Notifications
You must be signed in to change notification settings - Fork 0
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
Fix rocAL Tensor build issues PR 4 - Pipeline and Pybind #28
Fix rocAL Tensor build issues PR 4 - Pipeline and Pybind #28
Conversation
fiona-gladwin
commented
Jul 7, 2023
- Re introduced the copy tensor API in master graph as it gives performance in tensor trainings
- Re-introduce some external API to get width and height from master graph as suggested
- Introduce API and changes required to get original ROI from tensor (Similar to TOT changes)
- Fix build issues with pybind
2651ffa
to
0a25c27
Compare
@@ -50,6 +50,25 @@ THE SOFTWARE. | |||
#define MAX_NUM_ANCHORS 8732 // Num of bbox achors used in SSD training | |||
#define MAX_MASK_BUFFER 10000 | |||
|
|||
#if ENABLE_SIMD |
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 seems to be missing in tot MIVIsionX. Why is this needed here
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 portion was a part of master_graph.cpp.
We have moved the masks as constants into the master_graph.h hence we have moved the include part also from the cpp file into master_graph.h file
|
||
_convert_time.start(); | ||
// Copies to the output context given by the user | ||
auto dims = _output_tensor_list[0]->info().dims(); |
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 use another pointer to point to output_tensor_list[0]->info() and use that everywhere.
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.
Done
const size_t c = dims[3]; | ||
const size_t h = dims[1]; | ||
const size_t w = dims[2]; | ||
const size_t single_output_image_size = _output_tensor_list[0]->info().data_size(); |
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.
rename to tensor specific name
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.
Done
@@ -112,6 +112,8 @@ void TensorInfo::reset_tensor_roi_buffers() { | |||
size_t roi_size = (_layout == RocalTensorlayout::NFCHW || _layout == RocalTensorlayout::NFHWC) ? _dims[0] * _dims[1] : _batch_size; // For Sequences pre allocating the ROI to N * F to replicate in OpenVX extensions | |||
allocate_host_or_pinned_mem((void **)&_roi_buf, roi_size * 4 * sizeof(unsigned), _mem_type); | |||
} | |||
if(!_original_roi_height->size()) _original_roi_height = std::make_shared<std::vector<uint32_t>>(_batch_size); |
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.
Why is changed from struct roi to width and height
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.
Removed these _original_roi_width and _original_roi_height as they are not used anymore
rocAL/rocAL_pybind/rocal_pybind.cpp
Outdated
numpy_array = py::array(py::buffer_info( | ||
((unsigned char *)(output_tensor.buffer())) + idx * (info.strides()[0]/sizeof(float)), | ||
((unsigned char *)(output_tensor.buffer())) + idx * (output_tensor.strides()[0]/sizeof(float)), |
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.
why is this dividing by sizeof(float) for UINT8
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.
Fixed
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 address review comments
0a25c27
to
2651ffa
Compare
Avoid the conflicting function name between tensor and image files
@rrawther and @LakshmiKumar23 I have addressed all review comments. Please check. |