nbxtensor 0.1.7__tar.gz → 0.1.9__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 (527) hide show
  1. nbxtensor-0.1.9/.gitignore +2 -0
  2. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/CHANGELOG.md +53 -0
  3. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/PKG-INFO +19 -1
  4. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/README.md +18 -0
  5. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/THIRD_PARTY_NOTICES.md +24 -0
  6. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/docs/API.md +180 -1
  7. nbxtensor-0.1.9/docs/history/ENGINE_SLIM.md +734 -0
  8. nbxtensor-0.1.9/docs/history/engine_slim_list.tsv +5 -0
  9. nbxtensor-0.1.9/docs/kernels_provenance.md +124 -0
  10. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/pyproject.toml +1 -1
  11. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/__init__.py +1 -1
  12. nbxtensor-0.1.9/src/nbxtensor/backend/cuda_launch.py +78 -0
  13. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/backend/devices/apple/apple_m4_pro.yml +8 -4
  14. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/backend/frozen_plan.py +44 -11
  15. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/backend/launcher.py +23 -49
  16. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/backend/metal_device.py +31 -1
  17. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/backend/metal_dispatch.py +62 -0
  18. nbxtensor-0.1.9/src/nbxtensor/backend/metal_profile.py +167 -0
  19. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/backend/replay_graph.py +53 -17
  20. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/backend/triton_ext_driver.py +45 -27
  21. nbxtensor-0.1.9/src/nbxtensor/device.py +140 -0
  22. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/dtype/itemsize.py +3 -0
  23. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/io/safetensors.py +199 -1
  24. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/memory/__init__.py +17 -0
  25. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/memory/allocator.py +8 -3
  26. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/memory/deferred_frees.py +10 -1
  27. nbxtensor-0.1.9/src/nbxtensor/memory/fixed_state.py +270 -0
  28. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/memory/paged_kv.py +8 -2
  29. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/memory/shadow.py +30 -5
  30. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/memory/vmm.py +23 -21
  31. nbxtensor-0.1.9/src/nbxtensor/ops/_causal_conv1d.py +47 -0
  32. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/_common.py +3 -0
  33. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/_cost.py +72 -3
  34. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/addcdiv.py +3 -0
  35. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/addcmul.py +3 -0
  36. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/addmv_op.py +3 -0
  37. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/addr.py +3 -0
  38. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/all_reduce.py +3 -0
  39. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/any_reduce.py +3 -0
  40. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/arange_op.py +3 -0
  41. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/argmax.py +3 -0
  42. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/argmin.py +3 -0
  43. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/autotune_cache.py +2 -3
  44. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/autotune_certified.py +4 -0
  45. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/avg_pool2d.py +3 -0
  46. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/baddbmm_op.py +3 -0
  47. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/batch_norm.py +3 -0
  48. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/bitwise_and.py +3 -0
  49. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/bitwise_left_shift.py +3 -0
  50. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/bitwise_not.py +3 -0
  51. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/bitwise_or.py +3 -0
  52. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/bitwise_right_shift.py +3 -0
  53. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/cat_op.py +3 -0
  54. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/celu.py +3 -0
  55. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/conv2d.py +3 -0
  56. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/conv2d_m8n8k4.py +1 -0
  57. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/conv_wrappers.py +20 -0
  58. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/copy_op.py +3 -0
  59. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/count_nonzero.py +3 -0
  60. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/cross_entropy.py +3 -0
  61. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/cummax.py +3 -0
  62. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/cummin.py +3 -0
  63. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/cumsum.py +3 -0
  64. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/dispatch.py +14 -3
  65. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/dot_op.py +3 -0
  66. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/elementwise_wrappers.py +6 -7
  67. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/embedding.py +3 -0
  68. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/exp2.py +3 -0
  69. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/flash_attention.py +3 -0
  70. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/flash_attention_m8n8k4.py +1 -0
  71. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/flip_op.py +3 -0
  72. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/fused_moe.py +12 -15
  73. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/fused_moe_m8n8k4.py +1 -0
  74. nbxtensor-0.1.9/src/nbxtensor/ops/gated_delta_rule.py +263 -0
  75. nbxtensor-0.1.9/src/nbxtensor/ops/gated_delta_rule_census.json +151 -0
  76. nbxtensor-0.1.9/src/nbxtensor/ops/gated_delta_rule_chunked.py +435 -0
  77. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/gather_op.py +3 -0
  78. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/gemv_vec.py +3 -0
  79. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/glu.py +3 -0
  80. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/index_select.py +3 -0
  81. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/isfinite.py +3 -0
  82. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/isinf.py +3 -0
  83. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/isnan.py +3 -0
  84. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/launch_keys.py +61 -0
  85. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/layernorm.py +3 -0
  86. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/le.py +3 -0
  87. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/lerp.py +3 -0
  88. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/linalg_wrappers.py +24 -7
  89. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/linspace_op.py +3 -0
  90. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/log_sigmoid.py +3 -0
  91. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/logical_and.py +3 -0
  92. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/logical_not.py +3 -0
  93. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/logical_or.py +3 -0
  94. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/logical_xor.py +3 -0
  95. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/matmul_m8n8k4.py +1 -0
  96. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/max_pool2d.py +3 -0
  97. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/max_pool3d.py +3 -0
  98. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/max_reduce.py +3 -0
  99. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/min_reduce.py +3 -0
  100. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/mma_m8n8k4.py +1 -0
  101. nbxtensor-0.1.9/src/nbxtensor/ops/moe_route.py +249 -0
  102. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/mse_loss.py +3 -0
  103. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/nan_to_num.py +3 -0
  104. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/nllloss.py +3 -0
  105. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/nonzero_op.py +3 -0
  106. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/oracles/fp64.py +155 -1
  107. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/pad_op.py +3 -0
  108. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/prod.py +3 -0
  109. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/repeat_interleave.py +3 -0
  110. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/rmsnorm.py +3 -0
  111. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/rope.py +3 -0
  112. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/scaled_softmax.py +3 -0
  113. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/scatter_op.py +3 -0
  114. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/softmax.py +3 -0
  115. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/softplus.py +3 -0
  116. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/sort_op.py +3 -0
  117. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/stack_op.py +3 -0
  118. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/std.py +3 -0
  119. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/tan.py +3 -0
  120. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/threshold.py +3 -0
  121. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/topk.py +3 -0
  122. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/trace_op.py +3 -0
  123. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/tril.py +3 -0
  124. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/triu.py +3 -0
  125. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/unique_op.py +3 -0
  126. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/upsample_nearest2d.py +3 -0
  127. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/var.py +3 -0
  128. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/vector_norm.py +3 -0
  129. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/weight_norm.py +3 -0
  130. nbxtensor-0.1.9/src/nbxtensor/profile.py +95 -0
  131. nbxtensor-0.1.9/tests/_chunked_interpreter_run.py +91 -0
  132. nbxtensor-0.1.9/tests/_delta_rule_draw.py +17 -0
  133. nbxtensor-0.1.9/tests/_moe_route_compare.py +64 -0
  134. nbxtensor-0.1.9/tests/_moe_route_draw.py +13 -0
  135. nbxtensor-0.1.9/tests/_no_device.py +139 -0
  136. nbxtensor-0.1.9/tests/conftest.py +4 -0
  137. nbxtensor-0.1.9/tests/test_a_benchmark_spends_its_time_budget_not_more.py +62 -0
  138. nbxtensor-0.1.9/tests/test_a_cards_expert_table_keeps_the_layers_length.py +22 -0
  139. nbxtensor-0.1.9/tests/test_a_causal_convolution_carries_its_last_taps_minus_one_columns.py +204 -0
  140. nbxtensor-0.1.9/tests/test_a_certification_harness_draws_measures_and_sweeps.py +152 -0
  141. nbxtensor-0.1.9/tests/test_a_device_name_is_read_once_for_every_backend.py +50 -0
  142. nbxtensor-0.1.9/tests/test_a_device_naming_that_moves_nothing_is_counted.py +56 -0
  143. nbxtensor-0.1.9/tests/test_a_device_question_the_runtime_refuses_is_raised_by_name.py +178 -0
  144. nbxtensor-0.1.9/tests/test_a_device_speed_is_what_it_moves_over_its_time.py +74 -0
  145. nbxtensor-0.1.9/tests/test_a_dropped_tensor_is_freed_after_the_work_that_reads_it.py +131 -0
  146. nbxtensor-0.1.9/tests/test_a_dtype_the_key_carries_is_never_dropped.py +86 -0
  147. nbxtensor-0.1.9/tests/test_a_failed_driver_call_refuses_the_peer_grant.py +90 -0
  148. nbxtensor-0.1.9/tests/test_a_fixed_state_is_allocated_zero_written_reordered_copied_and_forgotten.py +256 -0
  149. nbxtensor-0.1.9/tests/test_a_fixed_state_on_a_card_keeps_its_bytes_through_every_verb.py +82 -0
  150. nbxtensor-0.1.9/tests/test_a_frozen_plan_replays_its_launches_pre_bound.py +126 -0
  151. nbxtensor-0.1.9/tests/test_a_graph_constant_is_read_without_a_tensor_library.py +55 -0
  152. nbxtensor-0.1.9/tests/test_a_kernel_file_carries_the_header_of_its_provenance_class.py +58 -0
  153. nbxtensor-0.1.9/tests/test_a_kernel_time_session_ranks_launches_and_changes_no_byte.py +166 -0
  154. nbxtensor-0.1.9/tests/test_a_key_carrying_an_integer_dtype_is_synthesised_as_that_dtype.py +55 -0
  155. nbxtensor-0.1.9/tests/test_a_key_the_card_has_not_certified_is_refused_by_name_never_swept_for_the_moe_route.py +33 -0
  156. nbxtensor-0.1.9/tests/test_a_kv_page_goes_to_the_host_and_back_bit_exact.py +82 -0
  157. nbxtensor-0.1.9/tests/test_a_layer_on_several_devices_is_the_sum_of_their_shares.py +118 -0
  158. nbxtensor-0.1.9/tests/test_a_mapped_shard_gives_back_the_pages_of_a_copied_view.py +68 -0
  159. nbxtensor-0.1.9/tests/test_a_metal_fence_frees_only_the_pages_past_it.py +39 -0
  160. nbxtensor-0.1.9/tests/test_a_metal_kernel_runs_on_nbxtensors_own_stream.py +285 -0
  161. nbxtensor-0.1.9/tests/test_a_one_element_sentinel_is_saturated_to_a_half_range.py +39 -0
  162. nbxtensor-0.1.9/tests/test_a_probe_leaves_no_context_on_a_card_nobody_selected.py +43 -0
  163. nbxtensor-0.1.9/tests/test_a_promoted_slab_crosses_once_and_its_table_is_never_cached.py +87 -0
  164. nbxtensor-0.1.9/tests/test_a_refused_allocation_names_who_holds_the_memory.py +54 -0
  165. nbxtensor-0.1.9/tests/test_a_replayed_launch_binds_by_the_extents_it_was_launched_with.py +83 -0
  166. nbxtensor-0.1.9/tests/test_a_replayed_view_output_keeps_its_values.py +44 -0
  167. nbxtensor-0.1.9/tests/test_a_run_s_end_synchronises_only_where_a_mid_run_release_would.py +41 -0
  168. nbxtensor-0.1.9/tests/test_a_sampler_s_filters_keep_what_transformers_keeps.py +71 -0
  169. nbxtensor-0.1.9/tests/test_a_sequence_decodes_past_the_card_s_pages.py +221 -0
  170. nbxtensor-0.1.9/tests/test_a_setting_not_served_says_why.py +32 -0
  171. nbxtensor-0.1.9/tests/test_a_shadow_installs_where_the_runtime_has_no_driver.py +65 -0
  172. nbxtensor-0.1.9/tests/test_a_shadow_never_reads_a_host_copy_of_a_shadow_value.py +30 -0
  173. nbxtensor-0.1.9/tests/test_a_shadow_value_read_keys_off_the_dtype_name.py +45 -0
  174. nbxtensor-0.1.9/tests/test_a_single_card_plan_replays_as_one_graph.py +46 -0
  175. nbxtensor-0.1.9/tests/test_a_slot_store_ends_its_request_and_is_released_by_the_library.py +59 -0
  176. nbxtensor-0.1.9/tests/test_a_small_tensor_never_pins_a_large_block.py +52 -0
  177. nbxtensor-0.1.9/tests/test_a_spilled_sequence_attends_as_one.py +115 -0
  178. nbxtensor-0.1.9/tests/test_a_stack_of_stored_tensors_is_built_one_source_at_a_time.py +115 -0
  179. nbxtensor-0.1.9/tests/test_a_step_stabilizer_measures_once_then_serves_one_recycled_slab.py +86 -0
  180. nbxtensor-0.1.9/tests/test_a_stored_bf16_weight_is_measured_from_its_bytes.py +34 -0
  181. nbxtensor-0.1.9/tests/test_a_sweep_refused_everywhere_says_so.py +35 -0
  182. nbxtensor-0.1.9/tests/test_a_table_pin_holder_holds_one_pin_per_set_of_wraps.py +36 -0
  183. nbxtensor-0.1.9/tests/test_a_tensor_is_compared_bit_for_bit_and_knows_its_allocation.py +70 -0
  184. nbxtensor-0.1.9/tests/test_a_token_bitmask_leaves_only_the_allowed_logits.py +85 -0
  185. nbxtensor-0.1.9/tests/test_a_triton_kernel_compiles_for_amd_and_launches_through_hip.py +115 -0
  186. nbxtensor-0.1.9/tests/test_a_tuner_imported_late_gets_its_stored_settings.py +51 -0
  187. nbxtensor-0.1.9/tests/test_a_view_of_freed_memory_is_copied_out_first.py +44 -0
  188. nbxtensor-0.1.9/tests/test_a_weight_block_uploads_on_its_copy_stream.py +113 -0
  189. nbxtensor-0.1.9/tests/test_a_weight_set_is_released_after_its_devices_drain.py +96 -0
  190. nbxtensor-0.1.9/tests/test_a_weight_sets_memory_is_counted_then_held_by_the_library.py +75 -0
  191. nbxtensor-0.1.9/tests/test_allocator_interceptor.py +159 -0
  192. nbxtensor-0.1.9/tests/test_an_arena_counts_what_it_holds.py +25 -0
  193. nbxtensor-0.1.9/tests/test_an_array_enters_at_a_dtype_the_backend_has.py +52 -0
  194. nbxtensor-0.1.9/tests/test_an_array_is_placed_on_the_device_it_names.py +84 -0
  195. nbxtensor-0.1.9/tests/test_an_array_is_taken_in_through_dlpack.py +94 -0
  196. nbxtensor-0.1.9/tests/test_an_attention_returns_its_rows_log_sum_exp.py +91 -0
  197. nbxtensor-0.1.9/tests/test_an_axis_is_read_and_written_a_slice_at_a_time.py +66 -0
  198. nbxtensor-0.1.9/tests/test_an_embedding_is_pooled_as_its_model_declares.py +41 -0
  199. nbxtensor-0.1.9/tests/test_an_expert_table_keeps_its_experts_alive.py +42 -0
  200. nbxtensor-0.1.9/tests/test_an_inspection_reads_every_value_once_on_the_host.py +80 -0
  201. nbxtensor-0.1.9/tests/test_array_api_promotion.py +70 -0
  202. nbxtensor-0.1.9/tests/test_blas_on_macos_14_runs_without_thread_control.py +76 -0
  203. nbxtensor-0.1.9/tests/test_cpu_pool.py +85 -0
  204. nbxtensor-0.1.9/tests/test_device_facts.py +55 -0
  205. nbxtensor-0.1.9/tests/test_device_files.py +25 -0
  206. nbxtensor-0.1.9/tests/test_device_memory.py +63 -0
  207. nbxtensor-0.1.9/tests/test_dtype_convert.py +58 -0
  208. nbxtensor-0.1.9/tests/test_dtype_outputs.py +63 -0
  209. nbxtensor-0.1.9/tests/test_dtype_promotion.py +60 -0
  210. nbxtensor-0.1.9/tests/test_gathered_kv_pages_are_the_per_layer_copies_bits.py +118 -0
  211. nbxtensor-0.1.9/tests/test_host.py +50 -0
  212. nbxtensor-0.1.9/tests/test_install_metal_fetches_only_what_it_names.py +186 -0
  213. nbxtensor-0.1.9/tests/test_io_bf16_split.py +20 -0
  214. nbxtensor-0.1.9/tests/test_io_read_rate.py +85 -0
  215. nbxtensor-0.1.9/tests/test_it_installs_on_a_mac.py +23 -0
  216. nbxtensor-0.1.9/tests/test_keys_are_read_in_the_queries_order_and_one_head_per_group.py +52 -0
  217. nbxtensor-0.1.9/tests/test_level_zero_states_an_integrated_gpu.py +130 -0
  218. nbxtensor-0.1.9/tests/test_nbx_dtype.py +37 -0
  219. nbxtensor-0.1.9/tests/test_no_environment_switch_changes_a_kernel.py +29 -0
  220. nbxtensor-0.1.9/tests/test_one_token_of_the_gated_delta_rule_on_a_device_is_its_oracle.py +97 -0
  221. nbxtensor-0.1.9/tests/test_one_token_of_the_moe_route_on_a_device_is_its_oracle.py +132 -0
  222. nbxtensor-0.1.9/tests/test_ops_cost.py +63 -0
  223. nbxtensor-0.1.9/tests/test_policy.py +55 -0
  224. nbxtensor-0.1.9/tests/test_readme.py +39 -0
  225. nbxtensor-0.1.9/tests/test_shape.py +56 -0
  226. nbxtensor-0.1.9/tests/test_the_allocator_peak_is_read_and_restarted_through_the_memory_api.py +18 -0
  227. nbxtensor-0.1.9/tests/test_the_allocator_states_its_pool_and_its_blocks.py +45 -0
  228. nbxtensor-0.1.9/tests/test_the_attention_reference_is_softmax_qk_v_in_float64.py +34 -0
  229. nbxtensor-0.1.9/tests/test_the_backend_is_the_card_on_the_machine.py +19 -0
  230. nbxtensor-0.1.9/tests/test_the_chunked_gated_delta_rule_costs_its_workspace.py +83 -0
  231. nbxtensor-0.1.9/tests/test_the_chunked_gated_delta_rule_is_its_oracle_on_the_interpreter.py +74 -0
  232. nbxtensor-0.1.9/tests/test_the_chunked_gated_delta_rule_on_a_device_is_its_oracle.py +136 -0
  233. nbxtensor-0.1.9/tests/test_the_compile_target_and_the_pool_s_counters_are_read_through_the_doors.py +47 -0
  234. nbxtensor-0.1.9/tests/test_the_compiler_key_is_prewarmed.py +23 -0
  235. nbxtensor-0.1.9/tests/test_the_delta_rule_oracle_is_the_recurrence_the_vendor_computes.py +95 -0
  236. nbxtensor-0.1.9/tests/test_the_device_door_answers_from_the_allocator.py +70 -0
  237. nbxtensor-0.1.9/tests/test_the_device_door_installs_a_shadow_and_declares_a_target.py +100 -0
  238. nbxtensor-0.1.9/tests/test_the_expert_slots_copy_with_the_measured_launch.py +39 -0
  239. nbxtensor-0.1.9/tests/test_the_expert_slots_hold_what_the_host_copied.py +205 -0
  240. nbxtensor-0.1.9/tests/test_the_expert_slots_live_in_one_allocation.py +126 -0
  241. nbxtensor-0.1.9/tests/test_the_fp16_range_scan_names_the_first_weight_outside_the_range.py +71 -0
  242. nbxtensor-0.1.9/tests/test_the_fused_moe_op_refuses_before_any_device.py +89 -0
  243. nbxtensor-0.1.9/tests/test_the_gated_delta_rule_is_an_op_of_the_library.py +101 -0
  244. nbxtensor-0.1.9/tests/test_the_gated_delta_rule_op_runs_the_form_its_census_certifies.py +159 -0
  245. nbxtensor-0.1.9/tests/test_the_gated_delta_rule_over_a_length_on_a_device_is_its_oracle.py +138 -0
  246. nbxtensor-0.1.9/tests/test_the_gated_delta_rule_runs_over_a_symbolic_length.py +201 -0
  247. nbxtensor-0.1.9/tests/test_the_hip_driver_keeps_the_launch_contract.py +174 -0
  248. nbxtensor-0.1.9/tests/test_the_host_sees_slots_a_replayed_step_moved.py +71 -0
  249. nbxtensor-0.1.9/tests/test_the_int4_moe_decode_band_matches_the_oracle.py +384 -0
  250. nbxtensor-0.1.9/tests/test_the_kv_host_tier_keeps_whole_pages_by_prefix.py +85 -0
  251. nbxtensor-0.1.9/tests/test_the_launcher_refuses_a_backend_it_has_no_driver_for.py +42 -0
  252. nbxtensor-0.1.9/tests/test_the_level_zero_backend_keeps_its_contracts.py +423 -0
  253. nbxtensor-0.1.9/tests/test_the_level_zero_driver_issues_the_recorded_ze_calls.py +229 -0
  254. nbxtensor-0.1.9/tests/test_the_malloc_trace_names_the_wrapper.py +25 -0
  255. nbxtensor-0.1.9/tests/test_the_matmul_oracle_is_windowed_by_rows_above_the_cap.py +51 -0
  256. nbxtensor-0.1.9/tests/test_the_metal_dispatch_facts_are_declared_or_refused.py +31 -0
  257. nbxtensor-0.1.9/tests/test_the_moe_route_device_comparison_goes_red_on_a_wrong_set_or_weights.py +73 -0
  258. nbxtensor-0.1.9/tests/test_the_moe_route_oracle_is_the_routing_written_by_hand.py +93 -0
  259. nbxtensor-0.1.9/tests/test_the_moe_table_refuses_experts_of_two_layouts.py +37 -0
  260. nbxtensor-0.1.9/tests/test_the_oracle_reads_only_its_windows_off_the_device.py +85 -0
  261. nbxtensor-0.1.9/tests/test_the_pool_states_its_rules_for_a_device.py +52 -0
  262. nbxtensor-0.1.9/tests/test_the_routing_of_a_mixture_of_experts_is_an_op_of_the_library.py +112 -0
  263. nbxtensor-0.1.9/tests/test_the_shadow_device_answers_without_a_driver.py +82 -0
  264. nbxtensor-0.1.9/tests/test_the_shadow_reads_a_dtype_by_name_not_by_str.py +49 -0
  265. nbxtensor-0.1.9/tests/test_the_sync_counter_names_each_metal_kernel.py +18 -0
  266. nbxtensor-0.1.9/tests/test_third_party_notices.py +81 -0
  267. nbxtensor-0.1.9/tests/test_tiles_are_cut_padded_and_crossfaded.py +50 -0
  268. nbxtensor-0.1.9/tests/test_two_views_of_one_layout_are_the_same_memory.py +35 -0
  269. nbxtensor-0.1.9/tests/test_version.py +23 -0
  270. nbxtensor-0.1.9/tools/kernels_provenance_audit.py +99 -0
  271. nbxtensor-0.1.9/tools/measure_the_chunked_gated_delta_rule.py +292 -0
  272. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/tools/scatter_scan.py +3 -0
  273. nbxtensor-0.1.7/.gitignore +0 -311
  274. nbxtensor-0.1.7/src/nbxtensor/device.py +0 -79
  275. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/.github/PULL_REQUEST_TEMPLATE/certificate.md +0 -0
  276. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/.github/workflows/cla.yml +0 -0
  277. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/CONTRIBUTING.md +0 -0
  278. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/LICENSE +0 -0
  279. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/NOTICE +0 -0
  280. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/assets/logo.png +0 -0
  281. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/docs/BACKENDS.md +0 -0
  282. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/docs/api_undocumented.txt +0 -0
  283. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/docs/certified-autotune-method.md +0 -0
  284. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/docs/design/ALLOCATOR.md +0 -0
  285. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/docs/design/COST.md +0 -0
  286. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/docs/design/DESIGN.md +0 -0
  287. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/docs/device_file_template.yml +0 -0
  288. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/docs/device_keys.txt +0 -0
  289. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/docs/history/INVENTORY.md +0 -0
  290. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/docs/history/MIGRATION.md +0 -0
  291. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/docs/history/migration_list.tsv +0 -0
  292. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/docs/replay-recording-in-a-one-shot-request.md +0 -0
  293. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/docs/tensor-cores-through-linear-layouts.md +0 -0
  294. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/docs/triton_cpu_install.md +0 -0
  295. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/__main__.py +0 -0
  296. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/backend/__init__.py +0 -0
  297. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/backend/capabilities.py +0 -0
  298. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/backend/cpu/__init__.py +0 -0
  299. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/backend/cpu/blas.py +0 -0
  300. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/backend/cpu/pool.py +0 -0
  301. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/backend/cpu_backend.py +0 -0
  302. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/backend/device_facts.py +0 -0
  303. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/backend/device_files.py +0 -0
  304. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/backend/device_measure.py +0 -0
  305. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/backend/device_names.py +0 -0
  306. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/backend/devices/amd/cdna.yml +0 -0
  307. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/backend/devices/amd/cdna2.yml +0 -0
  308. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/backend/devices/amd/cdna3.yml +0 -0
  309. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/backend/devices/amd/cdna4.yml +0 -0
  310. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/backend/devices/amd/rdna3.yml +0 -0
  311. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/backend/devices/amd/rdna4.yml +0 -0
  312. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/backend/devices/apple/apple_m1.yml +0 -0
  313. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/backend/devices/apple/apple_m1_max.yml +0 -0
  314. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/backend/devices/apple/apple_m1_pro.yml +0 -0
  315. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/backend/devices/apple/apple_m1_ultra.yml +0 -0
  316. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/backend/devices/apple/apple_m2.yml +0 -0
  317. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/backend/devices/apple/apple_m2_max.yml +0 -0
  318. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/backend/devices/apple/apple_m2_pro.yml +0 -0
  319. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/backend/devices/apple/apple_m2_ultra.yml +0 -0
  320. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/backend/devices/apple/apple_m3.yml +0 -0
  321. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/backend/devices/apple/apple_m3_max.yml +0 -0
  322. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/backend/devices/apple/apple_m3_pro.yml +0 -0
  323. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/backend/devices/apple/apple_m3_ultra.yml +0 -0
  324. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/backend/devices/apple/apple_m4.yml +0 -0
  325. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/backend/devices/apple/apple_m4_max.yml +0 -0
  326. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/backend/devices/apple/apple_m5.yml +0 -0
  327. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/backend/devices/apple/apple_m5_max.yml +0 -0
  328. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/backend/devices/apple/apple_m5_pro.yml +0 -0
  329. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/backend/devices/apple/apple_m5_ultra.yml +0 -0
  330. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/backend/devices/apple/apple_m6.yml +0 -0
  331. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/backend/devices/apple/apple_silicon.yml +0 -0
  332. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/backend/devices/intel/arl_h.yml +0 -0
  333. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/backend/devices/intel/arl_s.yml +0 -0
  334. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/backend/devices/intel/bmg.yml +0 -0
  335. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/backend/devices/intel/dg2.yml +0 -0
  336. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/backend/devices/intel/lnl.yml +0 -0
  337. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/backend/devices/intel/mtl.yml +0 -0
  338. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/backend/devices/intel/ptl_h.yml +0 -0
  339. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/backend/devices/intel/ptl_u.yml +0 -0
  340. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/backend/devices/intel/pvc.yml +0 -0
  341. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/backend/devices/intel/wcl.yml +0 -0
  342. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/backend/devices/intel/xe_lp.yml +0 -0
  343. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/backend/devices/nvidia/ampere.yml +0 -0
  344. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/backend/devices/nvidia/hopper.yml +0 -0
  345. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/backend/devices/nvidia/volta.yml +0 -0
  346. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/backend/faults.py +0 -0
  347. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/backend/host_memory.py +0 -0
  348. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/backend/install_help.py +0 -0
  349. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/backend/install_metal.py +0 -0
  350. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/backend/install_steps.yml +0 -0
  351. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/backend/launcher_contract.py +0 -0
  352. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/backend/level_zero.py +0 -0
  353. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/backend/level_zero_driver.py +0 -0
  354. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/backend/libnames.py +0 -0
  355. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/backend/metal_backend.py +0 -0
  356. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/backend/process_memory.py +0 -0
  357. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/backend/runtime.py +0 -0
  358. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/dtype/__init__.py +0 -0
  359. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/dtype/convert.py +0 -0
  360. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/dtype/dtypes.yml +0 -0
  361. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/dtype/nbx_dtype.py +0 -0
  362. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/dtype/operands.py +0 -0
  363. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/dtype/outputs.py +0 -0
  364. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/dtype/policy.py +0 -0
  365. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/dtype/policy.yml +0 -0
  366. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/dtype/promotion.py +0 -0
  367. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/host.py +0 -0
  368. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/inspection.py +0 -0
  369. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/interop/__init__.py +0 -0
  370. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/interop/dlpack.py +0 -0
  371. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/interop/handoff.py +0 -0
  372. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/io/__init__.py +0 -0
  373. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/io/constants.py +0 -0
  374. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/io/mapped_shards.py +0 -0
  375. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/io/read_rate.py +0 -0
  376. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/memory/arena.py +0 -0
  377. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/memory/block_upload.py +0 -0
  378. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/memory/device_memory.py +0 -0
  379. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/memory/device_transfer.py +0 -0
  380. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/memory/expert_slots.py +0 -0
  381. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/memory/host_spill.py +0 -0
  382. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/memory/kv_host_pages.py +0 -0
  383. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/memory/kv_host_tier.py +0 -0
  384. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/memory/kv_session.py +0 -0
  385. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/memory/layout.py +0 -0
  386. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/memory/memory_pool.py +0 -0
  387. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/memory/metal.py +0 -0
  388. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/memory/oom_advice.py +0 -0
  389. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/memory/pages.py +0 -0
  390. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/memory/pointer_tables.py +0 -0
  391. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/memory/pool.py +0 -0
  392. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/memory/slab.py +0 -0
  393. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/memory/slot_stores.py +0 -0
  394. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/memory/step_stabilizer.py +0 -0
  395. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/memory/to_device_census.py +0 -0
  396. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/memory/trace_replay.py +0 -0
  397. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/memory/traces/sana-video-2b-720p.16g.2026-11-02.tsv +0 -0
  398. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/__init__.py +0 -0
  399. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/_autotune_policy.py +0 -0
  400. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/_configs.py +0 -0
  401. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/abs.py +0 -0
  402. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/adaptive_avg_pool2d.py +0 -0
  403. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/add.py +0 -0
  404. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/amax.py +0 -0
  405. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/atan2.py +0 -0
  406. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/attention_wrappers.py +0 -0
  407. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/autotune_bucket.py +0 -0
  408. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/autotune_harness.py +0 -0
  409. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/autotune_refusals.py +0 -0
  410. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/autotune_settings.py +0 -0
  411. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/axis_slices.py +0 -0
  412. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/binary_strided.py +0 -0
  413. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/bucketize.py +0 -0
  414. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/certified_index.py +0 -0
  415. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/clamp.py +0 -0
  416. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/clamp_min.py +0 -0
  417. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/conv_depthwise2d.py +0 -0
  418. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/conv_transpose2d.py +0 -0
  419. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/copy.py +0 -0
  420. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/cos.py +0 -0
  421. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/decode_attn_vec.py +0 -0
  422. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/depthwise_conv2d.py +0 -0
  423. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/dequant_gemv.py +0 -0
  424. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/dft.py +0 -0
  425. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/div.py +0 -0
  426. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/dropout.py +0 -0
  427. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/dtype_convert.py +0 -0
  428. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/elementwise_launch.py +0 -0
  429. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/elu.py +0 -0
  430. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/embedding_pool.py +0 -0
  431. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/eq.py +0 -0
  432. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/erf.py +0 -0
  433. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/exp.py +0 -0
  434. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/fft_op.py +0 -0
  435. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/fill_op.py +0 -0
  436. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/flash_decode.py +0 -0
  437. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/floor.py +0 -0
  438. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/full_op.py +0 -0
  439. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/fused_upsample_conv.py +0 -0
  440. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/ge.py +0 -0
  441. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/gelu.py +0 -0
  442. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/grid_sampler.py +0 -0
  443. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/group_norm_tiled.py +0 -0
  444. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/groupnorm.py +0 -0
  445. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/gt.py +0 -0
  446. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/hardsigmoid.py +0 -0
  447. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/hardswish.py +0 -0
  448. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/host_decode_partial.py +0 -0
  449. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/im2col.py +0 -0
  450. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/index_add.py +0 -0
  451. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/index_put_op.py +0 -0
  452. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/index_wrappers.py +0 -0
  453. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/launch_observer.py +0 -0
  454. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/leaky_relu.py +0 -0
  455. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/log.py +0 -0
  456. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/loss_wrappers.py +0 -0
  457. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/lt.py +0 -0
  458. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/masked_fill.py +0 -0
  459. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/matmul.py +0 -0
  460. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/maximum.py +0 -0
  461. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/mean.py +0 -0
  462. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/minimum.py +0 -0
  463. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/mish.py +0 -0
  464. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/moe_align.py +0 -0
  465. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/moe_decode_vec.py +0 -0
  466. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/moe_device_residency.py +0 -0
  467. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/moe_fused.py +0 -0
  468. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/moe_multi_device.py +0 -0
  469. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/moe_wrappers.py +0 -0
  470. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/mul.py +0 -0
  471. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/ne.py +0 -0
  472. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/neg.py +0 -0
  473. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/nonzero.py +0 -0
  474. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/norm_wrappers.py +0 -0
  475. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/ones_op.py +0 -0
  476. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/oracles/__init__.py +0 -0
  477. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/oracles/attention_fp64.py +0 -0
  478. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/oracles/conv2d_fp64.py +0 -0
  479. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/paged_decode_attn.py +0 -0
  480. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/pixel_shuffle.py +0 -0
  481. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/pixel_unshuffle.py +0 -0
  482. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/pow.py +0 -0
  483. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/rand_op.py +0 -0
  484. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/random_wrappers.py +0 -0
  485. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/reciprocal.py +0 -0
  486. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/reduction_wrappers.py +0 -0
  487. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/relu.py +0 -0
  488. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/remainder.py +0 -0
  489. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/repeat_op.py +0 -0
  490. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/residual_chain.py +0 -0
  491. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/rsqrt.py +0 -0
  492. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/screen_oracle.py +0 -0
  493. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/selu.py +0 -0
  494. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/shape_wrappers.py +0 -0
  495. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/sigmoid.py +0 -0
  496. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/silu.py +0 -0
  497. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/sin.py +0 -0
  498. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/spectral_wrappers.py +0 -0
  499. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/sqrt.py +0 -0
  500. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/strided_copy.py +0 -0
  501. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/sub.py +0 -0
  502. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/sum.py +0 -0
  503. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/tanh.py +0 -0
  504. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/tiles.py +0 -0
  505. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/tiling.yml +0 -0
  506. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/tiling_policy.py +0 -0
  507. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/tiling_sizes.py +0 -0
  508. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/token_bitmask.py +0 -0
  509. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/token_filters.py +0 -0
  510. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/unfold_op.py +0 -0
  511. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/upsample_bilinear2d.py +0 -0
  512. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/upsample_nearest3d.py +0 -0
  513. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/where.py +0 -0
  514. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/wrappers.py +0 -0
  515. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/ops/zeros_op.py +0 -0
  516. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/quant/__init__.py +0 -0
  517. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/quant/quantized_tensor.py +0 -0
  518. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/random/__init__.py +0 -0
  519. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/random/mt_randn.py +0 -0
  520. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/random/rng_pin.py +0 -0
  521. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/random/rng_stream.py +0 -0
  522. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/random/seeded_draw.py +0 -0
  523. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/shape/__init__.py +0 -0
  524. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/tensor.py +0 -0
  525. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/src/nbxtensor/terminal.py +0 -0
  526. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/tools/device_key_census.py +0 -0
  527. {nbxtensor-0.1.7 → nbxtensor-0.1.9}/tools/device_key_trace.py +0 -0
