omnimalloc 0.3.0__tar.gz → 0.5.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (217) hide show
  1. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/.pre-commit-config.yaml +2 -0
  2. omnimalloc-0.5.0/CMakeLists.txt +81 -0
  3. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/PKG-INFO +70 -4
  4. omnimalloc-0.5.0/README.md +102 -0
  5. omnimalloc-0.5.0/assets/allocation_dark.svg +4453 -0
  6. omnimalloc-0.5.0/assets/allocation_light.svg +4453 -0
  7. omnimalloc-0.5.0/assets/hero_dark.svg +2779 -0
  8. omnimalloc-0.5.0/assets/hero_light.svg +2779 -0
  9. omnimalloc-0.5.0/assets/quality_dark.svg +2757 -0
  10. omnimalloc-0.5.0/assets/quality_light.svg +2757 -0
  11. omnimalloc-0.5.0/assets/scaling_dark.svg +2409 -0
  12. omnimalloc-0.5.0/assets/scaling_light.svg +2409 -0
  13. omnimalloc-0.5.0/examples/01_basic.py +26 -0
  14. omnimalloc-0.5.0/examples/02_plotting.py +29 -0
  15. omnimalloc-0.5.0/examples/03_allocators.py +51 -0
  16. omnimalloc-0.5.0/examples/04_sources.py +42 -0
  17. omnimalloc-0.5.0/examples/05_benchmark.py +57 -0
  18. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/pyproject.toml +12 -2
  19. omnimalloc-0.5.0/scripts/benchmark_allocation.py +362 -0
  20. omnimalloc-0.5.0/scripts/benchmark_pressure.py +499 -0
  21. omnimalloc-0.5.0/scripts/generate_readme_assets.py +692 -0
  22. omnimalloc-0.5.0/src/cpp/allocators/best_fit.cpp +56 -0
  23. omnimalloc-0.5.0/src/cpp/allocators/best_fit.hpp +35 -0
  24. omnimalloc-0.5.0/src/cpp/allocators/defaults.hpp +38 -0
  25. omnimalloc-0.5.0/src/cpp/allocators/first_fit.cpp +434 -0
  26. omnimalloc-0.5.0/src/cpp/allocators/first_fit.hpp +137 -0
  27. omnimalloc-0.5.0/src/cpp/allocators/greedy.cpp +27 -0
  28. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/src/cpp/allocators/greedy.hpp +0 -14
  29. omnimalloc-0.5.0/src/cpp/allocators/local_search.cpp +78 -0
  30. omnimalloc-0.5.0/src/cpp/allocators/local_search.hpp +46 -0
  31. omnimalloc-0.5.0/src/cpp/allocators/omni.cpp +57 -0
  32. omnimalloc-0.5.0/src/cpp/allocators/omni.hpp +35 -0
  33. omnimalloc-0.5.0/src/cpp/allocators/simulated_annealing.cpp +87 -0
  34. omnimalloc-0.5.0/src/cpp/allocators/simulated_annealing.hpp +48 -0
  35. omnimalloc-0.5.0/src/cpp/allocators/supermalloc/partition.cpp +1014 -0
  36. omnimalloc-0.5.0/src/cpp/allocators/supermalloc/partition.hpp +229 -0
  37. omnimalloc-0.5.0/src/cpp/allocators/tabu_search.cpp +121 -0
  38. omnimalloc-0.5.0/src/cpp/allocators/tabu_search.hpp +49 -0
  39. omnimalloc-0.5.0/src/cpp/allocators/telamalloc.cpp +333 -0
  40. omnimalloc-0.5.0/src/cpp/allocators/telamalloc.hpp +53 -0
  41. omnimalloc-0.5.0/src/cpp/bindings.cpp +284 -0
  42. omnimalloc-0.5.0/src/cpp/common/parallel.hpp +74 -0
  43. omnimalloc-0.5.0/src/cpp/primitives/allocation.cpp +186 -0
  44. omnimalloc-0.5.0/src/cpp/primitives/allocation.hpp +151 -0
  45. omnimalloc-0.5.0/src/cpp/primitives/antichain.cpp +315 -0
  46. omnimalloc-0.5.0/src/cpp/primitives/antichain.hpp +40 -0
  47. omnimalloc-0.5.0/src/cpp/primitives/clock_rows.hpp +362 -0
  48. omnimalloc-0.5.0/src/cpp/primitives/closure.cpp +184 -0
  49. omnimalloc-0.5.0/src/cpp/primitives/closure.hpp +37 -0
  50. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/src/cpp/primitives/id_type.hpp +0 -6
  51. omnimalloc-0.5.0/src/cpp/primitives/linearize.cpp +216 -0
  52. omnimalloc-0.5.0/src/cpp/primitives/linearize.hpp +42 -0
  53. omnimalloc-0.5.0/src/cpp/primitives/placement.cpp +175 -0
  54. omnimalloc-0.5.0/src/cpp/primitives/placement.hpp +24 -0
  55. omnimalloc-0.5.0/src/python/omnimalloc/__init__.py +35 -0
  56. omnimalloc-0.5.0/src/python/omnimalloc/_cpp.pyi +310 -0
  57. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/src/python/omnimalloc/allocate.py +1 -9
  58. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/src/python/omnimalloc/allocators/__init__.py +21 -1
  59. omnimalloc-0.5.0/src/python/omnimalloc/allocators/base.py +60 -0
  60. omnimalloc-0.5.0/src/python/omnimalloc/allocators/best_fit.py +23 -0
  61. omnimalloc-0.5.0/src/python/omnimalloc/allocators/genetic.py +175 -0
  62. omnimalloc-0.5.0/src/python/omnimalloc/allocators/greedy.py +89 -0
  63. omnimalloc-0.5.0/src/python/omnimalloc/allocators/greedy_base.py +114 -0
  64. omnimalloc-0.5.0/src/python/omnimalloc/allocators/greedy_cpp.py +87 -0
  65. omnimalloc-0.5.0/src/python/omnimalloc/allocators/hillclimb.py +165 -0
  66. omnimalloc-0.5.0/src/python/omnimalloc/allocators/minimalloc.py +77 -0
  67. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/src/python/omnimalloc/allocators/naive.py +5 -5
  68. omnimalloc-0.5.0/src/python/omnimalloc/allocators/omni.py +23 -0
  69. omnimalloc-0.5.0/src/python/omnimalloc/allocators/random.py +40 -0
  70. omnimalloc-0.5.0/src/python/omnimalloc/allocators/simulated_annealing.py +71 -0
  71. omnimalloc-0.5.0/src/python/omnimalloc/allocators/supermalloc.py +175 -0
  72. omnimalloc-0.5.0/src/python/omnimalloc/allocators/tabu_search.py +69 -0
  73. omnimalloc-0.5.0/src/python/omnimalloc/allocators/telamalloc.py +65 -0
  74. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/src/python/omnimalloc/allocators/utils.py +2 -3
  75. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/src/python/omnimalloc/benchmark/__init__.py +3 -1
  76. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/src/python/omnimalloc/benchmark/benchmark.py +55 -53
  77. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/src/python/omnimalloc/benchmark/converters/model.py +4 -2
  78. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/src/python/omnimalloc/benchmark/converters/onnx.py +14 -8
  79. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/src/python/omnimalloc/benchmark/results/campaign.py +1 -1
  80. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/src/python/omnimalloc/benchmark/results/export.py +2 -27
  81. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/src/python/omnimalloc/benchmark/results/report.py +0 -8
  82. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/src/python/omnimalloc/benchmark/results/utils.py +2 -0
  83. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/src/python/omnimalloc/benchmark/results/visualize.py +14 -6
  84. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/src/python/omnimalloc/benchmark/sources/__init__.py +6 -1
  85. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/src/python/omnimalloc/benchmark/sources/base.py +2 -2
  86. omnimalloc-0.5.0/src/python/omnimalloc/benchmark/sources/concurrent_tiling.py +115 -0
  87. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/src/python/omnimalloc/benchmark/sources/generator.py +2 -2
  88. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/src/python/omnimalloc/benchmark/sources/huggingface.py +9 -14
  89. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/src/python/omnimalloc/benchmark/sources/minimalloc.py +23 -28
  90. omnimalloc-0.5.0/src/python/omnimalloc/benchmark/sources/pinwheel.py +60 -0
  91. omnimalloc-0.5.0/src/python/omnimalloc/benchmark/sources/sync_patterns.py +183 -0
  92. omnimalloc-0.5.0/src/python/omnimalloc/benchmark/sources/tiling.py +71 -0
  93. omnimalloc-0.5.0/src/python/omnimalloc/benchmark/sources/tiling_base.py +128 -0
  94. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/src/python/omnimalloc/benchmark/sources/utils.py +2 -3
  95. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/src/python/omnimalloc/benchmark/timer.py +4 -4
  96. omnimalloc-0.5.0/src/python/omnimalloc/benchmark/utils.py +31 -0
  97. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/src/python/omnimalloc/common/registry.py +18 -1
  98. omnimalloc-0.5.0/src/python/omnimalloc/dump.py +87 -0
  99. omnimalloc-0.5.0/src/python/omnimalloc/primitives/__init__.py +23 -0
  100. omnimalloc-0.5.0/src/python/omnimalloc/primitives/allocation.py +21 -0
  101. omnimalloc-0.5.0/src/python/omnimalloc/primitives/linearize.py +24 -0
  102. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/src/python/omnimalloc/primitives/memory.py +1 -2
  103. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/src/python/omnimalloc/primitives/pool.py +19 -11
  104. omnimalloc-0.5.0/src/python/omnimalloc/primitives/pressure.py +126 -0
  105. omnimalloc-0.5.0/src/python/omnimalloc/primitives/utils.py +11 -0
  106. omnimalloc-0.5.0/src/python/omnimalloc/primitives/vector_clock.py +22 -0
  107. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/src/python/omnimalloc/validate.py +16 -1
  108. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/src/python/omnimalloc/visualize.py +105 -44
  109. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/tests/integration/test_allocators_on_sources.py +45 -0
  110. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/tests/integration/test_examples.py +2 -2
  111. omnimalloc-0.5.0/tests/integration/test_supermalloc.py +50 -0
  112. omnimalloc-0.5.0/tests/unit/allocators/test_best_fit.py +101 -0
  113. omnimalloc-0.5.0/tests/unit/allocators/test_genetic.py +116 -0
  114. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/tests/unit/allocators/test_greedy.py +255 -0
  115. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/tests/unit/allocators/test_greedy_cpp.py +116 -1
  116. omnimalloc-0.5.0/tests/unit/allocators/test_hillclimb.py +127 -0
  117. omnimalloc-0.5.0/tests/unit/allocators/test_minimalloc.py +74 -0
  118. omnimalloc-0.5.0/tests/unit/allocators/test_naive.py +49 -0
  119. omnimalloc-0.5.0/tests/unit/allocators/test_omni.py +174 -0
  120. omnimalloc-0.5.0/tests/unit/allocators/test_random.py +73 -0
  121. omnimalloc-0.5.0/tests/unit/allocators/test_simulated_annealing.py +124 -0
  122. omnimalloc-0.5.0/tests/unit/allocators/test_supermalloc.py +143 -0
  123. omnimalloc-0.5.0/tests/unit/allocators/test_tabu_search.py +117 -0
  124. omnimalloc-0.5.0/tests/unit/allocators/test_telamalloc.py +153 -0
  125. omnimalloc-0.5.0/tests/unit/allocators/test_vector_time.py +238 -0
  126. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/tests/unit/benchmark/converters/test_model.py +43 -0
  127. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/tests/unit/benchmark/converters/test_onnx.py +29 -2
  128. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/tests/unit/benchmark/results/test_campaign.py +2 -1
  129. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/tests/unit/benchmark/sources/test_base.py +12 -0
  130. omnimalloc-0.5.0/tests/unit/benchmark/sources/test_concurrent_tiling.py +147 -0
  131. omnimalloc-0.5.0/tests/unit/benchmark/sources/test_minimalloc.py +107 -0
  132. omnimalloc-0.5.0/tests/unit/benchmark/sources/test_pinwheel.py +123 -0
  133. omnimalloc-0.5.0/tests/unit/benchmark/sources/test_sync_patterns.py +119 -0
  134. omnimalloc-0.5.0/tests/unit/benchmark/sources/test_tiling.py +133 -0
  135. omnimalloc-0.5.0/tests/unit/benchmark/test_benchmark.py +144 -0
  136. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/tests/unit/benchmark/test_timer.py +11 -4
  137. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/tests/unit/common/test_registry.py +32 -0
  138. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/tests/unit/primitives/test_allocation.py +25 -0
  139. omnimalloc-0.5.0/tests/unit/primitives/test_allocation_vector.py +138 -0
  140. omnimalloc-0.5.0/tests/unit/primitives/test_bufferkind.py +37 -0
  141. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/tests/unit/primitives/test_pool.py +26 -0
  142. omnimalloc-0.5.0/tests/unit/primitives/test_pressure.py +402 -0
  143. omnimalloc-0.5.0/tests/unit/primitives/test_utils.py +24 -0
  144. omnimalloc-0.5.0/tests/unit/test_dump.py +143 -0
  145. omnimalloc-0.5.0/tests/unit/test_linearize.py +178 -0
  146. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/tests/unit/test_validate.py +39 -0
  147. omnimalloc-0.5.0/tests/unit/test_vector_conflict_properties.py +213 -0
  148. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/tests/unit/test_visualize.py +110 -1
  149. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/uv.lock +0 -1
  150. omnimalloc-0.3.0/CMakeLists.txt +0 -47
  151. omnimalloc-0.3.0/README.md +0 -36
  152. omnimalloc-0.3.0/examples/01_basic.py +0 -20
  153. omnimalloc-0.3.0/examples/02_plotting.py +0 -23
  154. omnimalloc-0.3.0/examples/03_allocators.py +0 -39
  155. omnimalloc-0.3.0/examples/04_sources.py +0 -36
  156. omnimalloc-0.3.0/examples/05_benchmark.py +0 -41
  157. omnimalloc-0.3.0/src/cpp/allocators/greedy.cpp +0 -105
  158. omnimalloc-0.3.0/src/cpp/bindings.cpp +0 -92
  159. omnimalloc-0.3.0/src/cpp/primitives/allocation.cpp +0 -95
  160. omnimalloc-0.3.0/src/cpp/primitives/allocation.hpp +0 -75
  161. omnimalloc-0.3.0/src/python/omnimalloc/__init__.py +0 -19
  162. omnimalloc-0.3.0/src/python/omnimalloc/_cpp.pyi +0 -85
  163. omnimalloc-0.3.0/src/python/omnimalloc/allocators/base.py +0 -26
  164. omnimalloc-0.3.0/src/python/omnimalloc/allocators/genetic.py +0 -187
  165. omnimalloc-0.3.0/src/python/omnimalloc/allocators/greedy.py +0 -82
  166. omnimalloc-0.3.0/src/python/omnimalloc/allocators/greedy_cpp.py +0 -65
  167. omnimalloc-0.3.0/src/python/omnimalloc/allocators/hillclimb.py +0 -215
  168. omnimalloc-0.3.0/src/python/omnimalloc/allocators/minimalloc.py +0 -109
  169. omnimalloc-0.3.0/src/python/omnimalloc/allocators/random.py +0 -52
  170. omnimalloc-0.3.0/src/python/omnimalloc/benchmark/utils.py +0 -3
  171. omnimalloc-0.3.0/src/python/omnimalloc/primitives/__init__.py +0 -10
  172. omnimalloc-0.3.0/src/python/omnimalloc/primitives/allocation.py +0 -11
  173. omnimalloc-0.3.0/src/python/omnimalloc/primitives/utils.py +0 -39
  174. omnimalloc-0.3.0/tests/unit/allocators/test_naive.py +0 -3
  175. omnimalloc-0.3.0/tests/unit/benchmark/sources/test_minimalloc.py +0 -121
  176. omnimalloc-0.3.0/tests/unit/benchmark/test_benchmark.py +0 -76
  177. omnimalloc-0.3.0/tests/unit/primitives/test_bufferkind.py +0 -199
  178. omnimalloc-0.3.0/tests/unit/primitives/test_utils.py +0 -50
  179. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/.clang-format +0 -0
  180. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/.clang-tidy +0 -0
  181. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/.gitignore +0 -0
  182. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/.python-version +0 -0
  183. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/LICENSE +0 -0
  184. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/examples/README.md +0 -0
  185. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/src/cpp/primitives/buffer_kind.hpp +0 -0
  186. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/src/cpp/primitives/hash_utils.hpp +0 -0
  187. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/src/python/omnimalloc/benchmark/converters/__init__.py +0 -0
  188. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/src/python/omnimalloc/benchmark/results/__init__.py +0 -0
  189. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/src/python/omnimalloc/benchmark/results/result.py +0 -0
  190. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/src/python/omnimalloc/common/__init__.py +0 -0
  191. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/src/python/omnimalloc/common/directories.py +0 -0
  192. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/src/python/omnimalloc/common/optional.py +0 -0
  193. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/src/python/omnimalloc/common/units.py +0 -0
  194. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/src/python/omnimalloc/primitives/system.py +0 -0
  195. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/src/python/omnimalloc/py.typed +0 -0
  196. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/tests/__init__.py +0 -0
  197. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/tests/conftest.py +0 -0
  198. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/tests/integration/__init__.py +0 -0
  199. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/tests/integration/test_notebooks.py +0 -0
  200. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/tests/unit/__init__.py +0 -0
  201. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/tests/unit/allocators/__init__.py +0 -0
  202. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/tests/unit/benchmark/__init__.py +0 -0
  203. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/tests/unit/benchmark/converters/__init__.py +0 -0
  204. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/tests/unit/benchmark/results/__init__.py +0 -0
  205. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/tests/unit/benchmark/results/test_export.py +0 -0
  206. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/tests/unit/benchmark/results/test_report.py +0 -0
  207. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/tests/unit/benchmark/results/test_result.py +0 -0
  208. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/tests/unit/benchmark/results/test_visualize.py +0 -0
  209. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/tests/unit/benchmark/sources/__init__.py +0 -0
  210. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/tests/unit/benchmark/sources/test_generator.py +0 -0
  211. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/tests/unit/benchmark/sources/test_huggingface.py +0 -0
  212. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/tests/unit/common/__init__.py +0 -0
  213. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/tests/unit/common/test_directories.py +0 -0
  214. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/tests/unit/primitives/__init__.py +0 -0
  215. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/tests/unit/primitives/test_memory.py +0 -0
  216. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/tests/unit/primitives/test_system.py +0 -0
  217. {omnimalloc-0.3.0 → omnimalloc-0.5.0}/tests/unit/test_allocate.py +0 -0
