Skip to content

[Codegen] Replace LLVMGPUVectorize with LLVMGPUTileAndFuse for supported cases - #18474

Merged
qedawkins merged 5 commits into
iree-org:mainfrom
qedawkins:deprecate_llvmgpu_vectorize
Nov 8, 2024
Merged

qedawkins merged 5 commits into
iree-org:mainfrom
qedawkins:deprecate_llvmgpu_vectorize

Conversation

@qedawkins

@qedawkins qedawkins commented Sep 10, 2024 •

Copy link
Copy Markdown
Contributor

The plan is to deprecate the LLVMGPUVectorize pipeline as it is no
longer maintained. This patch is the first step towards deprecating it.
The pipeline is still used by default for convolutions (if
LLVMGPUVectorDistribute does not pick it up).

  1. (this) Replace default use cases of LLVMGPUVectorize with
    LLVMGPUTileAndFuse.
  2. Replace convolution focused uses of LLVMGPUVectorize.
  3. Separate out the lowering config logic for pre-bufferized dispatches
    (that targets LLVMGPUBaseDistribute).
  4. Delete the vectorize pipeline.

Depends on #18679

@qedawkins
qedawkins force-pushed the deprecate_llvmgpu_vectorize branch from 931f7da to 056fcf2 Compare September 19, 2024 15:39
@qedawkins
qedawkins force-pushed the deprecate_llvmgpu_vectorize branch from 056fcf2 to a6640ef Compare October 1, 2024 18:06
@qedawkins
qedawkins force-pushed the deprecate_llvmgpu_vectorize branch 8 times, most recently from 6b2ce9b to 56caa6a Compare October 9, 2024 02:22
@qedawkins
qedawkins force-pushed the deprecate_llvmgpu_vectorize branch 3 times, most recently from 03e0943 to f2204d2 Compare October 11, 2024 16:02
@qedawkins
qedawkins force-pushed the deprecate_llvmgpu_vectorize branch from f2204d2 to b1a9551 Compare October 13, 2024 18:58
@qedawkins
qedawkins marked this pull request as ready for review October 13, 2024 18:59

@nirvedhmeshram nirvedhmeshram left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

})
.Default([&](auto op) {
LDBG("Default Config");
if (!clUseLLVMGPUVectorizePipeline) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: clUseLLVMGPUVectorizePipeline -> clLLVMGPUUseLegacyDefaultPipeline

funcPassManager.addPass(createGPUApplyTilingLevelPass(options));
}
funcPassManager.addPass(IREE::GPU::createDistributeMmaToLanesPass());
funcPassManager.addPass(createConvertToDestinationPassingStylePass(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Do we need this here? Even if we want this, this is running pretty late.

@qedawkins
qedawkins force-pushed the deprecate_llvmgpu_vectorize branch from 41a3b1e to 13b0f1c Compare October 30, 2024 22:13

@MaheshRavishankar MaheshRavishankar left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Left a comment on flag name, but looks good otherwise.

@qedawkins
qedawkins force-pushed the deprecate_llvmgpu_vectorize branch 3 times, most recently from 37f9d38 to 5a98d83 Compare November 4, 2024 21:47
@pashu123

pashu123 commented Nov 6, 2024

Copy link
Copy Markdown
Contributor

@qedawkins, I just came across this PR. It's necessary for enabling scf.forall distribution for the entire GPU pipeline. Thanks.

@qedawkins

Copy link
Copy Markdown
Contributor Author

Yeah this PR is still in progress. There are numerics issues related to the AMDGPU backend that are being worked out (also this depends on: #19010 )

@qedawkins
qedawkins force-pushed the deprecate_llvmgpu_vectorize branch from 5a98d83 to 435c628 Compare November 7, 2024 23:50
@qedawkins

Copy link
Copy Markdown
Contributor Author

So there are finally more progressions than regressions in the model suite, however most of the regressions are numerics: https://github.com/nod-ai/e2eshark-reports/blob/main/2024-11-07-iree-test/ci_reports_onnx/rocm/combined-reports/yesterday_comparison.md

I'm going to land this because it has started to pile up dependent work and fix forward as many of the remaining correctness issues as possible. As a follow up I plan to add a few -O0 type flags to the compiler that can help us narrow down correctness issues (and potentially help users file more succinct repros in the future).

…ted cases

The plan is to deprecate the LLVMGPUVectorize pipeline as it is no
longer maintained. This patch is the first step towards deprecating it.
The pipeline is still used by default for convolutions (if
LLVMGPUVectorDistribute does not pick it up).

1) (this) Replace default use cases of LLVMGPUVectorize with
   LLVMGPUTileAndFuse.
2) Replace convolution focused uses of LLVMGPUVectorize.
3) Separate out the lowering config logic for pre-bufferized dispatches
   (that targets LLVMGPUBaseDistribute).
4) Delete the vectorize pipeline.
@qedawkins
qedawkins force-pushed the deprecate_llvmgpu_vectorize branch from 435c628 to f790a84 Compare November 8, 2024 14:16
@qedawkins
qedawkins enabled auto-merge (squash) November 8, 2024 14:16
@qedawkins
qedawkins merged commit f6ca0e3 into iree-org:main Nov 8, 2024
@qedawkins
qedawkins deleted the deprecate_llvmgpu_vectorize branch November 8, 2024 14:55
Groverkss pushed a commit to Groverkss/iree that referenced this pull request Dec 1, 2024
…ted cases (iree-org#18474)

The plan is to deprecate the LLVMGPUVectorize pipeline as it is no
longer maintained. This patch is the first step towards deprecating it.
The pipeline is still used by default for convolutions (if
LLVMGPUVectorDistribute does not pick it up).

1) (this) Replace default use cases of LLVMGPUVectorize with
   LLVMGPUTileAndFuse.
2) Replace convolution focused uses of LLVMGPUVectorize.
3) Separate out the lowering config logic for pre-bufferized dispatches
   (that targets LLVMGPUBaseDistribute).
4) Delete the vectorize pipeline.
giacs-epic pushed a commit to giacs-epic/iree that referenced this pull request Dec 4, 2024
…ted cases (iree-org#18474)

The plan is to deprecate the LLVMGPUVectorize pipeline as it is no
longer maintained. This patch is the first step towards deprecating it.
The pipeline is still used by default for convolutions (if
LLVMGPUVectorDistribute does not pick it up).

1) (this) Replace default use cases of LLVMGPUVectorize with
   LLVMGPUTileAndFuse.
2) Replace convolution focused uses of LLVMGPUVectorize.
3) Separate out the lowering config logic for pre-bufferized dispatches
   (that targets LLVMGPUBaseDistribute).
4) Delete the vectorize pipeline.

Signed-off-by: Giacomo Serafini <[email protected]>
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.

4 participants