Skip to content

Instantly share code, notes, and snippets.

View kuhar's full-sized avatar

Jakub Kuderski kuhar

  • AMD (AI Group)
  • Toronto, ON, Canada
  • 15:23 (UTC -05:00)
View GitHub Profile
@bjacob
bjacob / README.md
Created February 1, 2023 21:27
Data tiling example

Compile for LLVM-CPU, AArch64, with +i8mm extension, causing MaterializeEncoding to pick (8, 8, 8) tile sizes:

tools/iree-compile --iree-hal-target-backends=llvm-cpu --iree-llvm-target-triple=aarch64-none-linux-android29 --iree-llvm-target-cpu-features=+i8mm  --iree-flow-enable-data-tiling ~/matmul.mlir --mlir-disable-threading -o /tmp/a.vmfb --mlir-print-ir-after-all 2>/tmp/log

Compiler for VMVX with microkernels, causing dynamic tile sizes:

tools/iree-compile --iree-hal-target-backends=vmvx --iree-flow-enable-data-tiling --iree-vmvx-enable-microkernels ~/matmul.mlir --mlir-disable-threading -o /tmp/a.vmfb --mlir-print-ir-after-all 2>/tmp/log
@bjacob
bjacob / README.md
Last active September 24, 2024 12:56
IREE / MLIR / Linalg tutorial

IREE/MLIR/Linalg tutorial

Introduction

This tutorial is simultaneously about IREE, MLIR, and specifically the MLIR Linalg dialect.

What is MLIR?

MLIR is a programming language, but MLIR in itself is almost just an empty shell. What it really provides is a framework allowing to define MLIR dialects which are where the features come from.

Table of Contents

  1. ConvertToLLVM
  2. ConvertToSPIRV(IREE)
  3. Comparison

ConvertToLLVM

ConvertToLLVMPass

  • A generic pass to convert to LLVM, using the ConvertToLLVMPatternInterface to delegate to dialects the injection of conversion patterns