@@ -6,6 +6,8 @@ repos:
6
6
  rev: v6.0.0
7
7
  hooks:
8
8
  - id: trailing-whitespace
9
+ # matplotlib-generated README figures contain trailing whitespace
10
+ exclude: '^assets/.*\.svg$'
9
11
  - id: end-of-file-fixer
10
12
  - id: mixed-line-ending
11
13
  - id: check-yaml
@@ -0,0 +1,81 @@
1
+ cmake_minimum_required(VERSION 3.18...3.30)
2
+
3
+ # Version is sourced from setuptools-scm via scikit-build-core (git tags). This
4
+ # fallback only applies for standalone CMake calls, not using the build backend.
5
+ if(NOT DEFINED SKBUILD_PROJECT_VERSION)
6
+ set(SKBUILD_PROJECT_VERSION "0.0.0")
7
+ endif()
8
+
9
+ project(
10
+ OmniMalloc
11
+ VERSION ${SKBUILD_PROJECT_VERSION}
12
+ LANGUAGES CXX)
13
+
14
+ set(CMAKE_CXX_STANDARD 20)
15
+ set(CMAKE_CXX_STANDARD_REQUIRED ON)
16
+ set(CMAKE_CXX_EXTENSIONS OFF)
17
+
18
+ option(ENABLE_CLANG_TIDY "Run clang-tidy with the compiler" OFF)
19
+ if(ENABLE_CLANG_TIDY)
20
+ find_program(CLANG_TIDY_PROGRAM NAMES clang-tidy REQUIRED)
21
+ endif()
22
+
23
+ option(ENABLE_IWYU "Run include-what-you-use with the compiler" OFF)
24
+ if(ENABLE_IWYU)
25
+ find_program(IWYU_PROGRAM NAMES include-what-you-use iwyu REQUIRED)
26
+ endif()
27
+
28
+ find_package(Python 3.10 REQUIRED COMPONENTS Interpreter Development.Module)
29
+
30
+ set(THREADS_PREFER_PTHREAD_FLAG ON)
31
+ find_package(Threads REQUIRED)
32
+
33
+ execute_process(
34
+ COMMAND "${Python_EXECUTABLE}" -m nanobind --cmake_dir
35
+ OUTPUT_STRIP_TRAILING_WHITESPACE
36
+ OUTPUT_VARIABLE nanobind_ROOT)
37
+ find_package(nanobind CONFIG REQUIRED)
38
+
39
+ nanobind_add_module(
40
+ _cpp
41
+ NB_STATIC
42
+ NOMINSIZE
43
+ src/cpp/allocators/best_fit.cpp
44
+ src/cpp/allocators/first_fit.cpp
45
+ src/cpp/allocators/greedy.cpp
46
+ src/cpp/allocators/local_search.cpp
47
+ src/cpp/allocators/omni.cpp
48
+ src/cpp/allocators/simulated_annealing.cpp
49
+ src/cpp/allocators/supermalloc/partition.cpp
50
+ src/cpp/allocators/tabu_search.cpp
51
+ src/cpp/allocators/telamalloc.cpp
52
+ src/cpp/primitives/allocation.cpp
53
+ src/cpp/primitives/antichain.cpp
54
+ src/cpp/primitives/closure.cpp
55
+ src/cpp/primitives/linearize.cpp
56
+ src/cpp/primitives/placement.cpp
57
+ src/cpp/bindings.cpp)
58
+
59
+ target_include_directories(_cpp PRIVATE src/cpp)
60
+ target_link_libraries(_cpp PRIVATE Threads::Threads)
61
+
62
+ if(ENABLE_CLANG_TIDY)
63
+ set_target_properties(_cpp PROPERTIES CXX_CLANG_TIDY "${CLANG_TIDY_PROGRAM}")
64
+ endif()
65
+ if(ENABLE_IWYU)
66
+ set_target_properties(_cpp PROPERTIES CXX_INCLUDE_WHAT_YOU_USE
67
+ "${IWYU_PROGRAM}")
68
+ endif()
69
+
70
+ nanobind_add_stub(
71
+ _cpp_stub
72
+ MODULE
73
+ _cpp
74
+ OUTPUT
75
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/python/omnimalloc/_cpp.pyi
76
+ PYTHON_PATH
77
+ $<TARGET_FILE_DIR:_cpp>
78
+ DEPENDS
79
+ _cpp)
80
+
81
+ install(TARGETS _cpp LIBRARY DESTINATION omnimalloc)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: omnimalloc
3
- Version: 0.3.0
3
+ Version: 0.5.0
4
4
  Summary: Your one-stop shop for static memory allocation.
