)]}'
{
  "commit": "abe91fa6361e6b471f611cb3620607ecfc23c854",
  "tree": "48a4d91c394c6ad289588922e0dc2a915974e14f",
  "parents": [
    "6eb7ce52c2674186e72432b4f4d3f10850a37802"
  ],
  "author": {
    "name": "Stella Laurenzo",
    "email": "stellaraccident@gmail.com",
    "time": "Mon Jun 26 16:57:30 2023 -0700"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Mon Jun 26 16:57:30 2023 -0700"
  },
  "message": "Port iree.runtime to nanobind. (#14214)\n\nI believe that this should be a no-op for users. There is one minor API\r\nchange (the MappedMemory class no longer implements the buffer protocol,\r\nbut I\u0027ve seen no evidence that this was actually used since it was a\r\nless functional way to get a host ndarray).\r\n\r\nMore adventurous use of nanobind is possible in the future (i.e. using\r\n`ndarray` and `dlpack` interop for sharing across frameworks), but using\r\nthat will most likely necessitate API changes, which I was working to\r\navoid.\r\n\r\nAside from relatively mechanical differences from pybind11, the main\r\nissues were that the buffer protocol and array support was dropped in\r\nnanobind. This required some direct coding against the C API to achieve\r\nthe same characteristics. I think this is actually an improvement as the\r\npybind11 implementations of these features was neither efficient nor\r\nobvious what it was doing.\r\n\r\nA build time dependency on `nanobind` is added. When building Python\r\nwheels, this gets satisfied automatically. Otherwise, the docker images\r\nhave been updated to pre-install the necessary Python package. In\r\naddition, there is now a build time dependency on NumPy headers, which\r\nshould already be installed (pybind11 vendored stripped down copies of\r\nthese headers in an effort to avoid this, but I opted to just do the\r\nnormal thing).\r\n\r\nNanobind\u0027s performance is [quite\r\ncompelling](https://nanobind.readthedocs.io/en/latest/benchmark.html)\r\nand owes to a combination of favoring more efficient binding styles that\r\nwould basically be a rewrite in pybind11 and exclusive use of the new\r\nPython 3.8+ vectorcall ABI. Since the runtime is performance critical\r\nand the cost of Python calls is already quite visibly adding overhead on\r\ntraces, it makes sense to baseline on the most efficient implementation.\r\nIn addition, the compile-time savings seem to be real and the build is\r\nnoticeably faster (this was not a primary consideration, just a nice\r\nbonus).",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "68e1f0f1d6504741c2806a34cd4cf3611fc19030",
      "old_mode": 33188,
      "old_path": "CMakeLists.txt",
      "new_id": "d65eb3b8a155246a83d9e796971a7b6ffb0b9067",
      "new_mode": 33188,
      "new_path": "CMakeLists.txt"
    },
    {
      "type": "modify",
      "old_id": "b5dcdd3832a59d94c76bcb3d8a46909f348d71a2",
      "old_mode": 33188,
      "old_path": "build_tools/cmake/iree_python.cmake",
      "new_id": "64862e32cf983e6d5dfba6409e414b911c5b54d4",
      "new_mode": 33188,
      "new_path": "build_tools/cmake/iree_python.cmake"
    },
    {
      "type": "modify",
      "old_id": "ecff85cdf10dae8e410147b21bfe1c6becbbb690",
      "old_mode": 33188,
      "old_path": "compiler/pyproject.toml",
      "new_id": "4f88241bb622fead69ac117a03db9690c1c41f77",
      "new_mode": 33188,
      "new_path": "compiler/pyproject.toml"
    },
    {
      "type": "modify",
      "old_id": "f0c3fd3dcae929cf6d2b41e6c7feb70cf86f12dd",
      "old_mode": 33188,
      "old_path": "runtime/bindings/python/CMakeLists.txt",
      "new_id": "8f4bac8699b2880a3be4996ca1a9d4413248bffa",
      "new_mode": 33188,
      "new_path": "runtime/bindings/python/CMakeLists.txt"
    },
    {
      "type": "modify",
      "old_id": "feb1722c0276fc32612b34314c7028460f0dceb7",
      "old_mode": 33188,
      "old_path": "runtime/bindings/python/binding.h",
      "new_id": "71168be0c80245c18d18a312f6616cabc3edc1c7",
      "new_mode": 33188,
      "new_path": "runtime/bindings/python/binding.h"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "20ee3527d51ac98b87df9e82b8db040698093a95",
      "new_mode": 33188,
      "new_path": "runtime/bindings/python/buffer_interop.h"
    },
    {
      "type": "modify",
      "old_id": "eb65c5bba43e6344072245ddc7c54c7be29ceab2",
      "old_mode": 33188,
      "old_path": "runtime/bindings/python/hal.cc",
      "new_id": "1da899f9ed16c7d63e5ec8d0b503415d9bf85684",
      "new_mode": 33188,
      "new_path": "runtime/bindings/python/hal.cc"
    },
    {
      "type": "modify",
      "old_id": "ff15dfa0d74d010f6dcb3cd3e8e1d09a77b9204e",
      "old_mode": 33188,
      "old_path": "runtime/bindings/python/hal.h",
      "new_id": "bae4d96dbf92127376c6e2a08e402776a2751e03",
      "new_mode": 33188,
      "new_path": "runtime/bindings/python/hal.h"
    },
    {
      "type": "modify",
      "old_id": "3e76943e46c600306c4ce8301ca698232fb496b6",
      "old_mode": 33188,
      "old_path": "runtime/bindings/python/initialize_module.cc",
      "new_id": "c3eac963ce9238dab51dcad92f947e6335cf9773",
      "new_mode": 33188,
      "new_path": "runtime/bindings/python/initialize_module.cc"
    },
    {
      "type": "modify",
      "old_id": "c3b5df15c2bbc840b4cb9c2453686ad022950e11",
      "old_mode": 33188,
      "old_path": "runtime/bindings/python/invoke.cc",
      "new_id": "cafa2adbb34143ebc0e582612540e2e3de503156",
      "new_mode": 33188,
      "new_path": "runtime/bindings/python/invoke.cc"
    },
    {
      "type": "modify",
      "old_id": "206524fac248de286b817c9e6a9d3b5f5b512b35",
      "old_mode": 33188,
      "old_path": "runtime/bindings/python/invoke.h",
      "new_id": "4bc2de044d84cac836e6ca170085041683c6c232",
      "new_mode": 33188,
      "new_path": "runtime/bindings/python/invoke.h"
    },
    {
      "type": "modify",
      "old_id": "bffc5fa9f6978fb7dfbbf5e16bc87e11fae7e2b5",
      "old_mode": 33188,
      "old_path": "runtime/bindings/python/iree/runtime/__init__.py",
      "new_id": "cb0bdd641edefafed67f9ea2a6f702dbf5ffd839",
      "new_mode": 33188,
      "new_path": "runtime/bindings/python/iree/runtime/__init__.py"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "85e51827dd9075358fd4fab07deb23715dfe13e8",
      "new_mode": 33188,
      "new_path": "runtime/bindings/python/numpy_interop.cc"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "3084e141dff716cd6200f206440d64c93ccea451",
      "new_mode": 33188,
      "new_path": "runtime/bindings/python/numpy_interop.h"
    },
    {
      "type": "modify",
      "old_id": "f3b8b3482759a849b3727c7f1cab9aa53450b193",
      "old_mode": 33188,
      "old_path": "runtime/bindings/python/py_module.cc",
      "new_id": "86eb1e159de992a14e7f6d305fcc9feedf2178d4",
      "new_mode": 33188,
      "new_path": "runtime/bindings/python/py_module.cc"
    },
    {
      "type": "modify",
      "old_id": "ee04d7ea9a520e5e9958c1d5c055ceb5ca9bdf2a",
      "old_mode": 33188,
      "old_path": "runtime/bindings/python/py_module.h",
      "new_id": "30b836cc1d5da6221a9fa1aa51aea015375f789b",
      "new_mode": 33188,
      "new_path": "runtime/bindings/python/py_module.h"
    },
    {
      "type": "modify",
      "old_id": "a97d0c6076820e88a821946ef37e41ff038e43c1",
      "old_mode": 33188,
      "old_path": "runtime/bindings/python/status_utils.cc",
      "new_id": "36941c2439e4c850bbb156dedc2fff8ac1ea63cb",
      "new_mode": 33188,
      "new_path": "runtime/bindings/python/status_utils.cc"
    },
    {
      "type": "modify",
      "old_id": "d87d30859d2e433e990d54b9c09b897087793c80",
      "old_mode": 33188,
      "old_path": "runtime/bindings/python/status_utils.h",
      "new_id": "612f335541a4e3696bdc0dbee5c26a04f1465abe",
      "new_mode": 33188,
      "new_path": "runtime/bindings/python/status_utils.h"
    },
    {
      "type": "modify",
      "old_id": "7a8e0ddd7fda94668edc52a08976869ac7bb103f",
      "old_mode": 33188,
      "old_path": "runtime/bindings/python/vm.cc",
      "new_id": "18c8e8dd5ade6d988b1c740c68359669ee4cc53f",
      "new_mode": 33188,
      "new_path": "runtime/bindings/python/vm.cc"
    },
    {
      "type": "modify",
      "old_id": "f52ef2af3a3580909a666f0755b481b119d05422",
      "old_mode": 33188,
      "old_path": "runtime/bindings/python/vm.h",
      "new_id": "ef5d8eae6576f19d572159d84716d5715643aedc",
      "new_mode": 33188,
      "new_path": "runtime/bindings/python/vm.h"
    },
    {
      "type": "modify",
      "old_id": "4ff00b65181994ae26f1a59fa5753b3a707c141f",
      "old_mode": 33188,
      "old_path": "runtime/pyproject.toml",
      "new_id": "244bbeb5b01475982c3b6c1065e48fc19654a488",
      "new_mode": 33188,
      "new_path": "runtime/pyproject.toml"
    }
  ]
}