@@ -0,0 +1,2 @@
1
+ __pycache__/
2
+ *.pyc
@@ -7,6 +7,59 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.1.9] - 2026-11-17
11
+
12
+ ### Added
13
+ - The gated delta rule over a sequence has a chunked form beside its serial scan
14
+ (`nbxtensor.ops.gated_delta_rule_chunked.gated_delta_rule_chunked_wrapper`, ported from flash-linear-attention, MIT):
15
+ 64 tokens solved at a time with matrix products, every product and the state float32, the state handed to and from
16
+ the serial scan unchanged. Its cost is `nbxtensor.ops._cost.gated_delta_rule_chunked` (the float32 workspace by name),
17
+ its launch keys `launch_keys.gated_delta_rule_chunked_launches`.
18
+ - The op `gated_delta_rule` runs the form the census beside the kernel (`ops/gated_delta_rule_census.json`) certifies
19
+ for the call's dimensions: one token always runs the serial scan; a call whose dimensions are in no cell is refused
20
+ by name. Every cell ships uncertified (the serial scan runs, the output bytes unchanged) until
21
+ `tools/measure_the_chunked_gated_delta_rule.py` measures it on a card against the serial scan and flash-linear-
22
+ attention's chunk form.
23
+ - `nbxtensor.io.safetensors.stack_shards` / `concat_shards` (`ShardRef`, `ShardConcat`, `ShardStack`): one parameter
24
+ built from several stored tensors, in the stored dtype, peak memory the result plus one source; disagreements raise
25
+ `ShardsRefused` naming the sources.
26
+ - `nbxtensor.ops.moe_route.moe_route`: the routing of a mixture-of-experts layer for one token as one kernel (the
27
+ float32 router product, sigmoid or softmax scores, an optional choice bias, grouped or ungrouped top-k, the
28
+ renormalised and scaled weights), refused by name outside its shapes, dtypes and attributes; its launch key
29
+ `launch_keys.moe_route_launches`, its float64 reference `oracles.fp64.moe_route_oracle`. It stays outside the
30
+ dispatch table and reaches `fused_moe` through its precomputed-routing entry.
31
+
32
+ ## [0.1.8] - 2026-11-15
33
+
34
+ ### Added
35
+ - `nbxtensor.memory.peak_memory_allocated(device)`, `reset_peak_memory(device)` and `pool_stats()`: the allocator's
36
+ peak, its restart and the pool's counters through the public API.
37
+ - `nbxtensor.device.target_name()` (`<backend>-<arch>`, as measured and certified settings are keyed),
38
+ `declare_target(maker, capability)` and `install_shadow(devices)` (a card-less process that forms every launch key a
39
+ run would, refused with `DevicesVisible` while a device is in sight); `TargetNotDeclarable` names a target that
40
+ cannot be formed from a capability number.
41
+ - `nbxtensor.profile.kernel_times()`: where a real run's GPU time goes on Metal, kernel by kernel (and the copies as
42
+ one row). Inside it every launch runs alone and is timed on the GPU at its own boundaries: the table ranks kernels;
43
+ it is not the production speed, and its header says so. The output bytes do not change.
44
+
45
+ ### Changed
46
+ - The replay runs as CUDA graphs wherever the backend offers them, on one card too: a plan recorded on one card (the
47
+ record naming its card, a device sync on that card) is captured as one graph; a plan that crosses cards is refused by
48
+ name before any capture, and a refused capture keeps the direct replay for its bucket. The opt-in switch
49
+ (`NBX_REPLAY_GRAPH`) is gone; the output bytes are identical.
50
+ - The fused SwiGLU with split gate and up tensors runs as one element-wise launch at the element-wise class's certified
51
+ tile (its fixed 16 x 1024 tile spilled): the same bytes.
52
+ - On an Apple M4 Pro the command stream is committed every 16 dispatches (`backend/devices/apple/apple_m4_pro.yml`):
53
+ the GPU starts a step while the host is still encoding it.
54
+
55
+ ### Fixed
56
+ - `served_certification` answers what a launch is served: a key certified under its generator's alias (the one hop
57
+ a launch's lookup takes) is found by a planner too, so a plan no longer counts a served key as missing.
58
+ - A peer question the GPU runtime fails is refused by name (`DeviceAllocator.can_access_peer`), never read as "no
59
+ peer"; the expandable memory range asks that one door which cards may reach its memory.
60
+ - `install_shadow(devices)` installs on a host whose GPU runtime is there without its driver (it sees no device);
61
+ a driver that loads and refuses still raises its `DeviceQueryError`.
62
+
10
63
  ## [0.1.7] - 2026-11-13