5
5
  Keywords: memory,allocation,allocator,static-allocation
6
6
  Author-Email: Fabian Peddinghaus <fabianpedd@gmail.com>
@@ -234,19 +234,85 @@ Requires-Dist: onnx>=1.19.0; extra == "all"
234
234
  Requires-Dist: tqdm>=4.66.0; extra == "all"
235
235
  Description-Content-Type: text/markdown
236
236
 
237
- # OmniMalloc
237
+ <h1 align="center">OmniMalloc</h1>
238
238
 
239
- Your one-stop shop for static memory allocation.
239
+ <p align="center">State-of-the-art static memory allocation for neural networks.</p>
240
+
241
+ <p align="center">
242
+ <a href="https://github.com/fpedd/omnimalloc/actions/workflows/checks.yml"><img src="https://img.shields.io/github/actions/workflow/status/fpedd/omnimalloc/checks.yml?branch=main&label=checks" alt="Checks"></a>
243
+ <a href="https://github.com/fpedd/omnimalloc/actions/workflows/build.yml"><img src="https://img.shields.io/github/actions/workflow/status/fpedd/omnimalloc/build.yml?branch=main&label=build" alt="Build"></a>
244
+ <a href="https://pypi.org/project/omnimalloc/"><img src="https://img.shields.io/pypi/v/omnimalloc" alt="PyPI"></a>
245
+ <a href="https://pypi.org/project/omnimalloc/"><img src="https://img.shields.io/pypi/pyversions/omnimalloc" alt="Python versions"></a>
246
+ <a href="https://github.com/fpedd/omnimalloc/blob/main/LICENSE"><img src="https://img.shields.io/pypi/l/omnimalloc" alt="License"></a>
247
+ </p>
248
+
249
+ OmniMalloc is a Python library for static memory allocation: given buffers
250
+ with known sizes and lifetimes, assign offsets so that peak memory is minimized.
251
+ This is the memory-planning step at the heart of ML compilers, embedded
252
+ runtimes, and accelerator toolchains.
253
+
254
+ It ships a collection of allocators and allocation algorithms behind one API,
255
+ implemented with an efficient C++ backend. This includes SuperMalloc, a new
256
+ allocator that outperforms the best open-source alternatives (see benchmarks
257
+ below). OmniMalloc also provides a rich benchmark harness and visualization
258
+ tools to develop and evaluate new allocation strategies.
240
259
 
