Skip to content
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

MV-532: [MV-MIOpen] Benchmark & Port AvgPool #48

Open
wants to merge 9 commits into
base: develop-moreh
Choose a base branch
from

Conversation

hieule88
Copy link
Collaborator

@hieule88 hieule88 commented Aug 19, 2024

  • Added AvgPool 2D 3D forward and backward with new solvers and bfp16 supported.

  • Added driver test and gtest for AvgPool.

  • New API is guarded by MIOPEN_BETA_API macro.

  • Compared to ROCm pytorch: Link

  • Average over all cases:

  • AvgPool 2D

Type Forward Backward
float16 3.51 1.95
float32 7.54 Not Improved
bfloat16 3.26 3.54
  • AvgPool 3D
Type Forward Backward
float16 14.01 15.98
float32 10.53 5.58
bfloat16 3.54 3.97

@hieule88 hieule88 self-assigned this Aug 19, 2024
Copy link
Collaborator

@littlecutebird littlecutebird left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Partial review

Comment on lines +7650 to +7658
const int32_t KD,
const int32_t KH,
const int32_t KW,
const int32_t SD,
const int32_t SH,
const int32_t SW,
const int32_t PD,
const int32_t PH,
const int32_t PW,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing documentation for those params. And may I ask why don't you include ceil_mode as a param?

Comment on lines +7680 to +7688
const int32_t KD,
const int32_t KH,
const int32_t KW,
const int32_t SD,
const int32_t SH,
const int32_t SW,
const int32_t PD,
const int32_t PH,
const int32_t PW,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

Comment on lines +63 to +66
int32_t gid = threadIdx.x + blockIdx.x * blockDim.x;
int32_t ncoh = gid / OW, ow = gid % OW;
int32_t nc = ncoh / OH, oh = ncoh % OH;
int32_t n = nc / C, c = nc % C;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It limits the kernel applicability for tensors <2Gb as discussed in another PR ROCm#3167 (comment) . I suggest to avoid using int32_t for variables

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recommend to modify like this PR https://github.com/ROCm/MIOpen/pull/3152/files#diff-0a8b79941cc58d4496df527ac51df1ca8e3f4729f4223d1f4714b81c880d24a1 . Then instead of calling input[input_tv.get_tensor_view_idx(tensor_layout_t<4>(n, c, h, w))]); in MIOpenAvgPool.cpp you use input[input_tv.get_tensor_view_idx({n, c, h, w})]);

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May I ask you to provide test for uncont tensor?

Copy link
Collaborator

@cognaiger9 cognaiger9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As MIOpen already has API for pooling group, you should integrate these functions into existing APIs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants