)]}'
{
  "commit": "6cac68da7c0bb24397144e366c05fde1489b5bf5",
  "tree": "149ff8cd9876998ace7e994d702e20a3368a1581",
  "parents": [
    "8953bcf037d2c48e044225ab3579ebbb31d66c51"
  ],
  "author": {
    "name": "Stefan Schuermans",
    "email": "schuermans@roofline.ai",
    "time": "Tue Nov 17 09:28:02 2026 +0100"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Tue Nov 17 08:28:02 2026 +0000"
  },
  "message": "[GlobalOptimization] Split constants larger than the max allocation size (#25242)\n\nA constant whose storage exceeds the max allocation size of its resource\nconfig cannot be packed within that limit. PackConstants places such\nconstants in a separate resource, but the size will still exceed the\nlimit. The problem only shows up at runtime, when the device fails to\nallocate the buffer.\n\nThis adds `iree-global-opt-split-large-constants`. It splits a private,\nimmutable global above the limit into shards along its outermost\nnon-unit dimension. Each resulting shard is a contiguous byte range of\nthe original constant and fits into one allocation. The initial value\ncan be an inline dense constant, which is sliced, or a named parameter,\nwhich is not read: each shard refers to its byte range of the same\nparameter through the `offset` and `length` config entries, relative to\nany offset the parameter already has. The uses of its loads are\nrewritten to use the shards:\n\n* An input of a structured op whose split dimension is indexed by a\nsingle loop: the op is split along that loop with TilingInterface, one\nop per shard. The results of a parallel loop are inserted into the\ndestination. The ops of a reduction loop accumulate into the previous\nresult. This covers matmuls with a large weight, such as a tied LM head.\n* A value read with `tensor.extract` in the body of an elementwise\n`linalg.generic`, e.g., an embedding lookup: a chain of ops, one per\nshard. Each reads its shard at the rebased, clamped index and keeps the\nprevious op\u0027s element unless the index lies in its shard.\n\nA constant with any other use is left unchanged with a warning, as is\none that cannot be split: mutable or public globals, values that are\nneither inline dense constants nor named parameters, parameters whose\nlength does not match their type or whose offset is not an integer,\nelement types not stored at 8, 16, 32 or 64 bits, or a single index of\nthe split dimension that alone exceeds the limit.\n\nThe limit is the max allocation size from `ResourceConfigAttr::lookup`,\nso `--iree-stream-resource-max-allocation-size` unless the target sets\none. It defaults to INT64_MAX, so the pass changes nothing unless a\nlimit is set. The pass runs after transposes have been folded into their\nconsumers, so that an oversized constant is read by the op that indexes\nit, and before constant expressions are hoisted and evaluated into new\nglobals.\n\nCo-Authored-By: Claude Opus 5.5 \u003cnoreply@anthropic.com\u003e\nSigned-off-by: Stefan Schuermans \u003cschuermans@roofline.ai\u003e",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "70adc3ab3f00bd91e6809cb82164115ad0548720",
      "old_mode": 33188,
      "old_path": "compiler/src/iree/compiler/GlobalOptimization/BUILD.bazel",
      "new_id": "508af2e71829db90361f5d1434454cb9fdcecb62",
      "new_mode": 33188,
      "new_path": "compiler/src/iree/compiler/GlobalOptimization/BUILD.bazel"
    },
    {
      "type": "modify",
      "old_id": "9b9c4361daf7174d8e86dc4196d0440b5962b932",
      "old_mode": 33188,
      "old_path": "compiler/src/iree/compiler/GlobalOptimization/CMakeLists.txt",
      "new_id": "5b5afe64dd70589855ce346b9d7fdb62236d6c6a",
      "new_mode": 33188,
      "new_path": "compiler/src/iree/compiler/GlobalOptimization/CMakeLists.txt"
    },
    {
      "type": "modify",
      "old_id": "ba74a25c50f9006b6de6b7a3daee20b5ca55499d",
      "old_mode": 33188,
      "old_path": "compiler/src/iree/compiler/GlobalOptimization/Passes.cpp",
      "new_id": "0732ce9096a9d7869c4c0b52aa6190f39f83b0b6",
      "new_mode": 33188,
      "new_path": "compiler/src/iree/compiler/GlobalOptimization/Passes.cpp"
    },
    {
      "type": "modify",
      "old_id": "f6cec532da6fa33611719a0708560ee9610a7aff",
      "old_mode": 33188,
      "old_path": "compiler/src/iree/compiler/GlobalOptimization/Passes.td",
      "new_id": "5852e6c50a0aff599be6577881a5c328cb49792b",
      "new_mode": 33188,
      "new_path": "compiler/src/iree/compiler/GlobalOptimization/Passes.td"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "63db04eac23eb1f55bc99b59d7a1f0c6bcfbc1a6",
      "new_mode": 33188,
      "new_path": "compiler/src/iree/compiler/GlobalOptimization/SplitLargeConstants.cpp"
    },
    {
      "type": "modify",
      "old_id": "e35ecf1832bfdfc8692a9d2bc51adb67ed83bd32",
      "old_mode": 33188,
      "old_path": "compiler/src/iree/compiler/GlobalOptimization/test/BUILD.bazel",
      "new_id": "bf94fa822273cd17fedfa185b6894322ded65fb4",
      "new_mode": 33188,
      "new_path": "compiler/src/iree/compiler/GlobalOptimization/test/BUILD.bazel"
    },
    {
      "type": "modify",
      "old_id": "8977beb2f85f7062311364af3dc79eb74b8d90c4",
      "old_mode": 33188,
      "old_path": "compiler/src/iree/compiler/GlobalOptimization/test/CMakeLists.txt",
      "new_id": "7444e0d8ce987b0e556f7d5389b79d107a4dd9e9",
      "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": "c7c4d12f3589b1f8d4713197c1231c0256c649fa",
      "new_mode": 33188,
      "new_path": "compiler/src/iree/compiler/GlobalOptimization/test/split_large_constants.mlir"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "7d05e130af20a1ac9253fd1041e85656ee364fd0",
      "new_mode": 33188,
      "new_path": "compiler/src/iree/compiler/GlobalOptimization/test/split_large_constants_resource.mlir"
    }
  ]
}
