)]}'
{
  "commit": "9955ff07845093788e09a4d6b9299d07d10cfb62",
  "tree": "b981ad47bb000780b13e1c34c810d84eae0aebc9",
  "parents": [
    "f560f42ea8ed66a64767546e03b6aec8834b6fd4"
  ],
  "author": {
    "name": "Ben Vanik",
    "email": "ben.vanik@gmail.com",
    "time": "Wed Feb 15 22:23:02 2023 -0800"
  },
  "committer": {
    "name": "Ben Vanik",
    "email": "ben.vanik@gmail.com",
    "time": "Fri Feb 17 09:04:37 2023 -0800"
  },
  "message": "Adding `--iree-hal-substitute-executable-*\u003d` flags.\nThis allows for specifying one or more `executable_name\u003dfile.xxx` pairs\nthat each replace a `hal.executable` op with the `executable_name` with\nthe contents of `file.xxx`. .mlir/.mlirbc files are loaded and a\n`hal.executable` with the matching name is used as a replacement while\nany other file type will cause the original executable to be externalized\nand linked with the specified file (.ptx/.spv/etc).\n\nThe additional `--iree-hal-substitute-executable-*-from\u003d` flags allow\nfor scanning a directory for executables by name to build the\nsubstitution mapping. Only files in the executable_name or\nmodule_executable_name form will be substituted but we can extend this\nin the future to support variant naming.\n\nBecause of phase ordering constraints around where codegen is able to\nmutate host-related code such as workgroup count calculations there are\ntwo flag sets:\n  `--iree-hal-substitute-executable-source\u003dname\u003dfile.xxx`\n  `--iree-hal-substitute-executable-sources-from\u003dpath/`\n and\n  `--iree-hal-substitute-executable-object\u003dname\u003dfile.xxx`\n  `--iree-hal-substitute-executable-objects-from\u003dpath/`\nSources are substituted immediately prior to benchmark generation and\nwhen substituting target objects (.ptx, .spv, etc) require that it\u0027s ok\nto skip codegen (workgroup count calculation is not dependent on root\nop detection, etc). Objects are substituted immediately after codegen\nfor use in cases where codegen is to generate the host code. There are\nuses for both depending on what the input IR is and what the developer\nwants to modify (host code, device code, or both).\n\nThe primary developer workflows this covers are:\n1. dump executable sources via `--iree-hal-dump-executable-sources-to\u003d`\n   and modify them, potentially running any number of iree-opt passes,\n   before linking them back in to the original program they came from\n2. author custom implementations ala the custom_dispatch sample in target\n   toolchains (.cu -\u003e .ptx, .glsl -\u003e .spv, etc) and use those in full\n   programs without needing to modify the compiler\n3. do either of the above and use the substituted executable for\n   microbenchmarking via `--iree-hal-dump-executable-benchmarks-to\u003d` (so\n   one can easily microbenchmark handwritten kernels)\n\nProgress on #12222 (rest is orthogonal).\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "da063ab1b3b96fc24544e454586d5fbfddf9c31b",
      "old_mode": 33188,
      "old_path": "compiler/src/iree/compiler/Dialect/HAL/IR/HALOps.td",
      "new_id": "038baa8ad6971d43b6b884a5906f94e61d8179af",
      "new_mode": 33188,
      "new_path": "compiler/src/iree/compiler/Dialect/HAL/IR/HALOps.td"
    },
    {
      "type": "modify",
      "old_id": "03623bbe947bcc5240b9da6d3f57a00a54a3b842",
      "old_mode": 33188,
      "old_path": "compiler/src/iree/compiler/Dialect/HAL/Transforms/BUILD",
      "new_id": "1ba08def3c21a181d4e9ad37b52626cbba652fe6",
      "new_mode": 33188,
      "new_path": "compiler/src/iree/compiler/Dialect/HAL/Transforms/BUILD"
    },
    {
      "type": "modify",
      "old_id": "f7294d458518ba7c6caddf883b5117c84bb3bf68",
      "old_mode": 33188,
      "old_path": "compiler/src/iree/compiler/Dialect/HAL/Transforms/CMakeLists.txt",
      "new_id": "aae952ca7d00d8a2b8993bbb8f4483b433114873",
      "new_mode": 33188,
      "new_path": "compiler/src/iree/compiler/Dialect/HAL/Transforms/CMakeLists.txt"
    },
    {
      "type": "modify",
      "old_id": "03280ce277fd09c4048df926e182a01ab2c35c2f",
      "old_mode": 33188,
      "old_path": "compiler/src/iree/compiler/Dialect/HAL/Transforms/Passes.cpp",
      "new_id": "0a70771a5979bbc4bf565265faadbefbd7fc6045",
      "new_mode": 33188,
      "new_path": "compiler/src/iree/compiler/Dialect/HAL/Transforms/Passes.cpp"
    },
    {
      "type": "modify",
      "old_id": "abe4aceb73d7711f18a8d642a66463f4cc88e620",
      "old_mode": 33188,
      "old_path": "compiler/src/iree/compiler/Dialect/HAL/Transforms/Passes.h",
      "new_id": "f8f577ea268b47a0663adde8873b24ca5fe2194f",
      "new_mode": 33188,
      "new_path": "compiler/src/iree/compiler/Dialect/HAL/Transforms/Passes.h"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "7381d29be56f8850ae3c5d75b8d8ec6fd51d29ff",
      "new_mode": 33188,
      "new_path": "compiler/src/iree/compiler/Dialect/HAL/Transforms/SubstituteExecutables.cpp"
    },
    {
      "type": "modify",
      "old_id": "4f9c17cec1f6f1d0efde8f39adaea01d16409a4f",
      "old_mode": 33188,
      "old_path": "compiler/src/iree/compiler/Dialect/HAL/Transforms/test/BUILD",
      "new_id": "284d7d44f358c69f10e01a09e47f3690a2d17a6b",
      "new_mode": 33188,
      "new_path": "compiler/src/iree/compiler/Dialect/HAL/Transforms/test/BUILD"
    },
    {
      "type": "modify",
      "old_id": "0d854b8d9280866ee056ae13126af421dfafbb2e",
      "old_mode": 33188,
      "old_path": "compiler/src/iree/compiler/Dialect/HAL/Transforms/test/CMakeLists.txt",
      "new_id": "4b62a00147467f6844fc0b75fe9e09d405c29454",
      "new_mode": 33188,
      "new_path": "compiler/src/iree/compiler/Dialect/HAL/Transforms/test/CMakeLists.txt"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "372dbcbfc7073c081db2107397f29803270ccc85",
      "new_mode": 33188,
      "new_path": "compiler/src/iree/compiler/Dialect/HAL/Transforms/test/substitute_executables.mlir"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "5f48cf4a9c22de1b9012ebf308ba1a802716338d",
      "new_mode": 33188,
      "new_path": "compiler/src/iree/compiler/Dialect/HAL/Transforms/test/substitute_executables_replacement.mlir"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "20852558f429b5cc24ee3e3ac18748db11538979",
      "new_mode": 33188,
      "new_path": "compiler/src/iree/compiler/Dialect/HAL/Transforms/test/substitute_executables_replacement.obj"
    }
  ]
}
