)]}'
{
  "commit": "38bfdbae7e94e57d932ca740b42589ea40d85196",
  "tree": "356a85a329e85b09e939bfbc17c33e1b949c5132",
  "parents": [
    "1f61c88b30f58c3f8836d0b403e49ed613c55010"
  ],
  "author": {
    "name": "Max191",
    "email": "44243577+Max191@users.noreply.github.com",
    "time": "Tue Nov 07 10:13:19 2023 -0500"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Tue Nov 07 15:13:19 2023 +0000"
  },
  "message": "[GlobalOptimization] Add pattern to reassociate dequantization + matmul `linalg.gen… (#15278)\n\n…eric` ops\r\n\r\nDequantization ops that are consumed by matmuls are currently only fused\r\ninto a dispatch region, but we can do even better by reassociating these\r\nfused operations (see https://github.com/openxla/iree/issues/14951).\r\n\r\nIt is important to note that this pattern does affect precision, and is\r\na trade off between precision and performance. It is set to opt-in with\r\n`--iree-global-opt-enable-quantized-matmul-reassociation`\r\n\r\nThis pattern rewrites a sequence of dequantization-\u003ematmul\r\n`linalg.generic` ops into a new sequence of `linalg.generic` ops. The\r\nnew sequence of ops is as follows:\r\n\r\n1. A sequence of `linalg.generic` ops that dynamically quantize the\r\nnon-quantized input to the matmul. This is very cheap in skinny matmul\r\ncases, where the non-quantized input is small compared to the quantized\r\ninput.\r\n2. A `linalg.generic` op that performs an integer matmul. This is the\r\nkey performance optimization here. On CPU, we want to be doing integer\r\nmatmuls where we can, but the matmul needs to be picked up by a\r\nVectorContractCustomKernel for now. Eventually it will be better to\r\nrewrite to `linalg.matmul` here to target ukernels.\r\n3. A final `linalg.generic` op that performs the dequantization scale\r\nand zero point math, as well as performing the remaining reduction of\r\nthe matmul. The matmul from 2. only reduces within quantized groups,\r\nwhile this op does the reduction across groups.\r\n\r\nThis also moves the FuseDequantizationMatmul pass to GlobalOptimization",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "1b3fa5e176f96a2fdc2db0165d2621de29e904aa",
      "old_mode": 33188,
      "old_path": "compiler/src/iree/compiler/Dialect/Flow/Transforms/BUILD.bazel",
      "new_id": "8809f3145cce774ed56d95874bac1d41751d6744",
      "new_mode": 33188,
      "new_path": "compiler/src/iree/compiler/Dialect/Flow/Transforms/BUILD.bazel"
    },
    {
      "type": "modify",
      "old_id": "e90ef1bee6ae433773d319d5ea0783d4f94d24a8",
      "old_mode": 33188,
      "old_path": "compiler/src/iree/compiler/Dialect/Flow/Transforms/CMakeLists.txt",
      "new_id": "1c5310a4031a7119ea6854e874bf9bbd79f26dce",
      "new_mode": 33188,
      "new_path": "compiler/src/iree/compiler/Dialect/Flow/Transforms/CMakeLists.txt"
    },
    {
      "type": "delete",
      "old_id": "51494accd4ae1079af738c6c42c3cfaf27894966",
      "old_mode": 33188,
      "old_path": "compiler/src/iree/compiler/Dialect/Flow/Transforms/FuseDequantizationMatmul.cpp",
      "new_id": "0000000000000000000000000000000000000000",
      "new_mode": 0,
      "new_path": "/dev/null"
    },
    {
      "type": "modify",
      "old_id": "78dd11a0dd455f4c2c329f3ecb17e008f574270d",
      "old_mode": 33188,
      "old_path": "compiler/src/iree/compiler/Dialect/Flow/Transforms/Passes.h",
      "new_id": "a46590d5d8b1dbe7e53f419d37e9f20407c40ea5",
      "new_mode": 33188,
      "new_path": "compiler/src/iree/compiler/Dialect/Flow/Transforms/Passes.h"
    },
    {
      "type": "modify",
      "old_id": "5ee617cddac1dd69b1e31ccaa8a80194e149d09f",
      "old_mode": 33188,
      "old_path": "compiler/src/iree/compiler/Dialect/Flow/Transforms/Passes.td",
      "new_id": "7a87ffdd7bac54eebf72ed22f1476a24fee25358",
      "new_mode": 33188,
      "new_path": "compiler/src/iree/compiler/Dialect/Flow/Transforms/Passes.td"
    },
    {
      "type": "modify",
      "old_id": "8992c5f51e5b5b8844687e502d9ac3f66a73b667",
      "old_mode": 33188,
      "old_path": "compiler/src/iree/compiler/Dialect/Flow/Transforms/test/BUILD.bazel",
      "new_id": "552ca7f0c4749117827b27f249eb30bc9ab51c2d",
      "new_mode": 33188,
      "new_path": "compiler/src/iree/compiler/Dialect/Flow/Transforms/test/BUILD.bazel"
    },
    {
      "type": "modify",
      "old_id": "aa7c0557b214be419a02a4ef6b96802495fcb817",
      "old_mode": 33188,
      "old_path": "compiler/src/iree/compiler/Dialect/Flow/Transforms/test/CMakeLists.txt",
      "new_id": "673bba862d55fbc9bededf3b2dae7d9e315540db",
      "new_mode": 33188,
      "new_path": "compiler/src/iree/compiler/Dialect/Flow/Transforms/test/CMakeLists.txt"
    },
    {
      "type": "delete",
      "old_id": "2537efd5b1a9923d54ba3ce0f87f02c6f89fa657",
      "old_mode": 33188,
      "old_path": "compiler/src/iree/compiler/Dialect/Flow/Transforms/test/fuse_dequantization_matmul.mlir",
      "new_id": "0000000000000000000000000000000000000000",
      "new_mode": 0,
      "new_path": "/dev/null"
    },
    {
      "type": "modify",
      "old_id": "ac282d8cca1638ea07778c48ad2a2a9f45854ba6",
      "old_mode": 33188,
      "old_path": "compiler/src/iree/compiler/GlobalOptimization/BUILD.bazel",
      "new_id": "4700c4d48c84b05a3be4dab356b8b189a12c95dc",
      "new_mode": 33188,
      "new_path": "compiler/src/iree/compiler/GlobalOptimization/BUILD.bazel"
    },
    {
      "type": "modify",
      "old_id": "f67edf23b1c881c5c6ef54aee999243d399ef1fe",
      "old_mode": 33188,
      "old_path": "compiler/src/iree/compiler/GlobalOptimization/CMakeLists.txt",
      "new_id": "4d2eb4e4af7fc32e02548388b5a65e9f3d608e60",
      "new_mode": 33188,
      "new_path": "compiler/src/iree/compiler/GlobalOptimization/CMakeLists.txt"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "c10fe66293f1bde16a443de50878a129fcfa2040",
      "new_mode": 33188,
      "new_path": "compiler/src/iree/compiler/GlobalOptimization/FuseDequantizationMatmul.cpp"
    },
    {
      "type": "modify",
      "old_id": "082740819f70ec9e5c472b0a5f0478623f462944",
      "old_mode": 33188,
      "old_path": "compiler/src/iree/compiler/GlobalOptimization/Passes.cpp",
      "new_id": "f75f9166ddeac3a9aec8402a7e75299fd2e1713b",
      "new_mode": 33188,
      "new_path": "compiler/src/iree/compiler/GlobalOptimization/Passes.cpp"
    },
    {
      "type": "modify",
      "old_id": "f92b120858a2f23a5fbdaf1fd8e5d1c7779ddcf3",
      "old_mode": 33188,
      "old_path": "compiler/src/iree/compiler/GlobalOptimization/Passes.h",
      "new_id": "37f989832ee1aa1c9d3019e76d0e2ec68371f08c",
      "new_mode": 33188,
      "new_path": "compiler/src/iree/compiler/GlobalOptimization/Passes.h"
    },
    {
      "type": "modify",
      "old_id": "c9a5d4bdc4d580d9b8040d326ce6f116d391cf93",
      "old_mode": 33188,
      "old_path": "compiler/src/iree/compiler/GlobalOptimization/Passes.td",
      "new_id": "b7a2fe544c00a0fd783719c17d069e6950182c2e",
      "new_mode": 33188,
      "new_path": "compiler/src/iree/compiler/GlobalOptimization/Passes.td"
    },
    {
      "type": "modify",
      "old_id": "8d84f04d617c21bc7581d52e88601d0fe44bb624",
      "old_mode": 33188,
      "old_path": "compiler/src/iree/compiler/GlobalOptimization/test/BUILD.bazel",
      "new_id": "fe7bef21321abee67d76a85ed696fa2708ab9b45",
      "new_mode": 33188,
      "new_path": "compiler/src/iree/compiler/GlobalOptimization/test/BUILD.bazel"
    },
    {
      "type": "modify",
      "old_id": "b685038d184c22b10f91aba0bedd73f65ece58e7",
      "old_mode": 33188,
      "old_path": "compiler/src/iree/compiler/GlobalOptimization/test/CMakeLists.txt",
      "new_id": "561cb728f2e0e4ce3703c7e10c2486d80e062af3",
      "new_mode": 33188,
      "new_path": "compiler/src/iree/compiler/GlobalOptimization/test/CMakeLists.txt"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "037de50f17d428569839f3da3edf54ae43c80e4b",
      "new_mode": 33188,
      "new_path": "compiler/src/iree/compiler/GlobalOptimization/test/fuse_dequantization_matmul.mlir"
    }
  ]
}
