nbxtensor 0.0.1__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 (319) hide show
  1. nbxtensor-0.0.1/CHANGELOG.md +119 -0
  2. nbxtensor-0.0.1/LICENSE +189 -0
  3. nbxtensor-0.0.1/PKG-INFO +379 -0
  4. nbxtensor-0.0.1/README.md +359 -0
  5. nbxtensor-0.0.1/THIRD_PARTY_NOTICES.md +287 -0
  6. nbxtensor-0.0.1/pyproject.toml +35 -0
  7. nbxtensor-0.0.1/src/nbxtensor/__init__.py +17 -0
  8. nbxtensor-0.0.1/src/nbxtensor/backend/__init__.py +1 -0
  9. nbxtensor-0.0.1/src/nbxtensor/backend/capabilities.py +207 -0
  10. nbxtensor-0.0.1/src/nbxtensor/backend/cpu/__init__.py +1 -0
  11. nbxtensor-0.0.1/src/nbxtensor/backend/cpu/blas.py +102 -0
  12. nbxtensor-0.0.1/src/nbxtensor/backend/cpu/pool.py +204 -0
  13. nbxtensor-0.0.1/src/nbxtensor/backend/cpu_backend.py +162 -0
  14. nbxtensor-0.0.1/src/nbxtensor/backend/device_facts.py +105 -0
  15. nbxtensor-0.0.1/src/nbxtensor/backend/device_files.py +129 -0
  16. nbxtensor-0.0.1/src/nbxtensor/backend/device_names.py +18 -0
  17. nbxtensor-0.0.1/src/nbxtensor/backend/devices/amd/cdna.yml +228 -0
  18. nbxtensor-0.0.1/src/nbxtensor/backend/devices/amd/cdna2.yml +228 -0
  19. nbxtensor-0.0.1/src/nbxtensor/backend/devices/amd/cdna3.yml +227 -0
  20. nbxtensor-0.0.1/src/nbxtensor/backend/devices/apple/apple_m1.yml +266 -0
  21. nbxtensor-0.0.1/src/nbxtensor/backend/devices/apple/apple_m1_max.yml +266 -0
  22. nbxtensor-0.0.1/src/nbxtensor/backend/devices/apple/apple_m1_pro.yml +266 -0
  23. nbxtensor-0.0.1/src/nbxtensor/backend/devices/apple/apple_m1_ultra.yml +266 -0
  24. nbxtensor-0.0.1/src/nbxtensor/backend/devices/apple/apple_m2.yml +266 -0
  25. nbxtensor-0.0.1/src/nbxtensor/backend/devices/apple/apple_m2_max.yml +266 -0
  26. nbxtensor-0.0.1/src/nbxtensor/backend/devices/apple/apple_m2_pro.yml +266 -0
  27. nbxtensor-0.0.1/src/nbxtensor/backend/devices/apple/apple_m2_ultra.yml +266 -0
  28. nbxtensor-0.0.1/src/nbxtensor/backend/devices/apple/apple_m3.yml +266 -0
  29. nbxtensor-0.0.1/src/nbxtensor/backend/devices/apple/apple_m3_max.yml +266 -0
  30. nbxtensor-0.0.1/src/nbxtensor/backend/devices/apple/apple_m3_pro.yml +266 -0
  31. nbxtensor-0.0.1/src/nbxtensor/backend/devices/apple/apple_m3_ultra.yml +266 -0
  32. nbxtensor-0.0.1/src/nbxtensor/backend/devices/apple/apple_m4.yml +266 -0
  33. nbxtensor-0.0.1/src/nbxtensor/backend/devices/apple/apple_m4_max.yml +266 -0
  34. nbxtensor-0.0.1/src/nbxtensor/backend/devices/apple/apple_m4_pro.yml +308 -0
  35. nbxtensor-0.0.1/src/nbxtensor/backend/devices/apple/apple_m5.yml +269 -0
  36. nbxtensor-0.0.1/src/nbxtensor/backend/devices/apple/apple_m5_max.yml +269 -0
  37. nbxtensor-0.0.1/src/nbxtensor/backend/devices/apple/apple_m5_pro.yml +269 -0
  38. nbxtensor-0.0.1/src/nbxtensor/backend/devices/apple/apple_m5_ultra.yml +269 -0
  39. nbxtensor-0.0.1/src/nbxtensor/backend/devices/apple/apple_m6.yml +269 -0
  40. nbxtensor-0.0.1/src/nbxtensor/backend/devices/apple/apple_silicon.yml +263 -0
  41. nbxtensor-0.0.1/src/nbxtensor/backend/devices/nvidia/ampere.yml +214 -0
  42. nbxtensor-0.0.1/src/nbxtensor/backend/devices/nvidia/hopper.yml +213 -0
  43. nbxtensor-0.0.1/src/nbxtensor/backend/devices/nvidia/volta.yml +411 -0
  44. nbxtensor-0.0.1/src/nbxtensor/backend/faults.py +151 -0
  45. nbxtensor-0.0.1/src/nbxtensor/backend/host_memory.py +185 -0
  46. nbxtensor-0.0.1/src/nbxtensor/backend/launcher.py +2350 -0
  47. nbxtensor-0.0.1/src/nbxtensor/backend/launcher_contract.py +429 -0
  48. nbxtensor-0.0.1/src/nbxtensor/backend/metal_backend.py +661 -0
  49. nbxtensor-0.0.1/src/nbxtensor/backend/metal_device.py +1274 -0
  50. nbxtensor-0.0.1/src/nbxtensor/backend/process_memory.py +73 -0
  51. nbxtensor-0.0.1/src/nbxtensor/backend/replay_graph.py +322 -0
  52. nbxtensor-0.0.1/src/nbxtensor/backend/runtime.py +409 -0
  53. nbxtensor-0.0.1/src/nbxtensor/backend/triton_ext_driver.py +735 -0
  54. nbxtensor-0.0.1/src/nbxtensor/dtype/__init__.py +1 -0
  55. nbxtensor-0.0.1/src/nbxtensor/dtype/convert.py +107 -0
  56. nbxtensor-0.0.1/src/nbxtensor/dtype/dtypes.yml +70 -0
  57. nbxtensor-0.0.1/src/nbxtensor/dtype/itemsize.py +166 -0
  58. nbxtensor-0.0.1/src/nbxtensor/dtype/nbx_dtype.py +72 -0
  59. nbxtensor-0.0.1/src/nbxtensor/dtype/operands.py +158 -0
  60. nbxtensor-0.0.1/src/nbxtensor/dtype/outputs.py +64 -0
  61. nbxtensor-0.0.1/src/nbxtensor/dtype/policy.py +155 -0
  62. nbxtensor-0.0.1/src/nbxtensor/dtype/policy.yml +51 -0
  63. nbxtensor-0.0.1/src/nbxtensor/dtype/promotion.py +112 -0
  64. nbxtensor-0.0.1/src/nbxtensor/host.py +55 -0
  65. nbxtensor-0.0.1/src/nbxtensor/io/__init__.py +1 -0
  66. nbxtensor-0.0.1/src/nbxtensor/io/read_rate.py +197 -0
  67. nbxtensor-0.0.1/src/nbxtensor/io/safetensors.py +314 -0
  68. nbxtensor-0.0.1/src/nbxtensor/memory/__init__.py +9 -0
  69. nbxtensor-0.0.1/src/nbxtensor/memory/allocator.py +1988 -0
  70. nbxtensor-0.0.1/src/nbxtensor/memory/arena.py +75 -0
  71. nbxtensor-0.0.1/src/nbxtensor/memory/device_memory.py +150 -0
  72. nbxtensor-0.0.1/src/nbxtensor/memory/device_transfer.py +154 -0
  73. nbxtensor-0.0.1/src/nbxtensor/memory/layout.py +43 -0
  74. nbxtensor-0.0.1/src/nbxtensor/memory/memory_pool.py +191 -0
  75. nbxtensor-0.0.1/src/nbxtensor/memory/metal.py +96 -0
  76. nbxtensor-0.0.1/src/nbxtensor/memory/oom_advice.py +91 -0
  77. nbxtensor-0.0.1/src/nbxtensor/memory/pointer_tables.py +323 -0
  78. nbxtensor-0.0.1/src/nbxtensor/memory/pool.py +507 -0
  79. nbxtensor-0.0.1/src/nbxtensor/memory/shadow.py +43 -0
  80. nbxtensor-0.0.1/src/nbxtensor/memory/slab.py +273 -0
  81. nbxtensor-0.0.1/src/nbxtensor/memory/trace_replay.py +122 -0
  82. nbxtensor-0.0.1/src/nbxtensor/memory/traces/sana-video-2b-720p.16g.2026-11-02.tsv +13610 -0
  83. nbxtensor-0.0.1/src/nbxtensor/memory/vmm.py +118 -0
  84. nbxtensor-0.0.1/src/nbxtensor/ops/__init__.py +1 -0
  85. nbxtensor-0.0.1/src/nbxtensor/ops/_autotune_policy.py +90 -0
  86. nbxtensor-0.0.1/src/nbxtensor/ops/_common.py +32 -0
  87. nbxtensor-0.0.1/src/nbxtensor/ops/_configs.py +1041 -0
  88. nbxtensor-0.0.1/src/nbxtensor/ops/_cost.py +231 -0
  89. nbxtensor-0.0.1/src/nbxtensor/ops/abs.py +17 -0
  90. nbxtensor-0.0.1/src/nbxtensor/ops/adaptive_avg_pool2d.py +161 -0
  91. nbxtensor-0.0.1/src/nbxtensor/ops/add.py +96 -0
  92. nbxtensor-0.0.1/src/nbxtensor/ops/addcdiv.py +29 -0
  93. nbxtensor-0.0.1/src/nbxtensor/ops/addcmul.py +29 -0
  94. nbxtensor-0.0.1/src/nbxtensor/ops/addmv_op.py +64 -0
  95. nbxtensor-0.0.1/src/nbxtensor/ops/addr.py +68 -0
  96. nbxtensor-0.0.1/src/nbxtensor/ops/all_reduce.py +83 -0
  97. nbxtensor-0.0.1/src/nbxtensor/ops/amax.py +40 -0
  98. nbxtensor-0.0.1/src/nbxtensor/ops/any_reduce.py +83 -0
  99. nbxtensor-0.0.1/src/nbxtensor/ops/arange_op.py +27 -0
  100. nbxtensor-0.0.1/src/nbxtensor/ops/argmax.py +107 -0
  101. nbxtensor-0.0.1/src/nbxtensor/ops/argmin.py +93 -0
  102. nbxtensor-0.0.1/src/nbxtensor/ops/atan2.py +71 -0
  103. nbxtensor-0.0.1/src/nbxtensor/ops/attention_wrappers.py +1648 -0
  104. nbxtensor-0.0.1/src/nbxtensor/ops/autotune_bucket.py +137 -0
  105. nbxtensor-0.0.1/src/nbxtensor/ops/autotune_cache.py +430 -0
  106. nbxtensor-0.0.1/src/nbxtensor/ops/autotune_certified.py +1262 -0
  107. nbxtensor-0.0.1/src/nbxtensor/ops/autotune_refusals.py +380 -0
  108. nbxtensor-0.0.1/src/nbxtensor/ops/autotune_settings.py +58 -0
  109. nbxtensor-0.0.1/src/nbxtensor/ops/avg_pool2d.py +73 -0
  110. nbxtensor-0.0.1/src/nbxtensor/ops/baddbmm_op.py +132 -0
  111. nbxtensor-0.0.1/src/nbxtensor/ops/batch_norm.py +163 -0
  112. nbxtensor-0.0.1/src/nbxtensor/ops/binary_strided.py +196 -0
  113. nbxtensor-0.0.1/src/nbxtensor/ops/bitwise_and.py +26 -0
  114. nbxtensor-0.0.1/src/nbxtensor/ops/bitwise_left_shift.py +47 -0
  115. nbxtensor-0.0.1/src/nbxtensor/ops/bitwise_not.py +24 -0
  116. nbxtensor-0.0.1/src/nbxtensor/ops/bitwise_or.py +26 -0
  117. nbxtensor-0.0.1/src/nbxtensor/ops/bitwise_right_shift.py +47 -0
  118. nbxtensor-0.0.1/src/nbxtensor/ops/bucketize.py +37 -0
  119. nbxtensor-0.0.1/src/nbxtensor/ops/cat_op.py +87 -0
  120. nbxtensor-0.0.1/src/nbxtensor/ops/celu.py +20 -0
  121. nbxtensor-0.0.1/src/nbxtensor/ops/clamp.py +24 -0
  122. nbxtensor-0.0.1/src/nbxtensor/ops/clamp_min.py +22 -0
  123. nbxtensor-0.0.1/src/nbxtensor/ops/conv2d.py +265 -0
  124. nbxtensor-0.0.1/src/nbxtensor/ops/conv2d_m8n8k4.py +165 -0
  125. nbxtensor-0.0.1/src/nbxtensor/ops/conv_depthwise2d.py +154 -0
  126. nbxtensor-0.0.1/src/nbxtensor/ops/conv_transpose2d.py +148 -0
  127. nbxtensor-0.0.1/src/nbxtensor/ops/conv_wrappers.py +1482 -0
  128. nbxtensor-0.0.1/src/nbxtensor/ops/copy.py +18 -0
  129. nbxtensor-0.0.1/src/nbxtensor/ops/copy_op.py +39 -0
  130. nbxtensor-0.0.1/src/nbxtensor/ops/cos.py +17 -0
  131. nbxtensor-0.0.1/src/nbxtensor/ops/count_nonzero.py +64 -0
  132. nbxtensor-0.0.1/src/nbxtensor/ops/cross_entropy.py +67 -0
  133. nbxtensor-0.0.1/src/nbxtensor/ops/cummax.py +109 -0
  134. nbxtensor-0.0.1/src/nbxtensor/ops/cummin.py +105 -0
  135. nbxtensor-0.0.1/src/nbxtensor/ops/cumsum.py +244 -0
  136. nbxtensor-0.0.1/src/nbxtensor/ops/decode_attn_vec.py +162 -0
  137. nbxtensor-0.0.1/src/nbxtensor/ops/depthwise_conv2d.py +132 -0
  138. nbxtensor-0.0.1/src/nbxtensor/ops/dequant_gemv.py +190 -0
  139. nbxtensor-0.0.1/src/nbxtensor/ops/dft.py +67 -0
  140. nbxtensor-0.0.1/src/nbxtensor/ops/dispatch.py +1228 -0
  141. nbxtensor-0.0.1/src/nbxtensor/ops/div.py +75 -0
  142. nbxtensor-0.0.1/src/nbxtensor/ops/dot_op.py +67 -0
  143. nbxtensor-0.0.1/src/nbxtensor/ops/dropout.py +23 -0
  144. nbxtensor-0.0.1/src/nbxtensor/ops/dtype_convert.py +42 -0
  145. nbxtensor-0.0.1/src/nbxtensor/ops/elementwise_launch.py +81 -0
  146. nbxtensor-0.0.1/src/nbxtensor/ops/elementwise_wrappers.py +2315 -0
  147. nbxtensor-0.0.1/src/nbxtensor/ops/elu.py +20 -0
  148. nbxtensor-0.0.1/src/nbxtensor/ops/embedding.py +69 -0
  149. nbxtensor-0.0.1/src/nbxtensor/ops/eq.py +32 -0
  150. nbxtensor-0.0.1/src/nbxtensor/ops/erf.py +18 -0
  151. nbxtensor-0.0.1/src/nbxtensor/ops/exp.py +17 -0
  152. nbxtensor-0.0.1/src/nbxtensor/ops/exp2.py +18 -0
  153. nbxtensor-0.0.1/src/nbxtensor/ops/fft_op.py +125 -0
  154. nbxtensor-0.0.1/src/nbxtensor/ops/fill_op.py +20 -0
  155. nbxtensor-0.0.1/src/nbxtensor/ops/flash_attention.py +307 -0
  156. nbxtensor-0.0.1/src/nbxtensor/ops/flash_attention_m8n8k4.py +384 -0
  157. nbxtensor-0.0.1/src/nbxtensor/ops/flash_decode.py +78 -0
  158. nbxtensor-0.0.1/src/nbxtensor/ops/flip_op.py +60 -0
  159. nbxtensor-0.0.1/src/nbxtensor/ops/floor.py +90 -0
  160. nbxtensor-0.0.1/src/nbxtensor/ops/full_op.py +24 -0
  161. nbxtensor-0.0.1/src/nbxtensor/ops/fused_moe.py +417 -0
  162. nbxtensor-0.0.1/src/nbxtensor/ops/fused_moe_m8n8k4.py +99 -0
  163. nbxtensor-0.0.1/src/nbxtensor/ops/fused_upsample_conv.py +413 -0
  164. nbxtensor-0.0.1/src/nbxtensor/ops/gather_op.py +52 -0
  165. nbxtensor-0.0.1/src/nbxtensor/ops/ge.py +32 -0
  166. nbxtensor-0.0.1/src/nbxtensor/ops/gelu.py +31 -0
  167. nbxtensor-0.0.1/src/nbxtensor/ops/gemv_vec.py +80 -0
  168. nbxtensor-0.0.1/src/nbxtensor/ops/glu.py +43 -0
  169. nbxtensor-0.0.1/src/nbxtensor/ops/grid_sampler.py +145 -0
  170. nbxtensor-0.0.1/src/nbxtensor/ops/group_norm_tiled.py +67 -0
  171. nbxtensor-0.0.1/src/nbxtensor/ops/groupnorm.py +123 -0
  172. nbxtensor-0.0.1/src/nbxtensor/ops/gt.py +32 -0
  173. nbxtensor-0.0.1/src/nbxtensor/ops/hardsigmoid.py +18 -0
  174. nbxtensor-0.0.1/src/nbxtensor/ops/hardswish.py +19 -0
  175. nbxtensor-0.0.1/src/nbxtensor/ops/im2col.py +57 -0
  176. nbxtensor-0.0.1/src/nbxtensor/ops/index_add.py +95 -0
  177. nbxtensor-0.0.1/src/nbxtensor/ops/index_put_op.py +92 -0
  178. nbxtensor-0.0.1/src/nbxtensor/ops/index_select.py +121 -0
  179. nbxtensor-0.0.1/src/nbxtensor/ops/index_wrappers.py +770 -0
  180. nbxtensor-0.0.1/src/nbxtensor/ops/isfinite.py +20 -0
  181. nbxtensor-0.0.1/src/nbxtensor/ops/isinf.py +20 -0
  182. nbxtensor-0.0.1/src/nbxtensor/ops/isnan.py +18 -0
  183. nbxtensor-0.0.1/src/nbxtensor/ops/launch_keys.py +1054 -0
  184. nbxtensor-0.0.1/src/nbxtensor/ops/launch_observer.py +54 -0
  185. nbxtensor-0.0.1/src/nbxtensor/ops/layernorm.py +71 -0
  186. nbxtensor-0.0.1/src/nbxtensor/ops/le.py +35 -0
  187. nbxtensor-0.0.1/src/nbxtensor/ops/leaky_relu.py +19 -0
  188. nbxtensor-0.0.1/src/nbxtensor/ops/lerp.py +76 -0
  189. nbxtensor-0.0.1/src/nbxtensor/ops/linalg_wrappers.py +1370 -0
  190. nbxtensor-0.0.1/src/nbxtensor/ops/linspace_op.py +47 -0
  191. nbxtensor-0.0.1/src/nbxtensor/ops/log.py +17 -0
  192. nbxtensor-0.0.1/src/nbxtensor/ops/log_sigmoid.py +23 -0
  193. nbxtensor-0.0.1/src/nbxtensor/ops/logical_and.py +26 -0
  194. nbxtensor-0.0.1/src/nbxtensor/ops/logical_not.py +24 -0
  195. nbxtensor-0.0.1/src/nbxtensor/ops/logical_or.py +26 -0
  196. nbxtensor-0.0.1/src/nbxtensor/ops/logical_xor.py +37 -0
  197. nbxtensor-0.0.1/src/nbxtensor/ops/loss_wrappers.py +282 -0
  198. nbxtensor-0.0.1/src/nbxtensor/ops/lt.py +32 -0
  199. nbxtensor-0.0.1/src/nbxtensor/ops/masked_fill.py +21 -0
  200. nbxtensor-0.0.1/src/nbxtensor/ops/matmul.py +377 -0
  201. nbxtensor-0.0.1/src/nbxtensor/ops/matmul_m8n8k4.py +235 -0
  202. nbxtensor-0.0.1/src/nbxtensor/ops/max_pool2d.py +74 -0
  203. nbxtensor-0.0.1/src/nbxtensor/ops/max_pool3d.py +93 -0
  204. nbxtensor-0.0.1/src/nbxtensor/ops/max_reduce.py +91 -0
  205. nbxtensor-0.0.1/src/nbxtensor/ops/maximum.py +18 -0
  206. nbxtensor-0.0.1/src/nbxtensor/ops/mean.py +40 -0
  207. nbxtensor-0.0.1/src/nbxtensor/ops/min_reduce.py +91 -0
  208. nbxtensor-0.0.1/src/nbxtensor/ops/minimum.py +18 -0
  209. nbxtensor-0.0.1/src/nbxtensor/ops/mish.py +22 -0
  210. nbxtensor-0.0.1/src/nbxtensor/ops/mma_m8n8k4.py +152 -0
  211. nbxtensor-0.0.1/src/nbxtensor/ops/moe_align.py +195 -0
  212. nbxtensor-0.0.1/src/nbxtensor/ops/moe_decode_vec.py +374 -0
  213. nbxtensor-0.0.1/src/nbxtensor/ops/moe_device_residency.py +141 -0
  214. nbxtensor-0.0.1/src/nbxtensor/ops/moe_wrappers.py +345 -0
  215. nbxtensor-0.0.1/src/nbxtensor/ops/mse_loss.py +79 -0
  216. nbxtensor-0.0.1/src/nbxtensor/ops/mul.py +51 -0
  217. nbxtensor-0.0.1/src/nbxtensor/ops/nan_to_num.py +23 -0
  218. nbxtensor-0.0.1/src/nbxtensor/ops/ne.py +32 -0
  219. nbxtensor-0.0.1/src/nbxtensor/ops/neg.py +17 -0
  220. nbxtensor-0.0.1/src/nbxtensor/ops/nllloss.py +124 -0
  221. nbxtensor-0.0.1/src/nbxtensor/ops/nonzero.py +33 -0
  222. nbxtensor-0.0.1/src/nbxtensor/ops/nonzero_op.py +62 -0
  223. nbxtensor-0.0.1/src/nbxtensor/ops/norm_wrappers.py +579 -0
  224. nbxtensor-0.0.1/src/nbxtensor/ops/ones_op.py +20 -0
  225. nbxtensor-0.0.1/src/nbxtensor/ops/oracles/__init__.py +6 -0
  226. nbxtensor-0.0.1/src/nbxtensor/ops/oracles/conv2d_fp64.py +450 -0
  227. nbxtensor-0.0.1/src/nbxtensor/ops/pad_op.py +159 -0
  228. nbxtensor-0.0.1/src/nbxtensor/ops/paged_decode_attn.py +215 -0
  229. nbxtensor-0.0.1/src/nbxtensor/ops/pixel_shuffle.py +144 -0
  230. nbxtensor-0.0.1/src/nbxtensor/ops/pixel_unshuffle.py +72 -0
  231. nbxtensor-0.0.1/src/nbxtensor/ops/pow.py +137 -0
  232. nbxtensor-0.0.1/src/nbxtensor/ops/prod.py +81 -0
  233. nbxtensor-0.0.1/src/nbxtensor/ops/rand_op.py +52 -0
  234. nbxtensor-0.0.1/src/nbxtensor/ops/random_wrappers.py +366 -0
  235. nbxtensor-0.0.1/src/nbxtensor/ops/reciprocal.py +17 -0
  236. nbxtensor-0.0.1/src/nbxtensor/ops/reduction_wrappers.py +845 -0
  237. nbxtensor-0.0.1/src/nbxtensor/ops/relu.py +18 -0
  238. nbxtensor-0.0.1/src/nbxtensor/ops/remainder.py +46 -0
  239. nbxtensor-0.0.1/src/nbxtensor/ops/repeat_interleave.py +48 -0
  240. nbxtensor-0.0.1/src/nbxtensor/ops/repeat_op.py +132 -0
  241. nbxtensor-0.0.1/src/nbxtensor/ops/residual_chain.py +374 -0
  242. nbxtensor-0.0.1/src/nbxtensor/ops/rmsnorm.py +68 -0
  243. nbxtensor-0.0.1/src/nbxtensor/ops/rope.py +142 -0
  244. nbxtensor-0.0.1/src/nbxtensor/ops/rsqrt.py +17 -0
  245. nbxtensor-0.0.1/src/nbxtensor/ops/scaled_softmax.py +96 -0
  246. nbxtensor-0.0.1/src/nbxtensor/ops/scatter_op.py +139 -0
  247. nbxtensor-0.0.1/src/nbxtensor/ops/screen_oracle.py +479 -0
  248. nbxtensor-0.0.1/src/nbxtensor/ops/selu.py +22 -0
  249. nbxtensor-0.0.1/src/nbxtensor/ops/shape_wrappers.py +1032 -0
  250. nbxtensor-0.0.1/src/nbxtensor/ops/sigmoid.py +19 -0
  251. nbxtensor-0.0.1/src/nbxtensor/ops/silu.py +27 -0
  252. nbxtensor-0.0.1/src/nbxtensor/ops/sin.py +17 -0
  253. nbxtensor-0.0.1/src/nbxtensor/ops/softmax.py +169 -0
  254. nbxtensor-0.0.1/src/nbxtensor/ops/softplus.py +27 -0
  255. nbxtensor-0.0.1/src/nbxtensor/ops/sort_op.py +304 -0
  256. nbxtensor-0.0.1/src/nbxtensor/ops/spectral_wrappers.py +481 -0
  257. nbxtensor-0.0.1/src/nbxtensor/ops/sqrt.py +17 -0
  258. nbxtensor-0.0.1/src/nbxtensor/ops/stack_op.py +84 -0
  259. nbxtensor-0.0.1/src/nbxtensor/ops/std.py +113 -0
  260. nbxtensor-0.0.1/src/nbxtensor/ops/strided_copy.py +200 -0
  261. nbxtensor-0.0.1/src/nbxtensor/ops/sub.py +35 -0
  262. nbxtensor-0.0.1/src/nbxtensor/ops/sum.py +40 -0
  263. nbxtensor-0.0.1/src/nbxtensor/ops/tan.py +19 -0
  264. nbxtensor-0.0.1/src/nbxtensor/ops/tanh.py +21 -0
  265. nbxtensor-0.0.1/src/nbxtensor/ops/threshold.py +19 -0
  266. nbxtensor-0.0.1/src/nbxtensor/ops/tiling.yml +91 -0
  267. nbxtensor-0.0.1/src/nbxtensor/ops/tiling_policy.py +43 -0
  268. nbxtensor-0.0.1/src/nbxtensor/ops/tiling_sizes.py +370 -0
  269. nbxtensor-0.0.1/src/nbxtensor/ops/topk.py +267 -0
  270. nbxtensor-0.0.1/src/nbxtensor/ops/trace_op.py +64 -0
  271. nbxtensor-0.0.1/src/nbxtensor/ops/tril.py +64 -0
  272. nbxtensor-0.0.1/src/nbxtensor/ops/triu.py +62 -0
  273. nbxtensor-0.0.1/src/nbxtensor/ops/unfold_op.py +37 -0
  274. nbxtensor-0.0.1/src/nbxtensor/ops/unique_op.py +97 -0
  275. nbxtensor-0.0.1/src/nbxtensor/ops/upsample_bilinear2d.py +106 -0
  276. nbxtensor-0.0.1/src/nbxtensor/ops/upsample_nearest2d.py +52 -0
  277. nbxtensor-0.0.1/src/nbxtensor/ops/upsample_nearest3d.py +61 -0
  278. nbxtensor-0.0.1/src/nbxtensor/ops/var.py +136 -0
  279. nbxtensor-0.0.1/src/nbxtensor/ops/vector_norm.py +216 -0
  280. nbxtensor-0.0.1/src/nbxtensor/ops/weight_norm.py +104 -0
  281. nbxtensor-0.0.1/src/nbxtensor/ops/where.py +39 -0
  282. nbxtensor-0.0.1/src/nbxtensor/ops/wrappers.py +825 -0
  283. nbxtensor-0.0.1/src/nbxtensor/ops/zeros_op.py +20 -0
  284. nbxtensor-0.0.1/src/nbxtensor/quant/__init__.py +1 -0
  285. nbxtensor-0.0.1/src/nbxtensor/quant/quantized_tensor.py +187 -0
  286. nbxtensor-0.0.1/src/nbxtensor/random/__init__.py +1 -0
  287. nbxtensor-0.0.1/src/nbxtensor/random/mt_randn.py +154 -0
  288. nbxtensor-0.0.1/src/nbxtensor/random/rng_pin.py +59 -0
  289. nbxtensor-0.0.1/src/nbxtensor/random/rng_stream.py +118 -0
  290. nbxtensor-0.0.1/src/nbxtensor/random/seeded_draw.py +223 -0
  291. nbxtensor-0.0.1/src/nbxtensor/shape/__init__.py +157 -0
  292. nbxtensor-0.0.1/src/nbxtensor/tensor.py +1867 -0
  293. nbxtensor-0.0.1/tests/test_a_small_tensor_never_pins_a_large_block.py +52 -0
  294. nbxtensor-0.0.1/tests/test_a_sweep_refused_everywhere_says_so.py +35 -0
  295. nbxtensor-0.0.1/tests/test_allocator_interceptor.py +159 -0
  296. nbxtensor-0.0.1/tests/test_array_api_promotion.py +70 -0
  297. nbxtensor-0.0.1/tests/test_cpu_pool.py +85 -0
  298. nbxtensor-0.0.1/tests/test_device_facts.py +55 -0
  299. nbxtensor-0.0.1/tests/test_device_files.py +25 -0
  300. nbxtensor-0.0.1/tests/test_device_memory.py +63 -0
  301. nbxtensor-0.0.1/tests/test_dtype_convert.py +58 -0
  302. nbxtensor-0.0.1/tests/test_dtype_outputs.py +53 -0
  303. nbxtensor-0.0.1/tests/test_dtype_promotion.py +60 -0
  304. nbxtensor-0.0.1/tests/test_host.py +50 -0
  305. nbxtensor-0.0.1/tests/test_io_bf16_split.py +20 -0
  306. nbxtensor-0.0.1/tests/test_io_read_rate.py +85 -0
  307. nbxtensor-0.0.1/tests/test_nbx_dtype.py +37 -0
  308. nbxtensor-0.0.1/tests/test_ops_cost.py +63 -0
  309. nbxtensor-0.0.1/tests/test_policy.py +55 -0
  310. nbxtensor-0.0.1/tests/test_readme.py +27 -0
  311. nbxtensor-0.0.1/tests/test_shape.py +56 -0
  312. nbxtensor-0.0.1/tests/test_the_launcher_refuses_a_backend_it_has_no_driver_for.py +35 -0
  313. nbxtensor-0.0.1/tests/test_the_malloc_trace_names_the_wrapper.py +25 -0
  314. nbxtensor-0.0.1/tests/test_the_metal_dispatch_facts_are_declared_or_refused.py +31 -0
  315. nbxtensor-0.0.1/tests/test_third_party_notices.py +81 -0
  316. nbxtensor-0.0.1/tests/test_version.py +23 -0
  317. nbxtensor-0.0.1/tools/device_key_census.py +118 -0
  318. nbxtensor-0.0.1/tools/device_key_trace.py +64 -0
  319. nbxtensor-0.0.1/tools/scatter_scan.py +173 -0