11
64
 
12
65
  ### Changed
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: nbxtensor
3
- Version: 0.1.7
3
+ Version: 0.1.9
4
4
  Summary: Run AI models without PyTorch: tensors, Triton kernels, planned memory and certified tuning, wherever Triton runs — NVIDIA, AMD, Intel and Apple GPUs.
5
5
  Project-URL: Homepage, https://github.com/NeuroBrix/nbxtensor
6
6
  Project-URL: Source, https://github.com/NeuroBrix/nbxtensor
@@ -504,6 +504,24 @@ CUDA (NVIDIA), HIP (AMD), Level Zero (Intel) and Apple Metal through triton-ext;
504
504
  `backend_table()` its entry points, `device_memory()` its memory primitives, and `set_device(tensor)` binds the
505
505
  driver to a tensor's device before a launch.
506
506
 
507
+ ## Kernels
508
+
509
+ Whose kernels these are, file by file, is written in [`docs/kernels_provenance.md`](docs/kernels_provenance.md); the
510
+ licence texts are in [`THIRD_PARTY_NOTICES.md`](THIRD_PARTY_NOTICES.md).
511
+
512
+ - **NeuroBrix's own** (Copyright NeuroBrix, Apache-2.0): the m8n8k4 family (`mma_m8n8k4`, `flash_attention_m8n8k4`,
513
+ `conv2d_m8n8k4`, `matmul_m8n8k4`, `fused_moe_m8n8k4`) and the card measurement tool. No upstream source exists for them.
514
+ - **Rewritten by NeuroBrix** from [FlagGems](https://github.com/FlagOpen/FlagGems) (Apache-2.0),
515
+ [attorch](https://github.com/BobMcDear/attorch) (MIT), [Liger-Kernel](https://github.com/linkedin/Liger-Kernel)
516
+ (BSD-2-Clause) and [flash-attention](https://github.com/Dao-AILab/flash-attention) (BSD-3-Clause): each such file says
517
+ so in its header, states what was rewritten, and keeps the original provenance statement. The chunked gated delta rule
518
+ is rewritten from [flash-linear-attention](https://github.com/fla-org/flash-linear-attention) (MIT) and is classed
519
+ once its rewrite lands.
520
+ - **Copied unchanged**: none; a file copied unchanged would carry the original notice alone.
521
+ - A file the audit could not class with evidence is listed `UNSURE` in the table and its header is left as it is.
522
+
523
+ Original notices are kept everywhere; none is removed or shortened.
524
+
507
525
  ## Exchange with other libraries: DLPack
508
526
 
509
527
  nbxtensor speaks DLPack and nothing else: `Tensor.__dlpack__` / `__dlpack_device__` and `nbxtensor.from_dlpack(x)`
@@ -481,6 +481,24 @@ CUDA (NVIDIA), HIP (AMD), Level Zero (Intel) and Apple Metal through triton-ext;
481
481
  `backend_table()` its entry points, `device_memory()` its memory primitives, and `set_device(tensor)` binds the
482
482
  driver to a tensor's device before a launch.
483
483
 
484
+ ## Kernels
485
+
486
+ Whose kernels these are, file by file, is written in [`docs/kernels_provenance.md`](docs/kernels_provenance.md); the
487
+ licence texts are in [`THIRD_PARTY_NOTICES.md`](THIRD_PARTY_NOTICES.md).
488
+
489
+ - **NeuroBrix's own** (Copyright NeuroBrix, Apache-2.0): the m8n8k4 family (`mma_m8n8k4`, `flash_attention_m8n8k4`,
490
+ `conv2d_m8n8k4`, `matmul_m8n8k4`, `fused_moe_m8n8k4`) and the card measurement tool. No upstream source exists for them.
491
+ - **Rewritten by NeuroBrix** from [FlagGems](https://github.com/FlagOpen/FlagGems) (Apache-2.0),
492
+ [attorch](https://github.com/BobMcDear/attorch) (MIT), [Liger-Kernel](https://github.com/linkedin/Liger-Kernel)
493
+ (BSD-2-Clause) and [flash-attention](https://github.com/Dao-AILab/flash-attention) (BSD-3-Clause): each such file says
494
+ so in its header, states what was rewritten, and keeps the original provenance statement. The chunked gated delta rule
495
+ is rewritten from [flash-linear-attention](https://github.com/fla-org/flash-linear-attention) (MIT) and is classed
496
+ once its rewrite lands.
497
+ - **Copied unchanged**: none; a file copied unchanged would carry the original notice alone.
498
+ - A file the audit could not class with evidence is listed `UNSURE` in the table and its header is left as it is.
499
+
500
+ Original notices are kept everywhere; none is removed or shortened.
501
+
484
502
  ## Exchange with other libraries: DLPack
485
503
 
486
504
  nbxtensor speaks DLPack and nothing else: `Tensor.__dlpack__` / `__dlpack_device__` and `nbxtensor.from_dlpack(x)`
@@ -14,6 +14,7 @@ carried when the code was taken).
14
14
  | [BobMcDear/attorch](https://github.com/BobMcDear/attorch) | MIT | `ops/_common.py`, `ops/conv2d.py`, `ops/conv_wrappers.py`, `ops/cross_entropy.py`, `ops/glu.py`, `ops/layernorm.py`, `ops/rmsnorm.py`, `ops/softmax.py` |
15
15
  | [linkedin/Liger-Kernel](https://github.com/linkedin/Liger-Kernel) | BSD-2-Clause | `ops/rope.py` |
16
16
  | [Dao-AILab/flash-attention](https://github.com/Dao-AILab/flash-attention) | BSD-3-Clause | `ops/flash_attention.py` (from the upstream flash_attn_triton.py), `ops/elementwise_wrappers.py` (its wrapper) |
17
+ | [fla-org/flash-linear-attention](https://github.com/fla-org/flash-linear-attention) | MIT | `ops/gated_delta_rule_chunked.py` (its chunked gated delta rule forward, re-written; **pinned**: the PyPI release fla-core 0.6.0, its source files named by their sha256 in the file's header) |
17
18
 
18
19
  FlagGems publishes no NOTICE file; its Apache-2.0 license is reproduced below, and the changes are stated in each
19
20
  file's header.
@@ -285,3 +286,26 @@ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
285
286
  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
286
287
  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
287
288
  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
289
+
290
+ ### fla-org/flash-linear-attention — MIT
291
+ MIT License
292
+
293
+ Copyright (c) 2023-2026 Songlin Yang, Yu Zhang, Zhiyuan Li
294
+
295
+ Permission is hereby granted, free of charge, to any person obtaining a copy
296
+ of this software and associated documentation files (the "Software"), to deal
297
+ in the Software without restriction, including without limitation the rights
298
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
299
+ copies of the Software, and to permit persons to whom the Software is
300
+ furnished to do so, subject to the following conditions:
301
+
302
+ The above copyright notice and this permission notice shall be included in all
303
+ copies or substantial portions of the Software.
304
+
305
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
306
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
307
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
308
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
309
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
310
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
311
+ SOFTWARE.
@@ -138,10 +138,13 @@ def pool_fit_slack(vendor, architecture) -> float # pool.fit_slack
138
138
  # the allocator's figures and the pool's controls, same arguments as `DeviceAllocator`'s (2026-11-13):
139
139
  def memory_allocated(device_idx=None) -> int # live bytes handed out (None: every device)
140
140
  def pool_cached_bytes(device_idx=None) -> int # bytes parked in the pool's free blocks
141
+ def pool_stats() -> dict # a copy of the pool's counters (hits, miss, flushes, evictions)
141
142
  def blocks_in_use(device_idx=None) -> dict # {address: bytes} of the blocks tensors hold
142
143
  def device_free_bytes(device_idx=None) -> int # the driver's free bytes (None: current device)
143
144
  def device_total_bytes(device_idx=None) -> int # the device's total memory (refused: DeviceQueryError)
144
145
  def free_memory_mb(index: int) -> float # the driver's free memory in MB (refused: DeviceQueryError)
146
+ def peak_memory_allocated(device_idx=None) -> int # highest live bytes on a device since its last reset (None: summed)
147
+ def reset_peak_memory(device_idx=None) -> None # restart that peak from the live bytes (None: every device)
145
148
  def peak_device_bytes() -> Optional[int] # the most one device held at once since the start
146
149
  def host_pinned_allocated() -> int # live pinned host bytes
147
150
  def empty_cache_pool() -> int # the pool's parked blocks given back; bytes freed
@@ -186,6 +189,21 @@ class MetalStateFence
186
189
  # the Metal kernels' release fence (record, completed, drain(pool)) over the Apple backend handed in; one without fence() / completed_fence() refused by name
187
190
  ```
188
191
 
192
+ `nbxtensor.memory.fixed_state` — a session's fixed-size state: the kinds whose bytes do not grow with the tokens
193
+
194
+ ```python
195
+ STATE_KINDS # ("recurrent", "conv"); "kv" is the paged KV cache's and is refused by name here
196
+ class StateDeclaration(kind, shape, dtype, ops)
197
+ # recurrent: shape ["batch", heads, k_dim, v_dim], float32 always; conv: ["batch", channels, taps-1], a floating
198
+ # dtype (the op's); `ops` the ordered op ids it serves, one buffer each; shape(batch), nbytes(batch) (exact, every op)
199
+ class FixedState(declaration, batch, devices, fence=None)
200
+ # allocated at zero, each op's buffer on its device (one index, or one per op), fixed addresses until forget:
201
+ # tensor(op_id) (the buffer a kernel writes in place), write(op_id, src), zero(), reorder(index) (an index gather
202
+ # of the batch rows, in place), copy() / restore() / release_copy() (the one kept copy: refused while one is kept),
203
+ # forget(); held_bytes(), copy_bytes(), has_copy, forgotten; host rewrites inside `fence` (drain before, record
204
+ # after); every other use refused by name
205
+ ```
206
+
189
207
  `nbxtensor.memory.kv_session` — a serving session's cache between turns (pure bookkeeping)
190
208
 
191
209
  ```python
@@ -898,6 +916,8 @@ def conv2d_wrapper(x, weight, bias=None, stride=1, padding=0, dilation=1, transp
898
916
  # Convolution forward.
899
917
  def conv1d_wrapper(x, weight, bias=None, stride=1, padding=0, dilation=1, groups=1)
900
918
  # Conv1D via conv2d with unsqueeze.
919
+ def causal_conv1d_wrapper(x, weight, bias=None, state=None)
920
+ # The causal depthwise convolution over the sequence, with its state: (y, state_out); state = the last taps-1 input columns [B, C, K-1] at x's dtype.
901
921
  def conv_transpose1d_wrapper(x, weight, bias=None, stride=1, padding=0, output_padding=0, groups=1, dilation=1)
902
922
  # aten::conv_transpose1d — 1D transposed convolution.
903
923
  def avg_pool2d_wrapper(x, kernel_size, stride=None, padding=0, ceil_mode=False, count_include_pad=True, divisor_override=None)
@@ -1058,6 +1078,14 @@ def matmul_launches(a_shape, b_shape, a: NBXDtype, b: NBXDtype, native_bf16: boo
1058
1078
  # `matmul_wrapper` (and `linear_wrapper`, which calls it with the transposed weight)
1059
1079
  def lstm_launches(B: int, T: int, I: int, H: int, num_layers: int, bidirectional: bool, x: NBXDtype, native_bf16: bool)
1060
1080
  # `lstm_wrapper` -> `_lstm_run_direction`, per layer and direction
1081
+ def gated_delta_rule_launches(dk: int, dv: int, q: NBXDtype, k: NBXDtype, v: NBXDtype, g: NBXDtype, beta: NBXDtype)
1082
+ # `gated_delta_rule_wrapper`: one launch of the serial scan at any length and batch (the length is never in the key)
1083
+ def gated_delta_rule_chunked_launches(dk: int, dv: int, q: NBXDtype, k: NBXDtype, v: NBXDtype, g: NBXDtype, beta: NBXDtype)
1084
+ # `gated_delta_rule_chunked_wrapper`: its three launches (prepare, state, output) at any length and batch, keyed by dk, dv and dtype tags
1085
+ def gated_delta_rule_op_launches(B: int, L: int, Hk: int, Hv: int, dk: int, dv: int, q: NBXDtype, k: NBXDtype, v: NBXDtype, g: NBXDtype, beta: NBXDtype)
1086
+ # `gated_delta_rule_op`: the launches of the form `gated_delta_rule_path` answers (refused by name where it refuses)
1087
+ def moe_route_launches(E: int, H: int, top_k: int, hidden: NBXDtype, router_weight: NBXDtype)
1088
+ # `moe_route`: one launch, one program per token row; key (E, H, top_k) and the five operands' dtype tags (n_group never in the key)
1061
1089
  def dft_r2c_launches(M: int, N: int, onesided: bool, native_bf16: bool)
1062
1090
  # `fft_r2c_wrapper` on a length that is not a power of two
1063
1091
  def dft_c2r_launches(M: int, bins: int, N: int, native_bf16: bool)
@@ -1123,6 +1151,8 @@ def tiled_conv2d_launches(N: int, in_c: int, IH: int, IW: int, out_c: int, kh: i
1123
1151
  # The launches of an op-level tiled conv
1124
1152
  def conv_launches(x_shape, w_shape, stride, padding, dilation, transposed: bool, groups: int, x: NBXDtype, w: NBXDtype, compute: Optional[NBXDtype], band_bytes: int, depthwise_enabled: bool=True)
1125
1153
  # `conv2d_wrapper` by the weight's rank
1154
+ def causal_conv1d_launches(x_shape, w_shape, x: NBXDtype, w: NBXDtype, compute: Optional[NBXDtype], band_bytes: int, depthwise_enabled: bool=True)
1155
+ # `causal_conv1d_wrapper`: the state joined (no key), then one depthwise conv1d over [B, C, K-1+L]
1126
1156
  def softmax_feat_bucket(feat: int)
1127
1157
  # The row length's class in a softmax key
1128
1158
  def softmax_launches(rows: int, feat: int, log: bool, x: NBXDtype, out: NBXDtype)
@@ -1755,6 +1785,59 @@ def gather_kernel(inp, index, out, N, inp_dim_stride, idx_stride_outer, idx_stri
1755
1785
  # Gather kernel — works for any tensor rank via pre-computed strides.
1756
1786
  ```
1757
1787
 
1788
+ `nbxtensor.ops.gated_delta_rule`
1789
+
1790
+ ```python
1791
+ GATED_DELTA_RULE_INPUT_DTYPES = (float16, bfloat16, float32) # the dtypes q, k, v, beta may arrive in
1792
+ GATED_DELTA_RULE_COMPUTE_DTYPES = (float32,) # the compute dtype this release runs in
1793
+ GATED_DELTA_RULE_MIN_LENGTH = 1 # one token; L is symbolic above it (no token: refused by name)
1794
+ def gated_delta_rule_scan_kernel(q_ptr, k_ptr, v_ptr, g_ptr, beta_ptr, s_in_ptr, o_ptr, ...)
1795
+ # serial scan, grid (B, Hv, cdiv(dv, BV)); a dk x BV float32 state tile stays on chip; BV and warps are certified candidates
1796
+ def gated_delta_rule_shapes(q, k, v, g, beta, state=None) -> tuple
1797
+ def gated_delta_rule_dtypes(q, k, v, g, beta, state, compute_dtype) -> NBXDtype # on the operands' NBXDtypes (state None: zeros)
1798
+ def gated_delta_rule_wrapper(q, k, v, g, beta, state=None, *, qk_l2norm: bool, eps: float, scale: float, compute_dtype)
1799
+ # The gated delta rule over q, k [B, L, Hk, dk], v [B, L, Hv, dv], g, beta [B, L, Hv] from state [B, Hv, dk, dv]
1800
+ # float32 (None: zeros) -> (o [B, L, Hv, dv] at v's dtype, state_out float32), at any length L >= 1: the state
1801
+ # handed back is the next call's start (a prompt in two calls, or then one token at a time, is one recurrence).
1802
+ # Refuses by name: compute dtype not float32, g or state not float32, inputs not float16/bfloat16/float32, bad
1803
+ # shapes, Hv % Hk != 0, L < 1. No chunk size anywhere: not an argument, not in the launch key.
1804
+ GATED_DELTA_RULE_CENSUS # Path of gated_delta_rule_census.json beside the module: every call of the op, by its dimensions
1805
+ GATED_DELTA_RULE_CENSUS_FORMAT = "nbx-gated-delta-rule-census/1"
1806
+ GATED_DELTA_RULE_PATHS = ("serial", "chunked")
1807
+ def gated_delta_rule_census() -> dict
1808
+ # the census read and checked (format; every cell's B, Hk, Hv, dk, dv, dtype and chunked_from_length: null or a
1809
+ # length above one token); a file that does not hold is refused by name (RuntimeError)
1810
+ def gated_delta_rule_path(B: int, L: int, Hk: int, Hv: int, dk: int, dv: int, dtype: NBXDtype) -> str
1811
+ # "serial" for one token; otherwise the call's cell: "chunked" when its chunked_from_length is a length <= L,
1812
+ # "serial" when null or longer; dimensions in no cell: ValueError naming them and the measurement tool
1813
+ def gated_delta_rule_op(q, k, v, g, beta, state=None, *, qk_l2norm: bool, eps: float, scale: float, compute_dtype)
1814
+ # the serial scan or the chunked form, as gated_delta_rule_path answers; the same contract and state either way.
1815
+ # Dispatch name: "gated_delta_rule".
1816
+ ```
1817
+
1818
+ `nbxtensor.ops.gated_delta_rule_chunked` (ported from flash-linear-attention, MIT; `THIRD_PARTY_NOTICES.md`)
1819
+
1820
+ ```python
1821
+ GATED_DELTA_RULE_SUB_BLOCK = 16 # the sub-block of the fused triangular solve
1822
+ GATED_DELTA_RULE_CHUNK = 64 # 4 sub-blocks: the tokens solved together
1823
+ def gated_delta_rule_chunk_prepare_kernel(...) # grid (chunks, B * Hv): gc, W, U of each chunk
1824
+ def gated_delta_rule_chunk_state_kernel(...) # grid (cdiv(dv, BV), B * Hv): the serial loop over chunks, V' and the states
1825
+ def gated_delta_rule_chunk_output_kernel(...) # grid (cdiv(dv, BV), chunks, B * Hv): the output
1826
+ def gated_delta_rule_chunked_workspace(B: int, L: int, Hv: int, dk: int, dv: int) -> Dict[str, Tuple[int, ...]]
1827
+ # the float32 workspace by name: w [B, L, Hv, dk], u [B, L, Hv, dv], gc [B, L, Hv], states [B, cdiv(L, 64), Hv, dk, dv]
1828
+ def gated_delta_rule_chunked_launch(q, k, v, g, beta, state, out, state_out, ws, *, qk_l2norm: bool, eps: float, scale: float) -> None
1829
+ # the three launches over buffers already formed (the workspace by name)
1830
+ def gated_delta_rule_chunked_wrapper(q, k, v, g, beta, state=None, *, qk_l2norm: bool, eps: float, scale: float, compute_dtype)
1831
+ # the contract of gated_delta_rule_wrapper (shapes, dtypes, refusals, the state in and out float32), chunked
1832
+ ```
1833
+
1834
+ Its cost: `nbxtensor.ops._cost.gated_delta_rule(q, k, v, g, beta, state, *, qk_l2norm, compute_dtype) -> Cost` on
1835
+ `_cost.Spec`s, refused where the wrapper refuses: the output and the state out (both returned, no workspace), every
1836
+ operand read once, both outputs written once, the recurrence's flops at L tokens.
1837
+ The chunked form's: `nbxtensor.ops._cost.gated_delta_rule_chunked(q, k, v, g, beta, state, *, qk_l2norm,
1838
+ compute_dtype) -> Cost`, the same refusals: the output and the state out (returned), then the float32 workspace
1839
+ `gated_delta_rule_chunked_workspace` names; the bytes of its three launches; its products' flops per 64-token chunk.
1840
+
1758
1841
  `nbxtensor.ops.ge`
1759
1842
 
1760
1843
  ```python
@@ -2148,6 +2231,28 @@ def fused_moe_across_devices(hidden_states, flat_indices, flat_scores, tables, t
2148
2231
  # The routed SwiGLU sum of a layer whose experts sit on several devices, [M, K] on `act_dev`: for each device of `tables.device_experts`, the pairs routed to its experts are aligned there and mapped back to their flat positions, the three grouped passes run against the device's own table, and its per-token share crosses back and is added. `tables`: the layer's `PtrTables`; `n_gate`: the experts' intermediate width; `block_m`: the alignment's block (`moe_wrappers.MOE_BLOCK_M`)
2149
2232
  ```
2150
2233
 
2234
+ `nbxtensor.ops.moe_route`
2235
+
2236
+ ```python
2237
+ MOE_ROUTE_INPUT_DTYPES = (float16, bfloat16, float32) # the dtypes hidden and router_weight may arrive in
2238
+ MOE_ROUTE_SCORE_FNS = ("sigmoid", "softmax")
2239
+ MOE_ROUTE_GROUP_SCORES = ("top2_sum", "max")
2240
+ MOE_ROUTE_MAX_EXPERTS = 256 # one row of experts per program
2241
+ MOE_ROUTE_TOKENS = (1,) # the token step; more tokens are refused by name
2242
+ def moe_route_kernel(x_ptr, w_ptr, bias_ptr, idx_ptr, wt_ptr, E, H, TOP_K, N_GROUP, TOPK_GROUP, ...)
2243
+ # one program per token row: the fp32 router product over BLOCK_H tiles, scores, bias, groups, two selections, gather, renorm, scale in registers; BLOCK_H and warps are certified candidates
2244
+ def moe_route_shapes(hidden, router_weight, choice_bias) -> tuple # (T, H, E)
2245
+ def moe_route_dtypes(hidden, router_weight, choice_bias) -> None
2246
+ def moe_route_attributes(E, *, score_fn, top_k, n_group, topk_group, group_score, fill, renorm_eps, scale) -> None
2247
+ def moe_route(hidden, router_weight, *, choice_bias, score_fn, top_k, n_group, topk_group, group_score, fill, renorm_eps, scale)
2248
+ # The routing of hidden [T, H] over router_weight [E, H] (+ choice_bias [E] float32 or None) -> (indices [T, top_k]
2249
+ # int64, weights [T, top_k] float32): s = sigmoid|softmax(fp32 product), choice c = s + bias, the topk_group best of
2250
+ # n_group groups by top2_sum|max of c (the others at `fill`), top_k of c, weights = s at the chosen ids, then
2251
+ # / (sum + renorm_eps) when renorm_eps is not None, then * scale. n_group 1 = the ungrouped routing. Slots largest
2252
+ # first, the slot order not part of the contract. No attribute has a default. Refuses by name: bad shapes or dtypes,
2253
+ # E > 256, T != 1, groups that do not cut E, topk_group or top_k out of range, fill NaN or +inf, bad renorm_eps.
2254
+ ```
2255
+
2151
2256
  `nbxtensor.ops.mse_loss`
2152
2257
 
2153
2258
  ```python
@@ -2730,8 +2835,10 @@ STATE.site_of(filename) -> bool # the caller's predicate: which stack frame na
2730
2835
  install_seams() -> None # once: Triton's launch property, the allocator interceptor, NBXTensor.item's guard
2731
2836
  arm_launch_recorder(on: bool) -> None
2732
2837
  KERNEL, MEMCPY, MEMSET, SETDEV, SYNC, H2D # the action tags
2838
+ BOUND # a KERNEL action the driver resolved once (`prepare_launch`): the direct replay's, never recorded
2733
2839
  class FrozenPlan(records, slab, arena_list, input_slots, scan_limit=None, extra_scan=(), scan_slots=None)
2734
2840
  .replay(arena) -> None # rebound inputs copied in, the actions run (graphs or direct), arena restored, outputs fresh
2841
+ # (the direct replay runs each launch as the driver resolved it once, where it can)
2735
2842
  .crosses_cards() -> bool
2736
2843
  plan_of(state) / drop_plan(plans, sig) # a plan's resources, and their release (slabs retired, graph destroyed)
2737
2844
  heap_copy(t) -> NBXTensor ; copy_into(frozen, new) -> None # the copies by logical values (views kept in order)
@@ -2786,6 +2893,11 @@ def rownorm_oracle(x, w, b, layer) # layer norm (eps 1e-5) or RMS norm
2786
2893
  def row_reduce_oracle(x, red) # "mean" / "sum" / "amax" over rows
2787
2894
  def groupnorm_oracle(x, w, b) # one channel per group, eps 1e-5
2788
2895
  def conv_oracle(x, wt, stride, padding, dilation, groups)
2896
+ def head_windows(batch: int, heads: int, per_head: int) -> Optional[List[(batch row, h0, h1)]] # None when whole; a head is never cut
2897
+ class HeadWindowedOracle(blocks, head_axis, batch, heads) # windows over batch rows x independent heads, whole length kept
2898
+ def delta_rule_oracle(q, k, v, g, beta, state=None, *, qk_l2norm, eps, scale) # (out, state) float64 of the gated delta rule
2899
+ def causal_conv1d_oracle(x, weight, bias=None, state=None) -> (y, state_out) # the state joined, one shifted product a tap
2900
+ def moe_route_oracle(hidden, router_weight, choice_bias, *, score_fn, top_k, n_group, topk_group, group_score, fill, renorm_eps, scale) # (indices, weights, choice values, group scores) float64 of the routing op
2789
2901
  def host_values(t) -> np.ndarray # a kernel's output as numbers (bf16 decoded)
2790
2902
  def materialise(piece) # a device cut made contiguous before it crosses
2791
2903
  def deviation_against(out_tensor, oracle) -> float # read off the device only where the oracle measures
@@ -2828,6 +2940,16 @@ def stored_config(d) # a recorded configuration back as
2828
2940
  def config_dict(cfg) -> dict # a Triton config as a certified directory records it
2829
2941
  ```
2830
2942
 
2943
+ ### `nbxtensor.backend.cuda_launch` — a CUDA launch's refusals, dimensions and argument cells
2944
+
2945
+ ```python
2946
+ def refuse(param_counts, function, params, names, trailing) -> None # the live launch's refusals, by name
2947
+ def dims(grid, block) -> Optional[tuple] # (gx, gy, gz, bx, by, bz); None for an empty grid
2948
+ def cells(kinds) -> (storage, pointer_array) # one C cell per parameter kind, the array over them
2949
+ class BoundCudaLaunch # .run(stream): one cuLaunchKernel over its own cells
2950
+ def prepare(launch, check, param_counts, function, grid, block, shared, params, trailing) -> Optional[BoundCudaLaunch]
2951
+ ```
2952
+
2831
2953
  ### `nbxtensor.backend.launcher_contract` — the contract a launch driver meets (BACKENDS.md section 1)
2832
2954
 
2833
2955
  `nbxtensor.backend.launcher_contract`
@@ -2879,6 +3001,11 @@ def raise_failed_asserts() -> None
2879
3001
  # After a flush: raise for the first launch whose assert failed.
2880
3002
  def dispatch(pipe, stream, pointers, scalars, trailing, grid, block, exposes=False, reads=False, shared=0, barrier=False)
2881
3003
  # Encode one launch on the stream's serial compute encoder.
3004
+ def bind(pipe, pointers, scalars, grid, block, exposes=False, reads=False, shared=0, barrier=False) -> BoundLaunch
3005
+ # A launch with no trailing buffer resolved once (the checks, each pointer's allocation), refused by name as
3006
+ # bind_pointer refuses.
3007
+ class BoundLaunch
3008
+ # .run(stream): encode the resolved launch only (a frozen plan's replay: its addresses never move)
2882
3009
  ```
2883
3010
 
2884
3011
  `nbxtensor.backend.metal_device`
@@ -2913,6 +3040,34 @@ def copies(nbytes=1 << 30, reps=10) -> dict
2913
3040
 
2914
3041
  The operands come from `numpy.random.default_rng(0)`: two machines time the same values.
2915
3042
 
3043
+ ### `nbxtensor.profile` — where a real run's GPU time goes, kernel by kernel
3044
+
3045
+ ```python
3046
+ def ranked_call(fn, path=None, out=print) # fn() inside a session, its table to `out` (and `path` as JSON)
3047
+ def kernel_times() -> ContextManager[KernelTimes]
3048
+ # a profiling session around the caller's work (Metal; another backend refused by name; one per process): every
3049
+ # launch and every copy runs alone and is timed on the GPU at its own boundaries — the table RANKS kernels, it is
3050
+ # not the production step's time (the batching changes)
3051
+ class KernelTimes
3052
+ # rows: {kernel name: [launches, total ms, max ms]} ('blit' for the copies); wall_s, gpu_ms, unsampled;
3053
+ # ranked() -> [(name, launches, total ms, max ms)] heaviest first; format(top=25) -> the printed table; as_dict();
3054
+ # report(path=None, top=25) -> the table, and the whole of it written to `path` as JSON
3055
+ ```
3056
+
3057
+ `nbxtensor.backend.metal_profile` — the Metal mechanism behind it
3058
+
3059
+ ```python
3060
+ SESSION # the open session or None: the one flag the stream reads
3061
+ POOL_ASK # the sample buffers a first session asks the device for (it keeps what is granted)
3062
+ class Session(device, per_buffer)
3063
+ # open_encoder(command_buffer, kind, index, label): a launch's own encoder, sampled at 2 x index and 2 x index + 1;
3064
+ # retired(command_buffer): its samples read into the table; close() -> KernelTimes; granted_pool()
3065
+ def open_session(device, per_buffer, flush) -> KernelTimes
3066
+ def close_session(flush) -> KernelTimes
3067
+ ```
3068
+
3069
+ `MetalRuntime.open_kernel_times()`, `close_kernel_times()`; `encoder_for(stream, kind, label=None)` names the launch.
3070
+
2916
3071
  ### `nbxtensor.io.read_rate` — how fast the machine reads its weight files, by parallel reads
2917
3072
 
2918
3073
  ```python
@@ -2976,6 +3131,11 @@ def load_to_pinned_host(raw: bytes, shape: tuple, source_dtype: NBXDtype, target
2976
3131
  def place_in_arena(raw, shape: tuple, nbx_dtype: NBXDtype, np_dtype, target_dtype: NBXDtype, krsc: bool,
2977
3132
  arena: ComponentArena, target_dev: int, io) -> NBXTensor
2978
3133
  # one safetensors tensor's raw bytes placed in a component's device arena at its target dtype
3134
+ def stack_shards(sources: Sequence[ShardRef | ShardConcat | ShardStack], axis: int, out_dtype=None) -> NBXTensor
3135
+ def concat_shards(sources, axis: int, out_dtype=None) -> NBXTensor
3136
+ # ONE host tensor from stored tensors (ShardRef(path, name)), bit-equal to NBXTensor.stack / cat; peak memory =
3137
+ # result + one source; a source may itself be a ShardConcat / ShardStack (concat per expert, then stack, no
3138
+ # intermediate); dtype kept (out_dtype other than the stored one, mixed dtypes or shapes: ShardsRefused by name)
2979
3139
  def half_in_place(ptr: int, count: int, device_idx: int)
2980
3140
  # the loader's raw bf16 buffer at `ptr` rewritten in place as float16 by the library's one device conversion
2981
3141
  # (ops.wrappers.bf16_to_fp16_gpu with `out=` the same buffer)
@@ -3120,9 +3280,25 @@ def synchronize() -> None # the current device finished, through
3120
3280
  def drain(index: Optional[int] = None) -> None # every stream of a device drained; the current device restored
3121
3281
  def mem_info(index: Optional[int] = None) -> Tuple[int, int] # (free, total) bytes, as the runtime reports them
3122
3282
  def most_free() -> int # the device with the most free memory; the current device restored
3283
+ def target_name() -> str # what the process compiles for, `<backend>-<arch>` (cuda-70); a driver's refusal raised
3123
3284
  class DeviceQueryError(RuntimeError) # a device question the runtime refused: the call, the device, its code
3124
3285
  NoGpuRuntime # (backend.runtime) no GPU runtime on this host: the one refusal meaning no device
3125
- ```
3286
+ def install_shadow(devices: int) -> None # the process becomes a shadow of `devices` devices, once (memory.shadow)
3287
+ DevicesVisible # (memory.shadow) install_shadow refused: a device is in sight
3288
+ def declare_target(maker: str, capability: str) -> None # the compile target bound with no driver asked
3289
+ class TargetNotDeclarable(ValueError) # declare_target refused: a maker other than nvidia / amd, or no capability number
3290
+ ```
3291
+
3292
+ **A device with no driver asked (2026-11-13).** Two doors serve an application that derives what a run would launch
3293
+ without running it. `install_shadow(devices)` turns the process into a shadow: allocations hand out addresses that
3294
+ address nothing, no kernel launches, a value read answers a benign value (a value born on the host answers its own).
3295
+ After it, `count()` answers `devices` and `current()` answers the device `select` named last. It is refused with
3296
+ `DevicesVisible` while the runtime sees a device, and with `ValueError` for a count below one.
3297
+ `declare_target(maker, capability)` binds the compile target a hardware description states, so that
3298
+ `backend.launcher.target()` and the device description answer as on that device: `"nvidia"` is cuda with 32
3299
+ threads a warp, `"amd"` is hip with 64, and `"7.0"` becomes 70. It is refused with `TargetNotDeclarable` for any other
3300
+ maker, since a device whose architecture is a name keeps its driver's answer, and for a capability that is not
3301
+ "major" or "major.minor".
3126
3302
 
3127
3303
  No device is a fact, a refusal is an error: `count()` is 0 only on a host with no GPU runtime
3128
3304
  (`nbxtensor.backend.runtime.NoGpuRuntime`) or when the runtime answers its own "no device" code (the backend table's
@@ -3292,6 +3468,8 @@ class Driver # what a backend implements: load a binary, launc
3292
3468
  class ModuleDriver(Driver) # the base of the drivers that load a vendor binary as a module (CUDA, HIP, Level Zero)
3293
3469
  def ctypes_slot(kind: str) # the C cell one launch parameter of this kind lives in
3294
3470
  class CudaDriver(Driver) # libcuda through ctypes
3471
+ # .prepare_launch(function, grid, block, shared, params, ...) -> a launch resolved once (one cuLaunchKernel at
3472
+ # replay) or None where .launch would refuse; the Metal driver's prepare_launch answers the same (BoundLaunch)
3295
3473
  class HipDriver(Driver) # the HIP runtime's module API (hsaco code objects; proven against a stand-in, no AMD card has run it)
3296
3474
  class CudaCompiledKernel # the result of compiling once, launched many times (contract object)
3297
3475
  def register_driver(driver: Optional[Driver]) -> None # install the driver this process launches through
@@ -3563,6 +3741,7 @@ def reset_runtime_for_tests() -> None # Drop the cached runtime — and everyt
3563
3741
  class CapturedPlan # One bucket's action list as an instantiated CUDA graph.
3564
3742
  class GraphReplayError #
3565
3743
  class SegmentedPlan # A multi-card plan's action list as one CUDA graph per stretch of actions on one card (S3, 2026-10-28).
3744
+ def capable() -> bool # The backend offers CUDA graphs (the driver's cuGraph API this module binds): CUDA today. HIP, Metal and Level
3566
3745
  ```
3567
3746
 
3568
3747
  ### `nbxtensor.backend.runtime`