241
260
  ## Installation
242
261
 
262
+ Install the latest release from PyPI:
263
+
243
264
  ```bash
244
265
  pip install omnimalloc
245
266
  ```
246
267
 
268
+ Or install the development version directly from GitHub:
269
+
270
+ ```bash
271
+ pip install git+https://github.com/fpedd/omnimalloc.git
272
+ ```
273
+
247
274
  ## Usage
248
275
 
249
- Please refer to [examples](examples/), in particular [examples/01_basic.py](examples/01_basic.py).
276
+ ```python
277
+ from omnimalloc import Allocation, Pool, run_allocation
278
+
279
+ pool = Pool(id="pool", allocations=(
280
+ Allocation(id=0, size=64, start=0, end=10),
281
+ Allocation(id=1, size=64, start=12, end=20),
282
+ Allocation(id=2, size=32, start=5, end=15),
283
+ ))
284
+
285
+ pool = run_allocation(pool, allocator="supermalloc_allocator", validate=True)
286
+
287
+ print(pool.size) # 96
288
+ print([alloc.offset for alloc in pool.allocations]) # [0, 0, 64]
289
+ ```
290
+
291
+ On a real problem, the result looks like this: 308 buffers of an ML workload
292
+ packed with no wasted memory.
293
+
294
+ <p align="center">
295
+ <picture>
296
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/fpedd/omnimalloc/main/assets/allocation_dark.svg">
297
+ <img src="https://raw.githubusercontent.com/fpedd/omnimalloc/main/assets/allocation_light.svg" alt="A solved allocation problem rendered as offset/time rectangles">
298
+ </picture>
299
+ </p>
300
+
301
+ See [examples](examples/) for allocator selection, visualization, custom
302
+ allocation sources, and benchmarking.
303
+
304
+ ## Benchmarks
305
+
306
+ <p align="center">
307
+ <picture>
308
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/fpedd/omnimalloc/main/assets/hero_dark.svg">
309
+ <img src="https://raw.githubusercontent.com/fpedd/omnimalloc/main/assets/hero_light.svg" alt="Solution quality vs. solve time across allocators">
310
+ </picture>
311
+ </p>
312
+
313
+ All figures on this page are generated from a deterministic benchmark run by
314
+ [`scripts/generate_readme_assets.py`](scripts/generate_readme_assets.py).
315
+ Run your own campaigns with the [benchmark harness](examples/05_benchmark.py).
250
316
 