@@ -0,0 +1,119 @@
1
+ # Changelog
2
+
3
+ All notable changes to nbxtensor are documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ ## [0.0.1] - 2026-11-05
11
+
12
+ The first release of nbxtensor: an inference-first tensor library whose kernels are written in Triton and which never
13
+ imports torch. NeuroBrix's Triton engine is its first client: on 2026-11-05 the engine's final gate ran its 49 catalogue
14
+ models through the library on four V100 cards (both card classes, every output judged by eye), and the library's tests,
15
+ five reference models and an uncertified autotune sweep ran in an environment where torch is not installed, with no
16
+ attempt to import it.
17
+
18
+ **What the library holds**
19
+ - **A tensor without torch**: `nbxtensor.Tensor` with its dtype table (`dtypes.yml`: every width, safetensors code and
20
+ key spelling in one place), strides counted in elements, ATen's view rule, broadcasting, Array API type promotion with
21
+ weak Python scalars, seeded random streams, quantized weights (grouped int4 with scales and minima), and DLPack for
22
+ exchange (`__dlpack__`, `from_dlpack`): a torch user writes `torch.from_dlpack(t)` on their side.
23
+ - **Triton kernels for the operators of inference graphs**, each declaring its cost (outputs, workspace and scratch with
24
+ their lifetimes, bytes moved, flops) so a planner prices a model before running it: elementwise and comparison ops,
25
+ reductions, softmax, layer, group, RMS and batch norms, matrix products and matrix-vector products (on the V100's
26
+ m8n8k4 matrix unit where certified faster), 1-D, 2-D and 3-D convolutions and transposed convolutions, pooling and
27
+ resampling, rotary embeddings, attention (flash, split decode, paged decode, vector decode), mixture-of-experts (the
28
+ fused GEMM, the one-token band, the routing alignment), FFT, sorting, top-k, gathers and scatters.
29
+ - **Memory that is planned**: allocators per device behind one interface (a pool that splits and merges freed blocks; on
30
+ CUDA with virtual memory management an expandable range), a slab planner (`memory.slab`), and the capture and replay
31
+ of a repeated sequence of launches, verified byte-equal (CUDA graphs on NVIDIA).
32
+ - **Kernel settings proven once, per device class**: every autotuned kernel is certified per launch key against a
33
+ float64 oracle and served from a store of proven settings; the library sweeps a key it has no setting for at first
34
+ use, and an application may require certified settings only (a missing key is then an error naming it).
35
+ - **Every core of the host**: host work over large arrays (weight conversions at load) runs on a thread pool sized to
36
+ the machine's compute cores, with the BLAS held to the same cores.
37
+
38
+ **Hardware**: NVIDIA V100 (CUDA) and Apple M4 Pro (Metal through triton-ext) are proven; NVIDIA Ampere and Hopper and
39
+ the other Apple silicon chips have device files and are not proven on our machines; AMD Instinct (HIP) and Intel GPUs
40
+ (Level Zero) have their interfaces written and are not tested for lack of hardware; there is no CPU kernel backend.
41
+
42
+ **Named refusals**: a missing fact is an error that names it, never a default — a dtype absent from the table, a
43
+ device fact absent from its device file, a strided slice, a signed integer promoted with `uint64`, a Python integer
44
+ outside an integer array's range, a pointer Metal declines to bind in place, a per-row bias of more than four rows in
45
+ `addmm`, an uncertified key where certified settings are required.
46
+
47
+ **Known limitations**: inference only (no autograd); slicing has step 1; no array namespace (`__array_namespace__`)
48
+ yet; `conv_transpose2d` runs on the FMA kernel only (no matrix-unit path; no catalogue model forms it); on Apple silicon,
49
+ two of NeuroBrix's video models do not complete on the M4 Pro yet — mochi-1-preview (the PyTorch engine's memory at its
50
+ decoder's temporal stream) and Allegro / Allegro-TI2V on the Triton engine with its replay (a Metal command buffer out of
51
+ memory; the fix is in test).
52
+
53
+ ### Added
54
+ - **`nbxtensor.memory.slab.first_fit_extent`**: the slab a run needs, the highest offset the slab's own first fit
55
+ reaches over the run's allocations and frees — between its live peak and the sum of its blocks.
56
+ - **nbxtensor describes the NVIDIA and AMD devices itself**: `backend/devices/nvidia/` (Volta, Ampere, Hopper) and
57
+ `backend/devices/amd/` (CDNA, CDNA2, CDNA3) hold the facts its kernels read — tiles, shared memory, registers,
58
+ warp size, the matrix unit, the autotune ladders and screen, the attention thresholds — as Apple's did; an
59
+ application's vendor file only adds its own keys beside them (a key in both is refused).
60
+ - **The fused mixture-of-experts GEMM runs on the V100's matrix unit** (`fused_moe_m8n8k4_kernel`, `moe_wrappers.invoke_fused_moe_m8n8k4`): the FMA kernel's contract — the alignment's blocks, the expert pointer table, the top-k division, the routed weight — on the m8n8k4 unit at the profile's tiles, the routing aligned at the tile's rows. Its certificate decides per key against the FMA kernel (`fused_moe_unit_tile`); on a V100 the unit measured 2.5-5x faster on every prefill projection timed (DeepSeek-Coder-V2-Lite's 20-token gate 2.49 -> 0.96 ms, Qwen3-30B-A3B's 512-token gate 7.24 -> 1.40 ms).
61
+ - **nbxtensor names the device in force publicly**: `nbxtensor.backend.device_files.in_force()`, `for_arch(arch)` and `forget()`, and `nbxtensor.backend.launcher.bind_target(target)` for a derivation that launches nothing; the engine's key census and paged KV cache read them instead of the library's private configuration module.
62
+
63
+ ### Changed
64
+ - **Every device file states the tolerance an integer kernel output is certified at**: `autotune_screen_rtol.int64: 0.0` — met exactly (the MoE alignment's routing tables); the certifier invents no tolerance and refused every alignment key without it.
65
+ - **The MoE alignment's three stages take their chunk widths and warps from their certificates**: `moe_align_stage{1,2,3}_kernel` ran per-backend literal widths (128 or the experts' count on CUDA, 32-64 on Metal) at 4 warps; each is now certified per key (the block, the padded expert count, the layer's pairs in the profile's `elements` classes), its candidates pruned to the blocks that fit the profile's `memory.max_shared_memory_per_block`. Every candidate computes the same routing; the choice is speed only.
66
+ - **`nbxtensor.memory.pointer_tables.build_ptr_tables` is public**: the expert pointer tables a MoE kernel reads (on Metal captured under a pinned scope), built by the engine's MoE layer and by its certifier alike; it was the private `_build_ptr_tables`.
67
+ - **The split decode's reduce takes its warps from its certificate**: `flash_decode_reduce_kernel` ran at a literal 4 warps after both split decodes (vector and paged); it is now certified per key (the splits, the value head dim, the output dtype) through `attention_wrappers.decode_reduce`, and `decode_attn_vec.decode_vec_splits` names the vector decode's split rule for the wrapper, the census and the certifier alike.
68
+ - **The paged decode attention takes its position tile and warps from its certificate**: `paged_decode_attention` ran the judged tile (32, `PAGED_DECODE_JUDGED_TILE`, removed) at 4 warps; the tile is now certified per key among the candidates that divide the page, and the call takes no tile argument. A split's positions are whole pages' worth of the largest tile (`PAGED_DECODE_SPLIT_ALIGN`), so every candidate cuts the splits alike. The certificate is keyed by the splits the longest sequence makes (`paged_decode_attn.paged_decode_splits`), the same count a replayed decode step is bucketed by, so a replayed step and the step it is verified against run one configuration.
69
+ - **A matrix product the V100's matrix unit can take runs on the unit or on its FMA kernel as its certificate measured**: `mm` and `addmm` took the m8n8k4 unit whenever its smallest tile filled, at the first tile of the profile that fit, a launch the certification never compared with anything. The FMA launch now keeps its autotune key on the unit too; certifying it times every unit tile the profile declares beside the FMA configurations, against the same oracle, and the entry names the unit's tile only when it was faster (a 80 x 4096 x 4096 fp16 product: FMA 0.404 ms, the first tile 0.207, the second 0.191 — the second is served). A run with no certificate keeps the declared unit; a confirmation run refuses the missing key.
70
+ - **A 1-D transposed convolution runs as a GEMM and an overlap-add** (`conv_transpose_wrapper`, groups 1, dilation 1, no output padding): `x^T [L, C_in] @ W [C_in, C_out*K]` through `mm` (the length on the rows, which the autotune key classes) — the matrix unit where the hardware profile declares one — then `col2im1d_kernel` gathers each output position's taps. The scatter kernel looped over every input channel and tap per output element; the vocoders' upsamplers ran 20-307x slower on a V100. Same output dtype; the waveform of a chatterbox sentence agrees with the scatter kernel's at 49.5 dB SNR, its transcription exact.
71
+ - **The vector decode attention takes its key block and warps from its certificate**: `decode_attn_vec_split_kernel` ran 32 keys a step and 4 warps, read from environment variables (`NBX_DV_BLOCK_N`, `NBX_DV_WARPS`) with those defaults; both are now candidates certified per key (the keys' bucket, the head dims, the GQA group, the bias). The split (256 keys a program, at most 64) stays the kernel's: it defines the partials.
72
+ - **A one-token mixture-of-experts layer on half-precision experts takes its tiles from its certificate**: the gateup, the down projection's partials and their sum (`moe_decode_vec`) ran a hand table (32 x 128, 4 warps; 256 / 2 warps for the sum); each is now certified per key over the ladder the table was measured from (Qwen3-30B-A3B's 2048 x 768 experts on a V100: gateup 16 x 64, down 16 x 256, sum 1024).
73
+ - **The fused mixture-of-experts GEMM takes its tile from its certificate**: `fused_moe_kernel`'s column and reduction tiles, warps and stages were literals (64 x 32, 4 warps, 2 stages, `moe_wrappers._MOE_BN/_MOE_BK`); they are now candidates the certification measures per key — the GEMM's dims, the valid (token, expert) pairs' bucket and the layer's experts (`launch_keys.fused_moe_launches`). The row block stays the routing alignment's. A 512-token Qwen3-30B-A3B prefill's gate projection takes 128 columns.
74
+ - **A 1-D transposed convolution runs as a GEMM and an overlap-add** (`conv_transpose_wrapper`, groups 1, dilation 1, no output padding): `W^T [C_out*K, C_in] @ x` through `mm` — the matrix unit where the hardware profile declares one — then `col2im1d_kernel` gathers each output position's taps. The scatter kernel looped over every input channel and tap per output element; the vocoders' upsamplers ran 20-307x slower on a V100. Same output dtype; the waveform of a chatterbox sentence agrees with the scatter kernel's at 49.5 dB SNR, its transcription exact.
75
+ - **Depthwise convolutions read their input coalesced**: the depthwise kernel's tile put the channels on its fastest axis, H*W elements apart in memory, so no load coalesced; it now computes a (channels x rows x columns) output tile with the width fastest. On a V100: SANA-Video's 11200-channel 3x3 4.5-8 times faster (2.63 -> 0.33 ms, at or past torch's 0.38 ms), the vocoders' one-row depthwise 1.6-2.4 times faster (orpheus-3b's first audio 3.68 -> 1.85 s); every depthwise key re-certified on both memory classes.
76
+ - **An fp32 1 x 1 convolution runs on the V100's matrix unit**: the convolution's implicit GEMM carries fp32 operands as hi + lo through three MMAs (as the GEMM already did), but only where the hardware profile declares a measured row for the kernel window and the tile fills — on a V100 the 1 x 1 window (1.26-1.95 times faster on the video VAEs' shapes); a 3 x 3 measured slower than the FMA path at every tile and keeps it. The census forms no autotune key where the unit runs.
77
+ - **The matrix product and the linear layer declare what they allocate** (`nbxtensor.ops.linalg_wrappers.mm_cost` / `addmm_cost`, beside `bmm_cost`): the casts, the decode rows' GEMV and the weight copy a row-major weight costs there, the bias made contiguous, the output at its store dtype, an epilogue's output; each equal to the allocator's measured peak on the device, over the dtypes, the decode and tiled row counts, both weight layouts and the bias forms.
78
+
79
+ ### Fixed
80
+ - **nbxtensor finds the NVIDIA card on a machine that has only the driver**: its CUDA backend opens the CUDA runtime library (`libcudart.so.12`), which the driver does not ship; on a clean Linux machine no GPU runtime was found and the card was read as a CPU. nbxtensor now depends on `nvidia-cuda-runtime-cu12` on Linux.
81
+ - **The README's examples run in their own interpreter**: the suite ran them in its own process, and the settings
82
+ example's `set_store(None)` reset the certified store every later test of that process read (a test of the live
83
+ directory found it empty in the suite and green alone).
84
+ - **The Metal runtime no longer invents its dispatch limits**: the command buffers a queue may hold in flight and the
85
+ dispatches one buffer may carry fell back to 32 and 512 written in the runtime when the device file did not state them;
86
+ they are read from the device file, and a missing one is refused by name.
87
+ - **The half-precision MoE decode band no longer tries configs past the device's shared memory**: `moe_gateup_vec_half_kernel` and `moe_down_split_vec_half_kernel` prune their tiles to the [BLOCK_K, BLOCK_N] fp32 blocks `memory.max_shared_memory_per_block` holds before any compile (on Apple's 32 KB a 256 x 64 block aborted the Metal emitter); the door is `_configs.fits_shared_memory`.
88
+ - **The library alone autotunes on NVIDIA**: without an application's hardware profile, a kernel's device facts
89
+ (`memory.max_registers_per_block` and the like) were read through the profile and found absent, so a reduction or
90
+ a softmax without a certified configuration was refused; they are now read from the device file of the card the
91
+ launch targets. The backend conformance suite passes on CUDA with nbxtensor alone.
92
+ - **A request larger than a card's whole expandable range is refused as the out-of-memory it is**: on a device whose
93
+ large blocks grow in an expandable (VMM) range, such a request raised a plain error without its figures; it now
94
+ raises `DeviceOOMError` with the requested, live, pool-cached and driver-free bytes, as the driver path does, so a
95
+ caller that reshapes the work on a refusal catches it.
96
+ - **A certified entry naming parameters its kernel lacks is no longer served**: the directory's check compared a
97
+ key's arity and dtype with the kernel, never the configuration's parameter names, so the depthwise convolution's
98
+ entries from its former tile (`BLOCK_HW`, `BLOCK_C`) were served to the new one (`BC`, `TH`, `TW`). Such a file is now
99
+ refused by name; the Apple and V100 depthwise entries were certified again in the new space (1aa40649, f78b9c4b).
100
+ - **A certified-only launch whose key cannot be formed is refused by name**: the key builder raising left the key empty, which skipped the certified lookup and let Triton's autotuner sweep inside a run promised to serve the certified directory only; it is now a `KeyNotCertified` naming the kernel and the exception.
101
+ - **The Triton allocator's expandable range maps in chunks the engine measures on a real run, and a refusal remaps the
102
+ memory it takes back**: the chunk was measured per mapping call (2 MiB on a V100), and a refusal released the chunks
103
+ it reclaimed and created them again — SANA-Video_2B_720p on a V100-16GB mapped 89 GB over a run and was 33-44 % slower
104
+ than without the range. The first launch now replays a real run's allocation trace, which the library carries, with
105
+ the range off and at each candidate chunk, and keeps the smallest within the off replay's noise (32 MiB on the V100
106
+ 16 GB, 64 MiB on the 32 GB); a reclaim maps its chunks again where they are needed. SANA-Video 16g runs at the off figure, and on
107
+ a 32 GB card the range holds 8 GB less at its peak.
108
+ - **The Triton allocator's large class grows in an expandable range on a CUDA device with virtual memory management**: one reserved address range per device, physical chunks mapped into it as the pool grows, and at a refusal one synchronisation, then every mapped chunk lying whole inside a free block unmapped and mapped again where the request needs it — a free remainder beside a live tensor no longer pins its pages (Wan2.1-I2V triton on a V100-16GB was refused a 731 MB attention product with 1.1 GB of 48 MB remainders pinned in driver segments). The method of PyTorch's `expandable_segments`; the chunk is a measured fact of the generated profile (`vmm_chunk_bytes`: the smallest multiple of the granularity whose map costs no more than an ordinary allocation, 2 MiB on V100), refused by name when absent; a device without VMM keeps its driver segments. The small class and the weight arenas are unchanged; `memory.pool.simulate` replays the same rules.
109
+ - **A refused small allocation is retried at the size of the segment the pool records**: a small request grows the device by a 2 MiB segment the pool then carves later small blocks from, but the retries after a refusal (the pool's flush, the idle slabs' release, the opt-in collection) asked the driver for the request's bytes — a 1 KiB driver allocation the pool treated as 2 MiB. Found while reading the allocator for the expandable segments (2026-11-02), on the path a full card takes; a test pins it.
110
+ - **The Triton allocator's pool no longer lets a scalar pin a multi-gigabyte block**: a request took "the smallest free block that holds it" in one class, so a 17 KB scalar carved a freed 2.5 GB block and pinned its remainder alive, a 632 MB request the next — Allegro triton on a V100-16GB (gate of 2026-11-01) was refused a 2.5 GB gelu output with 4.4 GB of free blocks in pinned segments (Allegro-TI2V, CogVideoX-5b-I2V, Wan2.1/2.2-I2V, MiniCPM-o the same). The pool now has two size classes (a request of at most 1 MiB is carved from 2 MiB small segments, torch's caching allocator's kSmallSize / kSmallBuffer) and the half rule (a large block is split only when what is left is at most the request); its wholly free segments stay parked across a growth and return to the driver at a refusal, as before 164e89dc, whose flush before every growth — which emptied the small free segments the scalars then carved large blocks for — is withdrawn. The real trace replayed through the pool's own rules (`memory.pool.simulate`, M3's replay) completes with the least held of every pooled rule tried, on Allegro 16g, mochi-1-preview 32g and Kokoro alike.
111
+ - **nbxtensor's `addmm` refuses a per-row bias `[M, N]` above four rows instead of computing it wrong**: its kernel adds one bias row to every output row, so such a bias was applied with its first row only. It is now refused by name (a bias `[N]` or `[1, N]`, which every catalogue model uses, is unchanged; a per-row bias at up to four rows is still served).
112
+
113
+ ### Removed
114
+ - **`decode_attn_vec_grouped_kernel` and the environment switches of the vector decode** (`NBX_DV_GROUPED`, `NBX_DV_SEG`, `NBX_DV_BLOCK_N`, `NBX_DV_WARPS`): the grouped variant ran only behind its switch.
115
+ - **`flash_decode_split_kernel` and its route**: armed only by an environment switch (`NBX_FLASH_DECODE`, with `NBX_FD_BLOCK_N` and `NBX_FD_SEG`) and measured slower than the vector decode kernels; `flash_decode.py` keeps the fixed-order reduce they share.
116
+ - **`conv1d_forward_kernel`**: launched by no route (a 1-D convolution runs through `conv2d`).
117
+
118
+ [Unreleased]: https://github.com/NeuroBrix/nbxtensor/compare/v0.0.1...HEAD
119
+ [0.0.1]: https://github.com/NeuroBrix/nbxtensor/releases/tag/v0.0.1
@@ -0,0 +1,189 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work.
38
+
39
+ "Derivative Works" shall mean any work, whether in Source or Object
40
+ form, that is based on (or derived from) the Work and for which the
41
+ editorial revisions, annotations, elaborations, or other modifications
42
+ represent, as a whole, an original work of authorship. For the purposes
43
+ of this License, Derivative Works shall not include works that remain
44
+ separable from, or merely link (or bind by name) to the interfaces of,
45
+ the Work and Derivative Works thereof.
46
+
47
+ "Contribution" shall mean any work of authorship, including
48
+ the original version of the Work and any modifications or additions
49
+ to that Work or Derivative Works thereof, that is intentionally
50
+ submitted to the Licensor for inclusion in the Work by the copyright owner
51
+ or by an individual or Legal Entity authorized to submit on behalf of
52
+ the copyright owner. For the purposes of this definition, "submitted"
53
+ means any form of electronic, verbal, or written communication sent
54
+ to the Licensor or its representatives, including but not limited to
55
+ communication on electronic mailing lists, source code control systems,
56
+ and issue tracking systems that are managed by, or on behalf of, the
57
+ Licensor for the purpose of discussing and improving the Work, but
58
+ excluding communication that is conspicuously marked or otherwise
59
+ designated in writing by the copyright owner as "Not a Contribution."
60
+
61
+ "Contributor" shall mean Licensor and any individual or Legal Entity
62
+ on behalf of whom a Contribution has been received by the Licensor and
63
+ subsequently incorporated within the Work.
64
+
65
+ 2. Grant of Copyright License. Subject to the terms and conditions of
66
+ this License, each Contributor hereby grants to You a perpetual,
67
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
68
+ copyright license to reproduce, prepare Derivative Works of,
69
+ publicly display, publicly perform, sublicense, and distribute the
70
+ Work and such Derivative Works in Source or Object form.
71
+
72
+ 3. Grant of Patent License. Subject to the terms and conditions of
73
+ this License, each Contributor hereby grants to You a perpetual,
74
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
75
+ (except as stated in this section) patent license to make, have made,
76
+ use, offer to sell, sell, import, and otherwise transfer the Work,
77
+ where such license applies only to those patent claims licensable
78
+ by such Contributor that are necessarily infringed by their
79
+ Contribution(s) alone or by combination of their Contribution(s)
80
+ with the Work to which such Contribution(s) was submitted. If You
81
+ institute patent litigation against any entity (including a
82
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
83
+ or a Contribution incorporated within the Work constitutes direct
84
+ or contributory patent infringement, then any patent licenses
85
+ granted to You under this License for that Work shall terminate
86
+ as of the date such litigation is filed.
87
+
88
+ 4. Redistribution. You may reproduce and distribute copies of the
89
+ Work or Derivative Works thereof in any medium, with or without
90
+ modifications, and in Source or Object form, provided that You
91
+ meet the following conditions:
92
+
93
+ (a) You must give any other recipients of the Work or
94
+ Derivative Works a copy of this License; and
95
+
96
+ (b) You must cause any modified files to carry prominent notices
97
+ stating that You changed the files; and
98
+
99
+ (c) You must retain, in the Source form of any Derivative Works
100
+ that You distribute, all copyright, patent, trademark, and
101
+ attribution notices from the Source form of the Work,
102
+ excluding those notices that do not pertain to any part of
103
+ the Derivative Works; and
104
+
105
+ (d) If the Work includes a "NOTICE" text file as part of its
106
+ distribution, then any Derivative Works that You distribute must
107
+ include a readable copy of the attribution notices contained
108
+ within such NOTICE file, excluding any notices that do not
109
+ pertain to any part of the Derivative Works, in at least one
110
+ of the following places: within a NOTICE text file distributed
111
+ as part of the Derivative Works; within the Source form or
112
+ documentation, if provided along with the Derivative Works; or,
113
+ within a display generated by the Derivative Works, if and
114
+ wherever such third-party notices normally appear. The contents
115
+ of the NOTICE file are for informational purposes only and
116
+ do not modify the License. You may add Your own attribution
117
+ notices within Derivative Works that You distribute, alongside
118
+ or as an addendum to the NOTICE text from the Work, provided
119
+ that such additional attribution notices cannot be construed
120
+ as modifying the License.
121
+
122
+ You may add Your own copyright statement to Your modifications and
123
+ may provide additional or different license terms and conditions
124
+ for use, reproduction, or distribution of Your modifications, or
125
+ for any such Derivative Works as a whole, provided Your use,
126
+ reproduction, and distribution of the Work otherwise complies with
127
+ the conditions stated in this License.
128
+
129
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
130
+ any Contribution intentionally submitted for inclusion in the Work
131
+ by You to the Licensor shall be under the terms and conditions of
132
+ this License, without any additional terms or conditions.
133
+ Notwithstanding the above, nothing herein shall supersede or modify
134
+ the terms of any separate license agreement you may have executed
135
+ with Licensor regarding such Contributions.
136
+
137
+ 6. Trademarks. This License does not grant permission to use the trade
138
+ names, trademarks, service marks, or product names of the Licensor,
139
+ except as required for reasonable and customary use in describing the
140
+ origin of the Work and reproducing the content of the NOTICE file.
141
+
142
+ 7. Disclaimer of Warranty. Unless required by applicable law or
143
+ agreed to in writing, Licensor provides the Work (and each
144
+ Contributor provides its Contributions) on an "AS IS" BASIS,
145
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
146
+ implied, including, without limitation, any warranties or conditions
147
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
148
+ PARTICULAR PURPOSE. You are solely responsible for determining the
149
+ appropriateness of using or redistributing the Work and assume any
150
+ risks associated with Your exercise of permissions under this License.
151
+
152
+ 8. Limitation of Liability. In no event and under no legal theory,
153
+ whether in tort (including negligence), contract, or otherwise,
154
+ unless required by applicable law (such as deliberate and grossly
155
+ negligent acts) or agreed to in writing, shall any Contributor be
156
+ liable to You for damages, including any direct, indirect, special,
157
+ incidental, or consequential damages of any character arising as a
158
+ result of this License or out of the use or inability to use the
159
+ Work (including but not limited to damages for loss of goodwill,
160
+ work stoppage, computer failure or malfunction, or any and all
161
+ other commercial damages or losses), even if such Contributor
162
+ has been advised of the possibility of such damages.
163
+
164
+ 9. Accepting Warranty or Additional Liability. While redistributing
165
+ the Work or Derivative Works thereof, You may choose to offer,
166
+ and charge a fee for, acceptance of support, warranty, indemnity,
167
+ or other liability obligations and/or rights consistent with this
168
+ License. However, in accepting such obligations, You may act only
169
+ on Your own behalf and on Your sole responsibility, not on behalf
170
+ of any other Contributor, and only if You agree to indemnify,
171
+ defend, and hold each Contributor harmless for any liability
172
+ incurred by, or claims asserted against, such Contributor by reason
173
+ of your accepting any such warranty or additional liability.
174
+
175
+ END OF TERMS AND CONDITIONS
176
+
177
+ Copyright 2025 Neural Networks Holding LTD
178
+
179
+ Licensed under the Apache License, Version 2.0 (the "License");
180
+ you may not use this file except in compliance with the License.
181
+ You may obtain a copy of the License at
182
+
183
+ http://www.apache.org/licenses/LICENSE-2.0
184
+
185
+ Unless required by applicable law or agreed to in writing, software
186
+ distributed under the License is distributed on an "AS IS" BASIS,
187
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
188
+ See the License for the specific language governing permissions and
189
+ limitations under the License.