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

Support canUpcastAcc in TileAndFuse pipeline when using intrinsics #19532

Open
nirvedhmeshram opened this issue Dec 19, 2024 · 0 comments
Open

Comments

@nirvedhmeshram
Copy link
Contributor

nirvedhmeshram commented Dec 19, 2024

The TileandFuse Matmul config heursictics has this code snippet

  if (!schedule) {
    // Then try again by allowing upcasting accumulator.
    schedule = deduceMMASchedule(
        problem, intrinsics, seeds, maxSharedMemoryBytes, targetSubgroupSize,
        transposedLhs, transposedRhs, /*canUpcastAcc=*/true,
        /*mustBeAligned*/ mustBeAligned, doCPromotion);
  }

However, it cannot actually upcast becuase we will fail to make a multi-mma op here
https://github.com/iree-org/iree/blob/main/compiler/src/iree/compiler/Codegen/Dialect/GPU/Transforms/Transforms.cpp#L446-L447
as we dont have upcast + multi_mma + down cast ability.

VectorDistribute does this after vectorization here with the LLVMGPUCastTypeToFitMMA pass.

For TileAndFuse I think ideally we would want to do something similar when we make the multi_mma op which I did in this branch
However, doing it early like this introduced two issues that I noticed at the FuseAndHoist pass

  1. The extf leads to a materialization of empty+fill+extf which should be just an empty
  2. The truncf doesnt seem to be tiled along with the multi_mma
    Here is a dump

The end result is that it failed to bufferize.

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

No branches or pull requests

1 participant