251
317
  ## Development
252
318
 
@@ -0,0 +1,102 @@
1
+ <h1 align="center">OmniMalloc</h1>
2
+
3
+ <p align="center">State-of-the-art static memory allocation for neural networks.</p>
4
+
5
+ <p align="center">
6
+ <a href="https://github.com/fpedd/omnimalloc/actions/workflows/checks.yml"><img src="https://img.shields.io/github/actions/workflow/status/fpedd/omnimalloc/checks.yml?branch=main&label=checks" alt="Checks"></a>
7
+ <a href="https://github.com/fpedd/omnimalloc/actions/workflows/build.yml"><img src="https://img.shields.io/github/actions/workflow/status/fpedd/omnimalloc/build.yml?branch=main&label=build" alt="Build"></a>
8
+ <a href="https://pypi.org/project/omnimalloc/"><img src="https://img.shields.io/pypi/v/omnimalloc" alt="PyPI"></a>
9
+ <a href="https://pypi.org/project/omnimalloc/"><img src="https://img.shields.io/pypi/pyversions/omnimalloc" alt="Python versions"></a>
10
+ <a href="https://github.com/fpedd/omnimalloc/blob/main/LICENSE"><img src="https://img.shields.io/pypi/l/omnimalloc" alt="License"></a>
11
+ </p>
12
+
13
+ OmniMalloc is a Python library for static memory allocation: given buffers
14
+ with known sizes and lifetimes, assign offsets so that peak memory is minimized.
15
+ This is the memory-planning step at the heart of ML compilers, embedded
16
+ runtimes, and accelerator toolchains.
17
+
18
+ It ships a collection of allocators and allocation algorithms behind one API,
19
+ implemented with an efficient C++ backend. This includes SuperMalloc, a new
20
+ allocator that outperforms the best open-source alternatives (see benchmarks
21
+ below). OmniMalloc also provides a rich benchmark harness and visualization
22
+ tools to develop and evaluate new allocation strategies.
23
+
24
+ ## Installation
25
+
26
+ Install the latest release from PyPI:
27
+
28
+ ```bash
29
+ pip install omnimalloc
30
+ ```
31
+
32
+ Or install the development version directly from GitHub:
33
+
34
+ ```bash
35
+ pip install git+https://github.com/fpedd/omnimalloc.git
36
+ ```
37
+
38
+ ## Usage
39
+
40
+ ```python
41
+ from omnimalloc import Allocation, Pool, run_allocation
42
+
43
+ pool = Pool(id="pool", allocations=(
44
+ Allocation(id=0, size=64, start=0, end=10),
45
+ Allocation(id=1, size=64, start=12, end=20),
46
+ Allocation(id=2, size=32, start=5, end=15),
47
+ ))
48
+
49
+ pool = run_allocation(pool, allocator="supermalloc_allocator", validate=True)
50
+
51
+ print(pool.size) # 96
52
+ print([alloc.offset for alloc in pool.allocations]) # [0, 0, 64]
53
+ ```
54
+
55
+ On a real problem, the result looks like this: 308 buffers of an ML workload
56
+ packed with no wasted memory.
57
+
58
+ <p align="center">
59
+ <picture>
60
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/fpedd/omnimalloc/main/assets/allocation_dark.svg">
61
+ <img src="https://raw.githubusercontent.com/fpedd/omnimalloc/main/assets/allocation_light.svg" alt="A solved allocation problem rendered as offset/time rectangles">
62
+ </picture>
63
+ </p>
64
+
65
+ See [examples](examples/) for allocator selection, visualization, custom
66
+ allocation sources, and benchmarking.
67
+
68
+ ## Benchmarks
69
+
70
+ <p align="center">
71
+ <picture>
72
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/fpedd/omnimalloc/main/assets/hero_dark.svg">
73
+ <img src="https://raw.githubusercontent.com/fpedd/omnimalloc/main/assets/hero_light.svg" alt="Solution quality vs. solve time across allocators">
74
+ </picture>
75
+ </p>
76
+
77
+ All figures on this page are generated from a deterministic benchmark run by
78
+ [`scripts/generate_readme_assets.py`](scripts/generate_readme_assets.py).
79
+ Run your own campaigns with the [benchmark harness](examples/05_benchmark.py).
80
+
81
+ ## Development
82
+
83
+ ```bash
84
+ # Initial setup
85
+ git clone git@github.com:fpedd/omnimalloc.git
86
+ cd omnimalloc
87
+ uv sync --all-extras --group dev
88
+
89
+ # Run tests, linting, type checking
90
+ uv run pytest
91
+ uv run ruff check --fix && uv run ruff format && uv run ty check
92
+
93
+ # Setup pre-commit hooks (run once)
94
+ uv run pre-commit install
95
+
96
+ # Run pre-commit checks manually
97
+ uv run pre-commit run --all-files
98
+ ```
99
+
100
+ ## License
101
+
102
+ Copyright 2025 Fabian Peddinghaus. Licensed under Apache 2.0 License. See [LICENSE](LICENSE) for details.