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

[MLIR] Implement tuning - step 3: bwd, nonxdlops + xdlops #1152

Merged
merged 1 commit into from
Sep 13, 2021

Conversation

jerryyin
Copy link
Member

Change description

  • Enabled tuning for bwd, and bwd xdlops solver
    • Reused the previously available PerformanceConvMlirIgemm for bwd solver
    • Reused the previously available PerformanceConvMlirIgemmXdlops for bwd xdlops solver
  • Refactored the solver infrastructures in mlir_common.cpp
    • Moved the GetKernelName() and GetOperation() into it to make it solver independent
    • Removed those two functions from all solvers
    • [TODO] Will consider about making it into a class in the future.

Test on ConvMlirIgemmBwd

Command:

MIOPEN_FIND_ENFORCE=4 MIOPEN_DRIVER_USE_GPU_REFERENCE=1 MIOPEN_LOG_LEVEL=6 MIOPEN_FIND_MODE=1 MIOPEN_DEBUG_FIND_ONLY_SOLVER=ConvMlirIgemmBwd ./bin/MIOpenDriver conv -F 2 -n 256 -c 64 -H 56 -W 56 -k 64 -y 1 -x 1 -p 0 -q 0 -u 1 -v 1 -l 1 -j 1 -m conv -g 1 -t 1 -V 1

Log:

MIOpen(HIP): Warning [GenericSearch] Done: 24/0/24, best # 22 0.975909 64,64,64,8,4,4

Test on ConvMlirIgemmBwdXdlops

Command:

MIOPEN_FIND_ENFORCE=4 MIOPEN_DRIVER_USE_GPU_REFERENCE=1 MIOPEN_LOG_LEVEL=6 MIOPEN_FIND_MODE=1 MIOPEN_DEBUG_FIND_ONLY_SOLVER=ConvMlirIgemmBwdXdlops ./bin/MIOpenDriver conv -F 2 -n 256 -c 64 -H 56 -W 56 -k 64 -y 1 -x 1 -p 0 -q 0 -u 1 -v 1 -l 1 -j 1 -m conv -g 1 -t 1 -V 1

Log:

MIOpen(HIP): Warning [GenericSearch] Done: 118/0/118, best # 28 0.442594 64,128,8,64,32,4,1,1


Previous PR this series:

@codecov

This comment has been minimized.

@junliume junliume merged commit fe9205a into develop Sep 13, 2021
construction_parameters.kernel_file = construction_parameters.kernel_name + ".mlir";

if(config == PerformanceConvMlirIgemmXdlops())
// At this case, do not pass in the invalid perf config and instead make Miir library to do
// heuristic initialization
construction_parameters.comp_options =
mlir::ConstructBuildOptions(ctx, GetOperation(), GetKernelName(), true);
construction_parameters.comp_options = mlir::ConstructBuildOptions(ctx, true);
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

@atamazov atamazov left a comment

Choose a reason for hiding this comment

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

GetPerformanceConfig() must return valid performance config.

Comment on lines +57 to +61
PerformanceConvMlirIgemm ConvMlirIgemmBwd::GetPerformanceConfig(const ConvolutionContext& ctx) const
{
std::ignore = ctx;
return {};
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This produces invalid performance config, which does not match the specification. Why this is done in GetSoluiton but not in this function?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ping @jerryyin to check. Sorry to have missed it in last review.

Copy link
Member Author

Choose a reason for hiding this comment

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

I agree it break the existing specification, but this is intentional. I will explain why I made this decision in #1154 in case this thread becomes too long. Then based on the discussion result, we can decide what's the best behavior it is for mlir solvers.

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

Successfully merging this pull request may close these issues.

3 participants