Random erase dropout kernel implementation#556
Random erase dropout kernel implementation#556r-abishek merged 67 commits intor-abishek:ar/dropout_random_erasefrom
Conversation
…all the bitdepths
…images in the docs
indentation modified
…ied QA for logic to implement random seed for non QA
| #include "hip_tensor_executors.hpp" | ||
| #include <random> | ||
|
|
||
| __device__ inline uint generate_seed(uint x, uint y, uint z, int seed) |
There was a problem hiding this comment.
add comments for all the hardcoded numbers and specify in the comments why those numbers are needed
There was a problem hiding this comment.
As per the new logic the LCG method to produce random noise is removed and the noise buffer is passed from the test suite, Done
…c in test suite and pass buffer for random noise
HazarathKumarM
left a comment
There was a problem hiding this comment.
@RooseweltMcW please address the comments
| #endif // GPU_SUPPORT | ||
|
|
||
| /*! \brief Random Erase augmentation on HOST backend for a NCHW/NHWC layout tensor | ||
| * \details This function erases erases random regions from an image and fills with random noise, for a batch of RGB(3 channel) / greyscale(1 channel) images with an NHWC/NCHW tensor layout.<br> |
There was a problem hiding this comment.
erase is repeated twice. please correct it
| * \param [in] anchorBoxInfoTensor anchorBoxInfo values of type RpptRoiLtrb for each erase-region inside each image in the batch HOST memory. Restrictions - | ||
| - 0 <= anchorBoxInfo[i] < respective image width/height | ||
| - Erase-region anchor boxes on each image given by the user must not overlap | ||
| * \param [in] numBoxesTensor number of erase-regions per image, for each image in the batch (numBoxesTensor[n] >= 0) |
There was a problem hiding this comment.
for random erase its always one box right . Do we even need to pass this tensor to kernel?
| RpptROIPtr roiPtrInput = &roiTensorPtrSrc[batchCount]; | ||
| compute_roi_validation_host(roiPtrInput, &roi, &roiDefault, roiType); | ||
|
|
||
| Rpp32u numBoxes = numBoxesTensor[batchCount]; |
There was a problem hiding this comment.
as commneted above numBoxes won't be needed I feel
|
|
||
| for(int count = 0; count < numBoxes; count++) | ||
| { | ||
| Rpp32u x1 = static_cast<Rpp32u>(RPPPRANGECHECK(anchorBoxInfo[count].lt.x, roi.xywhROI.xy.x, roi.xywhROI.roiWidth)); |
There was a problem hiding this comment.
modify the func name here, it should be RPPRANGECHECK
There was a problem hiding this comment.
This change requires modifying every other function which is using the function RPPP to RPP which has to be a global change
| int id_y = hipBlockIdx_y * hipBlockDim_y + hipThreadIdx_y; | ||
| int id_z = hipBlockIdx_z * hipBlockDim_z + hipThreadIdx_z; | ||
|
|
||
| auto &roi = roiTensorPtrSrc[id_z].xywhROI; |
There was a problem hiding this comment.
is it required. please modify the below condition like all other kernels
| Rpp32u numBoxes = numBoxesTensor[id_z]; | ||
| uint dstIdx = id_z * dstStridesNH.x + id_y * dstStridesNH.y + id_x * 3; | ||
|
|
||
| for (int i = 0; i < numBoxes; i++) |
There was a problem hiding this comment.
loop inside hip kernel?, can we not make use of the gpu threads and make it parallel
There was a problem hiding this comment.
Removed and processed only one box logic
| // if src layout is NHWC, copy src to dst | ||
| if (srcDescPtr->layout == RpptLayout::NHWC) | ||
| { | ||
| hipMemcpyAsync(dstPtr, srcPtr, static_cast<size_t>(srcDescPtr->n * srcDescPtr->strides.nStride * sizeof(T)), hipMemcpyDeviceToDevice, handle.GetStream()); |
There was a problem hiding this comment.
already srcPtr is copied to dstPtr, then why for loop was there in the hip kernels for num boxes
|
|
||
| int globalThreads_x = dstDescPtr->w; | ||
| int globalThreads_y = dstDescPtr->h; | ||
| int globalThreads_z = handle.GetBatchSize(); |
There was a problem hiding this comment.
discussed to launch kernel per box. Have to replace it with actual box dimensions
* Add Box and Median Filter ROI fixes after minor corrections * Fix source index computation --------- Co-authored-by: Mukesh <mukesh.jayakodi@multicorewareinc.com> Co-authored-by: Kiriti Gowda <kiritigowda@gmail.com>
…ocs/sphinx (r-abishek#556) Bumps [rocm-docs-core[api_reference]](https://github.com/ROCm/rocm-docs-core) from 1.19.1 to 1.20.0. - [Release notes](https://github.com/ROCm/rocm-docs-core/releases) - [Changelog](https://github.com/ROCm/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](ROCm/rocm-docs-core@v1.19.1...v1.20.0) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-version: 1.20.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Kiriti Gowda <kiritigowda@gmail.com>
No description provided.