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

[Midend] Enhancements and Optimizations for batch matmul and convolution [Examples] Added MLIRLinalg Examples for Various Optimization Options. #391

Merged
merged 8 commits into from
Oct 15, 2024

Conversation

6somehow
Copy link
Contributor

@6somehow 6somehow commented Sep 26, 2024

[Midend] Enhancements and Optimizations

  • BatchMatMul:

    • Updated unroll, tile, and vectorization strategies for BatchMatMul operations.
    • Enhanced SCF (Structured Control Flow) version for BatchMatMul to support further optimization and work.
  • Conv2D NHWC-FHWC:

    • Improved vectorization and tiling techniques for Conv2D operations in NHWC-FHWC layout.
    • These updates provide a vectorization option and a tile+vectorization option for buddy-opt.
  • Depthwise Conv2D NHWC-HWC:

    • Introduced vectorization and tiling strategies for Depthwise Conv2D in NHWC-HWC format, ensuring more efficient execution.

[Examples] Added MLIRLinalg Examples for Various Optimization Options

New MLIRLinalg examples were added to demonstrate the usage of new buddy-opt various optimization options , including:

  1. conv-nhwc-fhwc-optimize: Conv2D NHWC-FHWC layout vectorization optimization.
  2. conv-nhwc-fhwc-tile-optimize: Conv2D NHWC-FHWC vectorization with tiling optimizations.
  3. depthwise-conv-nhwc-hwc-optimize: Depthwise Conv2D NHWC-HWC
    vectorization layout optimization.
  4. batchmatmul-tile-optimize: tiling and unroll optimization for BatchMatMul.
  5. batchmatmul-scf-optimize: using SCF optimization for BatchMatMul.

Example MLIR Files:

  • batchmatmul
  • conv2d_nhwc_fhwc
  • depthwise_conv_2d_nhwc_hwc

These updates collectively improve the performance of matrix and convolution operations in MLIR, providing optimized patterns for common workloads like BatchMatMul and convolution layers.

…ion [Examples] Added MLIRLinalg Examples for Various Optimization Options. fixed thirdparty.
@xlinsist
Copy link
Collaborator

…ion [Examples] Added MLIRLinalg Examples for Various Optimization Options. fixed thirdparty.

You can copy the description from the former PR(#384) into this one.

Comment on lines +5 to +7
BatchMatMulOptimize.cpp
BatchMatMulTileOptimize.cpp
BatchMatMulSCFOptimize.cpp
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do our optimized methods need to add into both MatMulOptimization and BatchMatMulOptimization?

@xlinsist
Copy link
Collaborator

LGTM, thanks!

…ion [Examples] Added MLIRLinalg Examples for Various Optimization Options.
…ion [Examples] Added MLIRLinalg Examples for Various Optimization Options.
@xlinsist xlinsist merged commit aef92be into buddy-compiler:main Oct 15, 2024
1 check passed
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.

2 participants