jax-linear-attention 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (585) hide show
  1. jax_linear_attention-0.1.0/CHANGELOG.md +73 -0
  2. jax_linear_attention-0.1.0/CITATION.cff +20 -0
  3. jax_linear_attention-0.1.0/CONTRIBUTING.md +72 -0
  4. jax_linear_attention-0.1.0/LICENSE +202 -0
  5. jax_linear_attention-0.1.0/MANIFEST.in +8 -0
  6. jax_linear_attention-0.1.0/NOTICE +334 -0
  7. jax_linear_attention-0.1.0/PKG-INFO +543 -0
  8. jax_linear_attention-0.1.0/README.md +470 -0
  9. jax_linear_attention-0.1.0/benchmarks/README.md +192 -0
  10. jax_linear_attention-0.1.0/benchmarks/attention.md +247 -0
  11. jax_linear_attention-0.1.0/benchmarks/attention_fa3_diff.py +197 -0
  12. jax_linear_attention-0.1.0/benchmarks/bench_attention.py +107 -0
  13. jax_linear_attention-0.1.0/benchmarks/bench_attention_fa3.py +278 -0
  14. jax_linear_attention-0.1.0/benchmarks/bench_attention_forward.py +149 -0
  15. jax_linear_attention-0.1.0/benchmarks/bench_attention_fp8_bwd.py +144 -0
  16. jax_linear_attention-0.1.0/benchmarks/bench_context_parallel_attention.py +167 -0
  17. jax_linear_attention-0.1.0/benchmarks/bench_conv_norm.py +172 -0
  18. jax_linear_attention-0.1.0/benchmarks/bench_convert_hf.py +150 -0
  19. jax_linear_attention-0.1.0/benchmarks/bench_cross_entropy.py +220 -0
  20. jax_linear_attention-0.1.0/benchmarks/bench_dsa.py +117 -0
  21. jax_linear_attention-0.1.0/benchmarks/bench_dsa_deepseek.py +95 -0
  22. jax_linear_attention-0.1.0/benchmarks/bench_dsa_gather.py +107 -0
  23. jax_linear_attention-0.1.0/benchmarks/bench_dsa_long.py +221 -0
  24. jax_linear_attention-0.1.0/benchmarks/bench_dsa_production.py +183 -0
  25. jax_linear_attention-0.1.0/benchmarks/bench_dsa_topk.py +245 -0
  26. jax_linear_attention-0.1.0/benchmarks/bench_e2e_1p3b.py +407 -0
  27. jax_linear_attention-0.1.0/benchmarks/bench_e2e_ab.py +110 -0
  28. jax_linear_attention-0.1.0/benchmarks/bench_e2e_flame.py +623 -0
  29. jax_linear_attention-0.1.0/benchmarks/bench_end_to_end_ab.py +98 -0
  30. jax_linear_attention-0.1.0/benchmarks/bench_end_to_end_step.py +399 -0
  31. jax_linear_attention-0.1.0/benchmarks/bench_expert_parallel.py +380 -0
  32. jax_linear_attention-0.1.0/benchmarks/bench_fox.py +80 -0
  33. jax_linear_attention-0.1.0/benchmarks/bench_fp8.py +221 -0
  34. jax_linear_attention-0.1.0/benchmarks/bench_fp8_1p3b.py +148 -0
  35. jax_linear_attention-0.1.0/benchmarks/bench_fp8_gemm.py +116 -0
  36. jax_linear_attention-0.1.0/benchmarks/bench_fused_gemm.py +263 -0
  37. jax_linear_attention-0.1.0/benchmarks/bench_fused_gemm_e2e.py +117 -0
  38. jax_linear_attention-0.1.0/benchmarks/bench_gated_delta_rule.py +269 -0
  39. jax_linear_attention-0.1.0/benchmarks/bench_gated_deltaproduct.py +61 -0
  40. jax_linear_attention-0.1.0/benchmarks/bench_gdn2.py +20 -0
  41. jax_linear_attention-0.1.0/benchmarks/bench_gdn_hd256.py +83 -0
  42. jax_linear_attention-0.1.0/benchmarks/bench_gdn_packed.py +161 -0
  43. jax_linear_attention-0.1.0/benchmarks/bench_generate.py +193 -0
  44. jax_linear_attention-0.1.0/benchmarks/bench_gla.py +165 -0
  45. jax_linear_attention-0.1.0/benchmarks/bench_hopper_features.py +422 -0
  46. jax_linear_attention-0.1.0/benchmarks/bench_init_ab.py +208 -0
  47. jax_linear_attention-0.1.0/benchmarks/bench_kda.py +298 -0
  48. jax_linear_attention-0.1.0/benchmarks/bench_log_linear.py +65 -0
  49. jax_linear_attention-0.1.0/benchmarks/bench_mamba1.py +130 -0
  50. jax_linear_attention-0.1.0/benchmarks/bench_mamba2_dqkwg.py +114 -0
  51. jax_linear_attention-0.1.0/benchmarks/bench_mamba2_layer.py +212 -0
  52. jax_linear_attention-0.1.0/benchmarks/bench_mamba3.py +382 -0
  53. jax_linear_attention-0.1.0/benchmarks/bench_mamba3_layer.py +208 -0
  54. jax_linear_attention-0.1.0/benchmarks/bench_mamba3_mimo.py +314 -0
  55. jax_linear_attention-0.1.0/benchmarks/bench_mixer_fast_paths.py +107 -0
  56. jax_linear_attention-0.1.0/benchmarks/bench_mla_attention.py +233 -0
  57. jax_linear_attention-0.1.0/benchmarks/bench_mlstm.py +155 -0
  58. jax_linear_attention-0.1.0/benchmarks/bench_multi_gpu.py +597 -0
  59. jax_linear_attention-0.1.0/benchmarks/bench_no_remat_1p3b.py +208 -0
  60. jax_linear_attention-0.1.0/benchmarks/bench_pipeline.py +179 -0
  61. jax_linear_attention-0.1.0/benchmarks/bench_ragged_dot.py +378 -0
  62. jax_linear_attention-0.1.0/benchmarks/bench_ragged_dot_fp8.py +96 -0
  63. jax_linear_attention-0.1.0/benchmarks/bench_remat_fp8_1p3b.py +147 -0
  64. jax_linear_attention-0.1.0/benchmarks/bench_remat_sweep.py +237 -0
  65. jax_linear_attention-0.1.0/benchmarks/bench_rwkv7.py +300 -0
  66. jax_linear_attention-0.1.0/benchmarks/bench_rwkv7_bwd_ab.py +138 -0
  67. jax_linear_attention-0.1.0/benchmarks/bench_sft_packing.py +137 -0
  68. jax_linear_attention-0.1.0/benchmarks/bench_short_conv.py +184 -0
  69. jax_linear_attention-0.1.0/benchmarks/bench_short_conv_e2e.py +67 -0
  70. jax_linear_attention-0.1.0/benchmarks/bench_short_conv_l2norm.py +109 -0
  71. jax_linear_attention-0.1.0/benchmarks/bench_short_conv_l2norm_e2e.py +79 -0
  72. jax_linear_attention-0.1.0/benchmarks/bench_speed_of_light.py +511 -0
  73. jax_linear_attention-0.1.0/benchmarks/bench_streaming.py +212 -0
  74. jax_linear_attention-0.1.0/benchmarks/build_fa3_mla.sh +42 -0
  75. jax_linear_attention-0.1.0/benchmarks/build_time_mamba1.py +55 -0
  76. jax_linear_attention-0.1.0/benchmarks/ce_grad_accuracy_1p3b.py +141 -0
  77. jax_linear_attention-0.1.0/benchmarks/check_mamba3_official.py +539 -0
  78. jax_linear_attention-0.1.0/benchmarks/convert_hf.md +71 -0
  79. jax_linear_attention-0.1.0/benchmarks/cross_entropy.md +189 -0
  80. jax_linear_attention-0.1.0/benchmarks/diff_upstream.py +355 -0
  81. jax_linear_attention-0.1.0/benchmarks/diff_vector_gate.py +412 -0
  82. jax_linear_attention-0.1.0/benchmarks/dpo.md +82 -0
  83. jax_linear_attention-0.1.0/benchmarks/dpo_trl_reference.py +97 -0
  84. jax_linear_attention-0.1.0/benchmarks/dsa.md +133 -0
  85. jax_linear_attention-0.1.0/benchmarks/dsa_layer_breakdown.py +65 -0
  86. jax_linear_attention-0.1.0/benchmarks/dsa_layer_wallclock.py +63 -0
  87. jax_linear_attention-0.1.0/benchmarks/dsa_reference_jax.py +98 -0
  88. jax_linear_attention-0.1.0/benchmarks/dsa_reference_torch.py +131 -0
  89. jax_linear_attention-0.1.0/benchmarks/dsa_torch_topk_ties.py +44 -0
  90. jax_linear_attention-0.1.0/benchmarks/end_to_end/1p3b/flame/check_params.py +69 -0
  91. jax_linear_attention-0.1.0/benchmarks/end_to_end/1p3b/flame/fa3_shim/flash_attn/__init__.py +14 -0
  92. jax_linear_attention-0.1.0/benchmarks/end_to_end/1p3b/flame/gdn-1p3b.json +29 -0
  93. jax_linear_attention-0.1.0/benchmarks/end_to_end/1p3b/flame/gdn-hd128-1p3b.json +29 -0
  94. jax_linear_attention-0.1.0/benchmarks/end_to_end/1p3b/flame/job.toml +70 -0
  95. jax_linear_attention-0.1.0/benchmarks/end_to_end/1p3b/flame/kda-1p3b.json +29 -0
  96. jax_linear_attention-0.1.0/benchmarks/end_to_end/1p3b/flame/mamba2-1p3b.json +32 -0
  97. jax_linear_attention-0.1.0/benchmarks/end_to_end/1p3b/flame/mamba3-1p3b.json +27 -0
  98. jax_linear_attention-0.1.0/benchmarks/end_to_end/1p3b/flame/rwkv7-1p3b.json +28 -0
  99. jax_linear_attention-0.1.0/benchmarks/end_to_end/1p3b/flame/setup_flame_env.sh +121 -0
  100. jax_linear_attention-0.1.0/benchmarks/end_to_end/1p3b/flame/token_checksum.py +42 -0
  101. jax_linear_attention-0.1.0/benchmarks/end_to_end/1p3b/flame/transformer-1p3b.json +27 -0
  102. jax_linear_attention-0.1.0/benchmarks/end_to_end/1p3b/flame/transformer-swa-1p3b.json +27 -0
  103. jax_linear_attention-0.1.0/benchmarks/end_to_end/1p3b/gdn-1p3b.toml +53 -0
  104. jax_linear_attention-0.1.0/benchmarks/end_to_end/1p3b/gdn-hd128-1p3b.toml +68 -0
  105. jax_linear_attention-0.1.0/benchmarks/end_to_end/1p3b/gdn-hybrid-1p3b.toml +53 -0
  106. jax_linear_attention-0.1.0/benchmarks/end_to_end/1p3b/gdn2-1p3b.toml +60 -0
  107. jax_linear_attention-0.1.0/benchmarks/end_to_end/1p3b/kda-1p3b.toml +63 -0
  108. jax_linear_attention-0.1.0/benchmarks/end_to_end/1p3b/kda-hybrid-1p3b.toml +53 -0
  109. jax_linear_attention-0.1.0/benchmarks/end_to_end/1p3b/mamba2-1p3b.toml +61 -0
  110. jax_linear_attention-0.1.0/benchmarks/end_to_end/1p3b/mamba3-1p3b.toml +53 -0
  111. jax_linear_attention-0.1.0/benchmarks/end_to_end/1p3b/run_matrix.sh +72 -0
  112. jax_linear_attention-0.1.0/benchmarks/end_to_end/1p3b/rwkv7-1p3b.toml +54 -0
  113. jax_linear_attention-0.1.0/benchmarks/end_to_end/1p3b/transformer-1p3b.toml +111 -0
  114. jax_linear_attention-0.1.0/benchmarks/end_to_end/1p3b/transformer-swa-1p3b.toml +80 -0
  115. jax_linear_attention-0.1.0/benchmarks/end_to_end/compare_impls.py +63 -0
  116. jax_linear_attention-0.1.0/benchmarks/end_to_end/fw-gdn-hybrid-125m.toml +49 -0
  117. jax_linear_attention-0.1.0/benchmarks/end_to_end/fw-gdn2-hybrid-125m.toml +49 -0
  118. jax_linear_attention-0.1.0/benchmarks/end_to_end/fw-kda-hybrid-125m.toml +49 -0
  119. jax_linear_attention-0.1.0/benchmarks/end_to_end/fw-mamba2-130m.toml +49 -0
  120. jax_linear_attention-0.1.0/benchmarks/end_to_end/fw-mamba3-130m.toml +49 -0
  121. jax_linear_attention-0.1.0/benchmarks/end_to_end/fw-transformer-125m.toml +49 -0
  122. jax_linear_attention-0.1.0/benchmarks/end_to_end/gdn2_paper/gdn-hybrid.toml +79 -0
  123. jax_linear_attention-0.1.0/benchmarks/end_to_end/gdn2_paper/gdn2-hybrid.toml +78 -0
  124. jax_linear_attention-0.1.0/benchmarks/end_to_end/gdn2_paper/kda-hybrid.toml +78 -0
  125. jax_linear_attention-0.1.0/benchmarks/end_to_end/gdn2_paper/mamba2-hybrid.toml +78 -0
  126. jax_linear_attention-0.1.0/benchmarks/end_to_end/gdn2_paper/mamba3-hybrid.toml +78 -0
  127. jax_linear_attention-0.1.0/benchmarks/end_to_end/gdn2_paper/mamba3-mimo-hybrid.toml +81 -0
  128. jax_linear_attention-0.1.0/benchmarks/end_to_end/gdn2_paper/read_paper_fig2.py +64 -0
  129. jax_linear_attention-0.1.0/benchmarks/end_to_end/gdn2_paper/run.sh +56 -0
  130. jax_linear_attention-0.1.0/benchmarks/end_to_end/gdn2_paper/transformer.toml +66 -0
  131. jax_linear_attention-0.1.0/benchmarks/end_to_end/hybrids_1p3b/kimi-linear-1p3b.toml +62 -0
  132. jax_linear_attention-0.1.0/benchmarks/end_to_end/hybrids_1p3b/qwen3-next-1p3b.toml +63 -0
  133. jax_linear_attention-0.1.0/benchmarks/end_to_end/qwen3-next-300m.toml +44 -0
  134. jax_linear_attention-0.1.0/benchmarks/end_to_end.md +57 -0
  135. jax_linear_attention-0.1.0/benchmarks/end_to_end_1p3b.md +285 -0
  136. jax_linear_attention-0.1.0/benchmarks/expert_parallel.md +95 -0
  137. jax_linear_attention-0.1.0/benchmarks/fox.md +42 -0
  138. jax_linear_attention-0.1.0/benchmarks/fp8.md +107 -0
  139. jax_linear_attention-0.1.0/benchmarks/fp8_1p3b.md +252 -0
  140. jax_linear_attention-0.1.0/benchmarks/fsdp_step_hlo.py +554 -0
  141. jax_linear_attention-0.1.0/benchmarks/fsdp_trace_1p3b.py +221 -0
  142. jax_linear_attention-0.1.0/benchmarks/fused_gemm.md +89 -0
  143. jax_linear_attention-0.1.0/benchmarks/gated_deltaproduct.md +37 -0
  144. jax_linear_attention-0.1.0/benchmarks/gdn.md +204 -0
  145. jax_linear_attention-0.1.0/benchmarks/gdn2_paper.md +134 -0
  146. jax_linear_attention-0.1.0/benchmarks/gdn_warmup_error.py +96 -0
  147. jax_linear_attention-0.1.0/benchmarks/gla.md +96 -0
  148. jax_linear_attention-0.1.0/benchmarks/harness.py +155 -0
  149. jax_linear_attention-0.1.0/benchmarks/init_parity.md +101 -0
  150. jax_linear_attention-0.1.0/benchmarks/jax_tokamax_attention.py +108 -0
  151. jax_linear_attention-0.1.0/benchmarks/kda.md +171 -0
  152. jax_linear_attention-0.1.0/benchmarks/lean_residuals.py +139 -0
  153. jax_linear_attention-0.1.0/benchmarks/log_linear.md +42 -0
  154. jax_linear_attention-0.1.0/benchmarks/long_context.md +121 -0
  155. jax_linear_attention-0.1.0/benchmarks/mamba1.md +133 -0
  156. jax_linear_attention-0.1.0/benchmarks/mamba2.md +157 -0
  157. jax_linear_attention-0.1.0/benchmarks/mamba3.md +188 -0
  158. jax_linear_attention-0.1.0/benchmarks/maxtext_gdn.py +201 -0
  159. jax_linear_attention-0.1.0/benchmarks/mla.md +85 -0
  160. jax_linear_attention-0.1.0/benchmarks/mla_head_dims_probe.py +34 -0
  161. jax_linear_attention-0.1.0/benchmarks/mlstm.md +82 -0
  162. jax_linear_attention-0.1.0/benchmarks/models.md +52 -0
  163. jax_linear_attention-0.1.0/benchmarks/mosaic_gpu_repros/concurrent_cross_warp_reductions.py +58 -0
  164. jax_linear_attention-0.1.0/benchmarks/mosaic_gpu_repros/inferred_swizzle_views.py +49 -0
  165. jax_linear_attention-0.1.0/benchmarks/mosaic_gpu_repros/scoped_smem_in_branches.py +41 -0
  166. jax_linear_attention-0.1.0/benchmarks/multi_gpu.md +232 -0
  167. jax_linear_attention-0.1.0/benchmarks/pipeline.md +81 -0
  168. jax_linear_attention-0.1.0/benchmarks/profile_1p3b.md +194 -0
  169. jax_linear_attention-0.1.0/benchmarks/profile_1p3b.py +498 -0
  170. jax_linear_attention-0.1.0/benchmarks/profile_1p3b_flame.py +447 -0
  171. jax_linear_attention-0.1.0/benchmarks/profile_1p3b_report.py +327 -0
  172. jax_linear_attention-0.1.0/benchmarks/profile_fp8_passes.py +216 -0
  173. jax_linear_attention-0.1.0/benchmarks/profile_gdn_chunk_grads.py +105 -0
  174. jax_linear_attention-0.1.0/benchmarks/profile_gdn_stages.py +94 -0
  175. jax_linear_attention-0.1.0/benchmarks/profile_layout_copies.py +296 -0
  176. jax_linear_attention-0.1.0/benchmarks/profile_moe.py +168 -0
  177. jax_linear_attention-0.1.0/benchmarks/profile_qla_stages.py +126 -0
  178. jax_linear_attention-0.1.0/benchmarks/profile_vector_gate.py +46 -0
  179. jax_linear_attention-0.1.0/benchmarks/ragged_dot.md +200 -0
  180. jax_linear_attention-0.1.0/benchmarks/rwkv7.md +113 -0
  181. jax_linear_attention-0.1.0/benchmarks/rwkv7_check.py +318 -0
  182. jax_linear_attention-0.1.0/benchmarks/sft_packing.md +52 -0
  183. jax_linear_attention-0.1.0/benchmarks/short_conv.md +147 -0
  184. jax_linear_attention-0.1.0/benchmarks/speed_of_light_prototypes.py +287 -0
  185. jax_linear_attention-0.1.0/benchmarks/speed_of_light_report.py +206 -0
  186. jax_linear_attention-0.1.0/benchmarks/speed_of_light_step.py +734 -0
  187. jax_linear_attention-0.1.0/benchmarks/speed_of_light_suite.py +38 -0
  188. jax_linear_attention-0.1.0/benchmarks/speed_of_light_torch.py +267 -0
  189. jax_linear_attention-0.1.0/benchmarks/streaming.md +64 -0
  190. jax_linear_attention-0.1.0/benchmarks/torch_baselines.py +198 -0
  191. jax_linear_attention-0.1.0/benchmarks/torch_cross_entropy.py +156 -0
  192. jax_linear_attention-0.1.0/benchmarks/torch_fa3.py +222 -0
  193. jax_linear_attention-0.1.0/benchmarks/torch_fa3_mla.py +138 -0
  194. jax_linear_attention-0.1.0/benchmarks/torch_gla.py +87 -0
  195. jax_linear_attention-0.1.0/benchmarks/torch_grouped_mm.py +182 -0
  196. jax_linear_attention-0.1.0/benchmarks/torch_kda.py +168 -0
  197. jax_linear_attention-0.1.0/benchmarks/torch_kda_diff.py +78 -0
  198. jax_linear_attention-0.1.0/benchmarks/torch_mamba1.py +83 -0
  199. jax_linear_attention-0.1.0/benchmarks/torch_mlstm.py +85 -0
  200. jax_linear_attention-0.1.0/benchmarks/torch_rwkv7.py +115 -0
  201. jax_linear_attention-0.1.0/benchmarks/torch_rwkv7_check.py +165 -0
  202. jax_linear_attention-0.1.0/benchmarks/torch_short_conv.py +86 -0
  203. jax_linear_attention-0.1.0/benchmarks/torch_short_conv_l2norm.py +110 -0
  204. jax_linear_attention-0.1.0/benchmarks/torch_upstream_diff.py +141 -0
  205. jax_linear_attention-0.1.0/benchmarks/trainer_loop_probe.py +56 -0
  206. jax_linear_attention-0.1.0/benchmarks/xcheck_scalar_gate.py +389 -0
  207. jax_linear_attention-0.1.0/benchmarks/xcheck_scalar_gate_torch.py +368 -0
  208. jax_linear_attention-0.1.0/benchmarks/zero_copy_layouts.md +113 -0
  209. jax_linear_attention-0.1.0/configs/gdn-hybrid-125m.toml +49 -0
  210. jax_linear_attention-0.1.0/configs/gdn2-hybrid-125m.toml +52 -0
  211. jax_linear_attention-0.1.0/configs/kda-hybrid-125m.toml +49 -0
  212. jax_linear_attention-0.1.0/configs/mamba2-130m.toml +52 -0
  213. jax_linear_attention-0.1.0/configs/mamba3-130m.toml +52 -0
  214. jax_linear_attention-0.1.0/configs/moe-125m-ep.toml +63 -0
  215. jax_linear_attention-0.1.0/configs/moe-125m.toml +50 -0
  216. jax_linear_attention-0.1.0/configs/post_train/dpo-tiny.toml +35 -0
  217. jax_linear_attention-0.1.0/configs/sft-chat-125m.toml +48 -0
  218. jax_linear_attention-0.1.0/configs/tiny-stream.toml +41 -0
  219. jax_linear_attention-0.1.0/configs/tiny-synthetic.toml +34 -0
  220. jax_linear_attention-0.1.0/configs/transformer-125m.toml +52 -0
  221. jax_linear_attention-0.1.0/docs/acknowledgements.md +52 -0
  222. jax_linear_attention-0.1.0/docs/architectures.md +267 -0
  223. jax_linear_attention-0.1.0/docs/assets/banner-dark.png +0 -0
  224. jax_linear_attention-0.1.0/docs/assets/banner-light.png +0 -0
  225. jax_linear_attention-0.1.0/docs/assets/e2e-dark.png +0 -0
  226. jax_linear_attention-0.1.0/docs/assets/e2e-light.png +0 -0
  227. jax_linear_attention-0.1.0/docs/assets/gdn2-paper-dark.png +0 -0
  228. jax_linear_attention-0.1.0/docs/assets/gdn2-paper-light.png +0 -0
  229. jax_linear_attention-0.1.0/docs/assets/karlex-ai-logo.png +0 -0
  230. jax_linear_attention-0.1.0/docs/assets/kernels-dark.png +0 -0
  231. jax_linear_attention-0.1.0/docs/assets/kernels-light.png +0 -0
  232. jax_linear_attention-0.1.0/docs/assets/mfu-dark.png +0 -0
  233. jax_linear_attention-0.1.0/docs/assets/mfu-light.png +0 -0
  234. jax_linear_attention-0.1.0/docs/assets/sweep-dark.png +0 -0
  235. jax_linear_attention-0.1.0/docs/assets/sweep-light.png +0 -0
  236. jax_linear_attention-0.1.0/docs/kernels.md +303 -0
  237. jax_linear_attention-0.1.0/docs/results.md +235 -0
  238. jax_linear_attention-0.1.0/docs/training.md +220 -0
  239. jax_linear_attention-0.1.0/licenses/DeepGEMM.LICENSE +21 -0
  240. jax_linear_attention-0.1.0/licenses/DeepSeek-V3.2-Exp.LICENSE +21 -0
  241. jax_linear_attention-0.1.0/licenses/DeepSeek-V3.LICENSE +21 -0
  242. jax_linear_attention-0.1.0/licenses/FlashKDA.LICENSE +21 -0
  243. jax_linear_attention-0.1.0/licenses/FlashMLA.LICENSE +21 -0
  244. jax_linear_attention-0.1.0/licenses/FlashQLA.LICENSE +21 -0
  245. jax_linear_attention-0.1.0/licenses/Liger-Kernel.LICENSE +23 -0
  246. jax_linear_attention-0.1.0/licenses/MoBA.LICENSE +8 -0
  247. jax_linear_attention-0.1.0/licenses/RWKV-LM.LICENSE +201 -0
  248. jax_linear_attention-0.1.0/licenses/TransformerEngine.LICENSE +175 -0
  249. jax_linear_attention-0.1.0/licenses/cutlass.LICENSE +34 -0
  250. jax_linear_attention-0.1.0/licenses/flame.LICENSE +21 -0
  251. jax_linear_attention-0.1.0/licenses/flash-attention.LICENSE +29 -0
  252. jax_linear_attention-0.1.0/licenses/flash-linear-attention.LICENSE +21 -0
  253. jax_linear_attention-0.1.0/licenses/flat.LICENSE +201 -0
  254. jax_linear_attention-0.1.0/licenses/flax.LICENSE +200 -0
  255. jax_linear_attention-0.1.0/licenses/jax.LICENSE +202 -0
  256. jax_linear_attention-0.1.0/licenses/mamba.LICENSE +201 -0
  257. jax_linear_attention-0.1.0/licenses/maxtext.LICENSE +201 -0
  258. jax_linear_attention-0.1.0/licenses/ml-cross-entropy.LICENSE +47 -0
  259. jax_linear_attention-0.1.0/licenses/tokamax.LICENSE +202 -0
  260. jax_linear_attention-0.1.0/licenses/transformers.LICENSE +203 -0
  261. jax_linear_attention-0.1.0/licenses/trl.LICENSE +201 -0
  262. jax_linear_attention-0.1.0/licenses/xlstm.LICENSE +202 -0
  263. jax_linear_attention-0.1.0/pyproject.toml +64 -0
  264. jax_linear_attention-0.1.0/requirements/jax-0.11.2-cuda13.txt +26 -0
  265. jax_linear_attention-0.1.0/setup.cfg +4 -0
  266. jax_linear_attention-0.1.0/src/jax_linear_attention.egg-info/PKG-INFO +543 -0
  267. jax_linear_attention-0.1.0/src/jax_linear_attention.egg-info/SOURCES.txt +583 -0
  268. jax_linear_attention-0.1.0/src/jax_linear_attention.egg-info/dependency_links.txt +1 -0
  269. jax_linear_attention-0.1.0/src/jax_linear_attention.egg-info/entry_points.txt +3 -0
  270. jax_linear_attention-0.1.0/src/jax_linear_attention.egg-info/requires.txt +29 -0
  271. jax_linear_attention-0.1.0/src/jax_linear_attention.egg-info/top_level.txt +1 -0
  272. jax_linear_attention-0.1.0/src/jla/__init__.py +5 -0
  273. jax_linear_attention-0.1.0/src/jla/cli.py +130 -0
  274. jax_linear_attention-0.1.0/src/jla/config.py +823 -0
  275. jax_linear_attention-0.1.0/src/jla/convert/__init__.py +21 -0
  276. jax_linear_attention-0.1.0/src/jla/convert/cli.py +143 -0
  277. jax_linear_attention-0.1.0/src/jla/convert/hf.py +163 -0
  278. jax_linear_attention-0.1.0/src/jla/convert/hf_config.py +551 -0
  279. jax_linear_attention-0.1.0/src/jla/convert/hf_weights.py +485 -0
  280. jax_linear_attention-0.1.0/src/jla/convert/safetensors_io.py +200 -0
  281. jax_linear_attention-0.1.0/src/jla/data/__init__.py +14 -0
  282. jax_linear_attention-0.1.0/src/jla/data/cidx.py +330 -0
  283. jax_linear_attention-0.1.0/src/jla/data/datasets.py +291 -0
  284. jax_linear_attention-0.1.0/src/jla/data/loader.py +213 -0
  285. jax_linear_attention-0.1.0/src/jla/data/make_data.py +188 -0
  286. jax_linear_attention-0.1.0/src/jla/data/packing.py +60 -0
  287. jax_linear_attention-0.1.0/src/jla/data/pipeline.py +300 -0
  288. jax_linear_attention-0.1.0/src/jla/data/preference.py +236 -0
  289. jax_linear_attention-0.1.0/src/jla/data/sft.py +482 -0
  290. jax_linear_attention-0.1.0/src/jla/data/sft_tokenize.py +524 -0
  291. jax_linear_attention-0.1.0/src/jla/data/streaming.py +629 -0
  292. jax_linear_attention-0.1.0/src/jla/distributed/__init__.py +17 -0
  293. jax_linear_attention-0.1.0/src/jla/distributed/activation_sharding.py +59 -0
  294. jax_linear_attention-0.1.0/src/jla/distributed/context_parallel.py +182 -0
  295. jax_linear_attention-0.1.0/src/jla/distributed/context_parallel_attention.py +590 -0
  296. jax_linear_attention-0.1.0/src/jla/distributed/expert_parallel.py +251 -0
  297. jax_linear_attention-0.1.0/src/jla/distributed/init.py +307 -0
  298. jax_linear_attention-0.1.0/src/jla/distributed/kernel_sharding.py +516 -0
  299. jax_linear_attention-0.1.0/src/jla/distributed/mesh.py +233 -0
  300. jax_linear_attention-0.1.0/src/jla/distributed/pipeline.py +563 -0
  301. jax_linear_attention-0.1.0/src/jla/distributed/sharding.py +309 -0
  302. jax_linear_attention-0.1.0/src/jla/eval/__init__.py +11 -0
  303. jax_linear_attention-0.1.0/src/jla/eval/cli.py +139 -0
  304. jax_linear_attention-0.1.0/src/jla/eval/lm_eval_adapter.py +234 -0
  305. jax_linear_attention-0.1.0/src/jla/eval/perplexity.py +121 -0
  306. jax_linear_attention-0.1.0/src/jla/eval/scoring.py +88 -0
  307. jax_linear_attention-0.1.0/src/jla/inference/__init__.py +30 -0
  308. jax_linear_attention-0.1.0/src/jla/inference/cli.py +111 -0
  309. jax_linear_attention-0.1.0/src/jla/inference/generate.py +303 -0
  310. jax_linear_attention-0.1.0/src/jla/inference/loading.py +205 -0
  311. jax_linear_attention-0.1.0/src/jla/inference/rwkv7.py +84 -0
  312. jax_linear_attention-0.1.0/src/jla/inference/sampling.py +76 -0
  313. jax_linear_attention-0.1.0/src/jla/launch_env.py +116 -0
  314. jax_linear_attention-0.1.0/src/jla/layers/__init__.py +8 -0
  315. jax_linear_attention-0.1.0/src/jla/layers/attention.py +514 -0
  316. jax_linear_attention-0.1.0/src/jla/layers/cache.py +93 -0
  317. jax_linear_attention-0.1.0/src/jla/layers/conv.py +207 -0
  318. jax_linear_attention-0.1.0/src/jla/layers/conv_l2norm.py +90 -0
  319. jax_linear_attention-0.1.0/src/jla/layers/forgetting_attention.py +275 -0
  320. jax_linear_attention-0.1.0/src/jla/layers/fp8.py +664 -0
  321. jax_linear_attention-0.1.0/src/jla/layers/fp8_attention.py +357 -0
  322. jax_linear_attention-0.1.0/src/jla/layers/fp8_swiglu.py +474 -0
  323. jax_linear_attention-0.1.0/src/jla/layers/fused_mlp.py +111 -0
  324. jax_linear_attention-0.1.0/src/jla/layers/lean.py +648 -0
  325. jax_linear_attention-0.1.0/src/jla/layers/lightning_attention.py +150 -0
  326. jax_linear_attention-0.1.0/src/jla/layers/linear.py +190 -0
  327. jax_linear_attention-0.1.0/src/jla/layers/linear_attention.py +634 -0
  328. jax_linear_attention-0.1.0/src/jla/layers/mamba1.py +149 -0
  329. jax_linear_attention-0.1.0/src/jla/layers/mamba2_fused.py +543 -0
  330. jax_linear_attention-0.1.0/src/jla/layers/mamba3_mimo.py +324 -0
  331. jax_linear_attention-0.1.0/src/jla/layers/mla.py +252 -0
  332. jax_linear_attention-0.1.0/src/jla/layers/mlp.py +89 -0
  333. jax_linear_attention-0.1.0/src/jla/layers/moe.py +326 -0
  334. jax_linear_attention-0.1.0/src/jla/layers/norm.py +112 -0
  335. jax_linear_attention-0.1.0/src/jla/layers/path_attention.py +131 -0
  336. jax_linear_attention-0.1.0/src/jla/layers/path_decode.py +115 -0
  337. jax_linear_attention-0.1.0/src/jla/layers/rope.py +135 -0
  338. jax_linear_attention-0.1.0/src/jla/layers/rwkv6.py +294 -0
  339. jax_linear_attention-0.1.0/src/jla/layers/rwkv7.py +563 -0
  340. jax_linear_attention-0.1.0/src/jla/layers/sparse_attention.py +213 -0
  341. jax_linear_attention-0.1.0/src/jla/layers/ssm.py +700 -0
  342. jax_linear_attention-0.1.0/src/jla/layers/ttt.py +136 -0
  343. jax_linear_attention-0.1.0/src/jla/models/__init__.py +42 -0
  344. jax_linear_attention-0.1.0/src/jla/models/axes.py +90 -0
  345. jax_linear_attention-0.1.0/src/jla/models/config.py +816 -0
  346. jax_linear_attention-0.1.0/src/jla/models/lm.py +665 -0
  347. jax_linear_attention-0.1.0/src/jla/models/mtp.py +160 -0
  348. jax_linear_attention-0.1.0/src/jla/models/presets.py +963 -0
  349. jax_linear_attention-0.1.0/src/jla/models/rwkv7.py +165 -0
  350. jax_linear_attention-0.1.0/src/jla/ops/__init__.py +192 -0
  351. jax_linear_attention-0.1.0/src/jla/ops/chunked.py +994 -0
  352. jax_linear_attention-0.1.0/src/jla/ops/cross_entropy.py +437 -0
  353. jax_linear_attention-0.1.0/src/jla/ops/dsa_gather.py +89 -0
  354. jax_linear_attention-0.1.0/src/jla/ops/log_linear.py +238 -0
  355. jax_linear_attention-0.1.0/src/jla/ops/moba.py +165 -0
  356. jax_linear_attention-0.1.0/src/jla/ops/moe_permute.py +130 -0
  357. jax_linear_attention-0.1.0/src/jla/ops/mosaic_gpu/__init__.py +42 -0
  358. jax_linear_attention-0.1.0/src/jla/ops/mosaic_gpu/_common.py +217 -0
  359. jax_linear_attention-0.1.0/src/jla/ops/mosaic_gpu/attention.py +2001 -0
  360. jax_linear_attention-0.1.0/src/jla/ops/mosaic_gpu/attention_fp8_bwd.py +898 -0
  361. jax_linear_attention-0.1.0/src/jla/ops/mosaic_gpu/attention_persistent.py +684 -0
  362. jax_linear_attention-0.1.0/src/jla/ops/mosaic_gpu/dsa.py +1585 -0
  363. jax_linear_attention-0.1.0/src/jla/ops/mosaic_gpu/dsa_topk.py +416 -0
  364. jax_linear_attention-0.1.0/src/jla/ops/mosaic_gpu/fused_gemm.py +487 -0
  365. jax_linear_attention-0.1.0/src/jla/ops/mosaic_gpu/gated_delta_product.py +90 -0
  366. jax_linear_attention-0.1.0/src/jla/ops/mosaic_gpu/gated_delta_rule.py +100 -0
  367. jax_linear_attention-0.1.0/src/jla/ops/mosaic_gpu/gated_delta_rule_bwd.py +853 -0
  368. jax_linear_attention-0.1.0/src/jla/ops/mosaic_gpu/gated_delta_rule_fused_bwd.py +442 -0
  369. jax_linear_attention-0.1.0/src/jla/ops/mosaic_gpu/gated_delta_rule_kb.py +1151 -0
  370. jax_linear_attention-0.1.0/src/jla/ops/mosaic_gpu/gated_delta_rule_kernels.py +642 -0
  371. jax_linear_attention-0.1.0/src/jla/ops/mosaic_gpu/gdn2.py +60 -0
  372. jax_linear_attention-0.1.0/src/jla/ops/mosaic_gpu/gla.py +137 -0
  373. jax_linear_attention-0.1.0/src/jla/ops/mosaic_gpu/gla_kernels.py +924 -0
  374. jax_linear_attention-0.1.0/src/jla/ops/mosaic_gpu/kda.py +56 -0
  375. jax_linear_attention-0.1.0/src/jla/ops/mosaic_gpu/linear_cross_entropy.py +540 -0
  376. jax_linear_attention-0.1.0/src/jla/ops/mosaic_gpu/mamba1.py +492 -0
  377. jax_linear_attention-0.1.0/src/jla/ops/mosaic_gpu/mamba1_bwd.py +238 -0
  378. jax_linear_attention-0.1.0/src/jla/ops/mosaic_gpu/mamba1_bwd2.py +522 -0
  379. jax_linear_attention-0.1.0/src/jla/ops/mosaic_gpu/mamba3.py +907 -0
  380. jax_linear_attention-0.1.0/src/jla/ops/mosaic_gpu/mamba3_fused.py +792 -0
  381. jax_linear_attention-0.1.0/src/jla/ops/mosaic_gpu/mamba3_mimo.py +152 -0
  382. jax_linear_attention-0.1.0/src/jla/ops/mosaic_gpu/mamba3_mimo_kernels.py +785 -0
  383. jax_linear_attention-0.1.0/src/jla/ops/mosaic_gpu/mlstm.py +284 -0
  384. jax_linear_attention-0.1.0/src/jla/ops/mosaic_gpu/ragged_dot.py +900 -0
  385. jax_linear_attention-0.1.0/src/jla/ops/mosaic_gpu/ragged_dot_fp8.py +136 -0
  386. jax_linear_attention-0.1.0/src/jla/ops/mosaic_gpu/rwkv7.py +772 -0
  387. jax_linear_attention-0.1.0/src/jla/ops/mosaic_gpu/rwkv7_bwd.py +350 -0
  388. jax_linear_attention-0.1.0/src/jla/ops/mosaic_gpu/rwkv7_prep.py +346 -0
  389. jax_linear_attention-0.1.0/src/jla/ops/mosaic_gpu/rwkv7_tiles.py +111 -0
  390. jax_linear_attention-0.1.0/src/jla/ops/mosaic_gpu/scalar_gate.py +622 -0
  391. jax_linear_attention-0.1.0/src/jla/ops/mosaic_gpu/scalar_gate_docs.py +968 -0
  392. jax_linear_attention-0.1.0/src/jla/ops/mosaic_gpu/scalar_gate_fused.py +517 -0
  393. jax_linear_attention-0.1.0/src/jla/ops/mosaic_gpu/scalar_gate_grouped.py +237 -0
  394. jax_linear_attention-0.1.0/src/jla/ops/mosaic_gpu/scalar_gate_kb.py +400 -0
  395. jax_linear_attention-0.1.0/src/jla/ops/mosaic_gpu/scalar_gate_kernels.py +605 -0
  396. jax_linear_attention-0.1.0/src/jla/ops/mosaic_gpu/scalar_gate_scan.py +177 -0
  397. jax_linear_attention-0.1.0/src/jla/ops/mosaic_gpu/short_conv.py +509 -0
  398. jax_linear_attention-0.1.0/src/jla/ops/mosaic_gpu/short_conv_l2norm.py +387 -0
  399. jax_linear_attention-0.1.0/src/jla/ops/mosaic_gpu/vector_gate.py +1243 -0
  400. jax_linear_attention-0.1.0/src/jla/ops/mosaic_gpu/vector_gate_bwd.py +799 -0
  401. jax_linear_attention-0.1.0/src/jla/ops/mosaic_gpu/vector_gate_ops.py +350 -0
  402. jax_linear_attention-0.1.0/src/jla/ops/path_attention.py +221 -0
  403. jax_linear_attention-0.1.0/src/jla/ops/reference.py +808 -0
  404. jax_linear_attention-0.1.0/src/jla/ops/rwkv6.py +169 -0
  405. jax_linear_attention-0.1.0/src/jla/ops/rwkv7.py +230 -0
  406. jax_linear_attention-0.1.0/src/jla/ops/sparse_attention.py +350 -0
  407. jax_linear_attention-0.1.0/src/jla/ops/token_logprobs.py +147 -0
  408. jax_linear_attention-0.1.0/src/jla/ops/ttt.py +296 -0
  409. jax_linear_attention-0.1.0/src/jla/training/__init__.py +8 -0
  410. jax_linear_attention-0.1.0/src/jla/training/checkpointing.py +739 -0
  411. jax_linear_attention-0.1.0/src/jla/training/dpo.py +787 -0
  412. jax_linear_attention-0.1.0/src/jla/training/fp8.py +173 -0
  413. jax_linear_attention-0.1.0/src/jla/training/gpu_setup.py +416 -0
  414. jax_linear_attention-0.1.0/src/jla/training/grad_reduce.py +258 -0
  415. jax_linear_attention-0.1.0/src/jla/training/graph_health.py +780 -0
  416. jax_linear_attention-0.1.0/src/jla/training/loggers.py +162 -0
  417. jax_linear_attention-0.1.0/src/jla/training/metrics_sink.py +160 -0
  418. jax_linear_attention-0.1.0/src/jla/training/mixed_precision.py +120 -0
  419. jax_linear_attention-0.1.0/src/jla/training/optimizers.py +620 -0
  420. jax_linear_attention-0.1.0/src/jla/training/performance.py +673 -0
  421. jax_linear_attention-0.1.0/src/jla/training/runtime.py +414 -0
  422. jax_linear_attention-0.1.0/src/jla/training/schedulers.py +558 -0
  423. jax_linear_attention-0.1.0/src/jla/training/step.py +562 -0
  424. jax_linear_attention-0.1.0/src/jla/training/telemetry.py +207 -0
  425. jax_linear_attention-0.1.0/src/jla/training/trainer.py +753 -0
  426. jax_linear_attention-0.1.0/tests/_context_parallel_attention_checks.py +285 -0
  427. jax_linear_attention-0.1.0/tests/_sft_fakes.py +109 -0
  428. jax_linear_attention-0.1.0/tests/_toy_model.py +114 -0
  429. jax_linear_attention-0.1.0/tests/_vector_gate.py +198 -0
  430. jax_linear_attention-0.1.0/tests/conftest.py +39 -0
  431. jax_linear_attention-0.1.0/tests/data/dpo_trl_reference.json +1278 -0
  432. jax_linear_attention-0.1.0/tests/test_activation_sharding.py +159 -0
  433. jax_linear_attention-0.1.0/tests/test_bench_e2e_1p3b.py +210 -0
  434. jax_linear_attention-0.1.0/tests/test_bench_e2e_flame_data.py +110 -0
  435. jax_linear_attention-0.1.0/tests/test_bench_e2e_flame_report.py +91 -0
  436. jax_linear_attention-0.1.0/tests/test_bench_end_to_end_step.py +154 -0
  437. jax_linear_attention-0.1.0/tests/test_checkpointing.py +182 -0
  438. jax_linear_attention-0.1.0/tests/test_chunked_ops.py +170 -0
  439. jax_linear_attention-0.1.0/tests/test_config.py +198 -0
  440. jax_linear_attention-0.1.0/tests/test_context_parallel.py +194 -0
  441. jax_linear_attention-0.1.0/tests/test_context_parallel_attention.py +92 -0
  442. jax_linear_attention-0.1.0/tests/test_context_parallel_guards.py +30 -0
  443. jax_linear_attention-0.1.0/tests/test_conv_l2norm_plumbing.py +78 -0
  444. jax_linear_attention-0.1.0/tests/test_convert_hf.py +607 -0
  445. jax_linear_attention-0.1.0/tests/test_cross_entropy.py +113 -0
  446. jax_linear_attention-0.1.0/tests/test_cudnn_fsdp_pin.py +58 -0
  447. jax_linear_attention-0.1.0/tests/test_data_cidx.py +172 -0
  448. jax_linear_attention-0.1.0/tests/test_data_loader.py +87 -0
  449. jax_linear_attention-0.1.0/tests/test_data_sft.py +378 -0
  450. jax_linear_attention-0.1.0/tests/test_data_streaming.py +377 -0
  451. jax_linear_attention-0.1.0/tests/test_dispatch_ahead_multiprocess.py +143 -0
  452. jax_linear_attention-0.1.0/tests/test_distributed_mesh.py +199 -0
  453. jax_linear_attention-0.1.0/tests/test_distributed_multidevice.py +113 -0
  454. jax_linear_attention-0.1.0/tests/test_distributed_multiprocess.py +164 -0
  455. jax_linear_attention-0.1.0/tests/test_dpo.py +619 -0
  456. jax_linear_attention-0.1.0/tests/test_dsa_gather.py +166 -0
  457. jax_linear_attention-0.1.0/tests/test_eval_perplexity.py +187 -0
  458. jax_linear_attention-0.1.0/tests/test_expert_parallel.py +454 -0
  459. jax_linear_attention-0.1.0/tests/test_flops_presets.py +40 -0
  460. jax_linear_attention-0.1.0/tests/test_forgetting_attention.py +302 -0
  461. jax_linear_attention-0.1.0/tests/test_fp8_attention.py +543 -0
  462. jax_linear_attention-0.1.0/tests/test_fp8_min_features.py +128 -0
  463. jax_linear_attention-0.1.0/tests/test_fp8_multidevice.py +82 -0
  464. jax_linear_attention-0.1.0/tests/test_fp8_remat_names.py +96 -0
  465. jax_linear_attention-0.1.0/tests/test_fp8_swiglu.py +289 -0
  466. jax_linear_attention-0.1.0/tests/test_fp8_training.py +473 -0
  467. jax_linear_attention-0.1.0/tests/test_fp8_weight_once.py +423 -0
  468. jax_linear_attention-0.1.0/tests/test_gated_delta_product.py +270 -0
  469. jax_linear_attention-0.1.0/tests/test_gdn2_fast_paths.py +289 -0
  470. jax_linear_attention-0.1.0/tests/test_gdn2_mamba3_ops.py +245 -0
  471. jax_linear_attention-0.1.0/tests/test_generate.py +454 -0
  472. jax_linear_attention-0.1.0/tests/test_grad_reduce.py +274 -0
  473. jax_linear_attention-0.1.0/tests/test_grad_reduce_gpu.py +210 -0
  474. jax_linear_attention-0.1.0/tests/test_hybrid_presets_1p3b.py +154 -0
  475. jax_linear_attention-0.1.0/tests/test_init_parity.py +549 -0
  476. jax_linear_attention-0.1.0/tests/test_kernel_sharding.py +578 -0
  477. jax_linear_attention-0.1.0/tests/test_kernel_sharding_gla_mlstm_mamba1.py +115 -0
  478. jax_linear_attention-0.1.0/tests/test_kernel_sharding_rules.py +446 -0
  479. jax_linear_attention-0.1.0/tests/test_layers_attention.py +219 -0
  480. jax_linear_attention-0.1.0/tests/test_layers_basic.py +133 -0
  481. jax_linear_attention-0.1.0/tests/test_layers_conv.py +97 -0
  482. jax_linear_attention-0.1.0/tests/test_layers_gated_deltaproduct.py +115 -0
  483. jax_linear_attention-0.1.0/tests/test_layers_grouped_heads_precision.py +93 -0
  484. jax_linear_attention-0.1.0/tests/test_layers_linear_attention.py +204 -0
  485. jax_linear_attention-0.1.0/tests/test_layers_ssm.py +392 -0
  486. jax_linear_attention-0.1.0/tests/test_lean_conv_l2norm.py +220 -0
  487. jax_linear_attention-0.1.0/tests/test_lean_fp8.py +140 -0
  488. jax_linear_attention-0.1.0/tests/test_lean_vjp.py +387 -0
  489. jax_linear_attention-0.1.0/tests/test_lm_eval_adapter.py +313 -0
  490. jax_linear_attention-0.1.0/tests/test_log_linear_layer.py +87 -0
  491. jax_linear_attention-0.1.0/tests/test_log_linear_ops.py +195 -0
  492. jax_linear_attention-0.1.0/tests/test_long_context.py +639 -0
  493. jax_linear_attention-0.1.0/tests/test_mamba1.py +391 -0
  494. jax_linear_attention-0.1.0/tests/test_mamba2_fused.py +369 -0
  495. jax_linear_attention-0.1.0/tests/test_mamba2_fused_multidevice.py +226 -0
  496. jax_linear_attention-0.1.0/tests/test_mamba2_in_place_zx.py +164 -0
  497. jax_linear_attention-0.1.0/tests/test_mamba3_mimo.py +276 -0
  498. jax_linear_attention-0.1.0/tests/test_mamba3_mimo_release.py +138 -0
  499. jax_linear_attention-0.1.0/tests/test_mamba3_mimo_vjp.py +97 -0
  500. jax_linear_attention-0.1.0/tests/test_mixer_fast_paths.py +270 -0
  501. jax_linear_attention-0.1.0/tests/test_mla.py +329 -0
  502. jax_linear_attention-0.1.0/tests/test_mlstm_layer.py +88 -0
  503. jax_linear_attention-0.1.0/tests/test_mlstm_ops.py +219 -0
  504. jax_linear_attention-0.1.0/tests/test_moba.py +222 -0
  505. jax_linear_attention-0.1.0/tests/test_models_lm.py +332 -0
  506. jax_linear_attention-0.1.0/tests/test_models_lm_extra.py +550 -0
  507. jax_linear_attention-0.1.0/tests/test_moe.py +157 -0
  508. jax_linear_attention-0.1.0/tests/test_moe_per_device.py +87 -0
  509. jax_linear_attention-0.1.0/tests/test_moe_permute.py +163 -0
  510. jax_linear_attention-0.1.0/tests/test_moe_two_gpus.py +160 -0
  511. jax_linear_attention-0.1.0/tests/test_mosaic_gpu_attention.py +946 -0
  512. jax_linear_attention-0.1.0/tests/test_mosaic_gpu_attention_persistent.py +346 -0
  513. jax_linear_attention-0.1.0/tests/test_mosaic_gpu_common.py +71 -0
  514. jax_linear_attention-0.1.0/tests/test_mosaic_gpu_dsa.py +688 -0
  515. jax_linear_attention-0.1.0/tests/test_mosaic_gpu_dsa_topk.py +243 -0
  516. jax_linear_attention-0.1.0/tests/test_mosaic_gpu_fused_gemm.py +235 -0
  517. jax_linear_attention-0.1.0/tests/test_mosaic_gpu_gated_delta_rule.py +763 -0
  518. jax_linear_attention-0.1.0/tests/test_mosaic_gpu_gdn2.py +193 -0
  519. jax_linear_attention-0.1.0/tests/test_mosaic_gpu_gdn_hd256.py +400 -0
  520. jax_linear_attention-0.1.0/tests/test_mosaic_gpu_gdn_split.py +456 -0
  521. jax_linear_attention-0.1.0/tests/test_mosaic_gpu_gla.py +362 -0
  522. jax_linear_attention-0.1.0/tests/test_mosaic_gpu_grid_limits.py +193 -0
  523. jax_linear_attention-0.1.0/tests/test_mosaic_gpu_kda.py +402 -0
  524. jax_linear_attention-0.1.0/tests/test_mosaic_gpu_linear_cross_entropy.py +345 -0
  525. jax_linear_attention-0.1.0/tests/test_mosaic_gpu_linear_cross_entropy_objective.py +536 -0
  526. jax_linear_attention-0.1.0/tests/test_mosaic_gpu_mamba1.py +346 -0
  527. jax_linear_attention-0.1.0/tests/test_mosaic_gpu_mamba3.py +476 -0
  528. jax_linear_attention-0.1.0/tests/test_mosaic_gpu_mamba3_fused.py +365 -0
  529. jax_linear_attention-0.1.0/tests/test_mosaic_gpu_mamba3_mimo.py +82 -0
  530. jax_linear_attention-0.1.0/tests/test_mosaic_gpu_mamba3_mimo_kernels.py +310 -0
  531. jax_linear_attention-0.1.0/tests/test_mosaic_gpu_mla_attention.py +357 -0
  532. jax_linear_attention-0.1.0/tests/test_mosaic_gpu_mlstm.py +308 -0
  533. jax_linear_attention-0.1.0/tests/test_mosaic_gpu_ragged_dot.py +426 -0
  534. jax_linear_attention-0.1.0/tests/test_mosaic_gpu_ragged_dot_fp8.py +66 -0
  535. jax_linear_attention-0.1.0/tests/test_mosaic_gpu_rwkv7.py +648 -0
  536. jax_linear_attention-0.1.0/tests/test_mosaic_gpu_scalar_gate_docs.py +332 -0
  537. jax_linear_attention-0.1.0/tests/test_mosaic_gpu_scalar_gate_grouped.py +227 -0
  538. jax_linear_attention-0.1.0/tests/test_mosaic_gpu_short_conv.py +219 -0
  539. jax_linear_attention-0.1.0/tests/test_mosaic_gpu_short_conv_l2norm.py +275 -0
  540. jax_linear_attention-0.1.0/tests/test_mosaic_gpu_vector_gate_fused.py +106 -0
  541. jax_linear_attention-0.1.0/tests/test_mtp.py +136 -0
  542. jax_linear_attention-0.1.0/tests/test_mtp_grad_in_forward.py +171 -0
  543. jax_linear_attention-0.1.0/tests/test_path_attention.py +302 -0
  544. jax_linear_attention-0.1.0/tests/test_pipeline_parallel.py +565 -0
  545. jax_linear_attention-0.1.0/tests/test_presets_production.py +214 -0
  546. jax_linear_attention-0.1.0/tests/test_profile_1p3b.py +263 -0
  547. jax_linear_attention-0.1.0/tests/test_reference_ops.py +201 -0
  548. jax_linear_attention-0.1.0/tests/test_remat_policies.py +234 -0
  549. jax_linear_attention-0.1.0/tests/test_rope_exact_angles.py +91 -0
  550. jax_linear_attention-0.1.0/tests/test_rwkv6_hgrn2.py +345 -0
  551. jax_linear_attention-0.1.0/tests/test_rwkv7.py +216 -0
  552. jax_linear_attention-0.1.0/tests/test_rwkv7_kernel_glue.py +173 -0
  553. jax_linear_attention-0.1.0/tests/test_rwkv7_layer_bounded.py +380 -0
  554. jax_linear_attention-0.1.0/tests/test_rwkv7_mixer_dtype.py +106 -0
  555. jax_linear_attention-0.1.0/tests/test_rwkv7_model.py +95 -0
  556. jax_linear_attention-0.1.0/tests/test_rwkv7_official.py +154 -0
  557. jax_linear_attention-0.1.0/tests/test_short_conv_impl.py +66 -0
  558. jax_linear_attention-0.1.0/tests/test_sparse_attention.py +341 -0
  559. jax_linear_attention-0.1.0/tests/test_speed_of_light_step.py +227 -0
  560. jax_linear_attention-0.1.0/tests/test_trainer_dispatch_ahead.py +58 -0
  561. jax_linear_attention-0.1.0/tests/test_trainer_e2e.py +82 -0
  562. jax_linear_attention-0.1.0/tests/test_trainer_gc_freeze.py +97 -0
  563. jax_linear_attention-0.1.0/tests/test_trainer_resume.py +99 -0
  564. jax_linear_attention-0.1.0/tests/test_trainer_sft.py +198 -0
  565. jax_linear_attention-0.1.0/tests/test_trainer_stream.py +92 -0
  566. jax_linear_attention-0.1.0/tests/test_training_gpu_setup.py +143 -0
  567. jax_linear_attention-0.1.0/tests/test_training_graph_health.py +140 -0
  568. jax_linear_attention-0.1.0/tests/test_training_loggers.py +120 -0
  569. jax_linear_attention-0.1.0/tests/test_training_metrics_sink.py +37 -0
  570. jax_linear_attention-0.1.0/tests/test_training_mixed_precision.py +65 -0
  571. jax_linear_attention-0.1.0/tests/test_training_optimizers.py +224 -0
  572. jax_linear_attention-0.1.0/tests/test_training_performance.py +141 -0
  573. jax_linear_attention-0.1.0/tests/test_training_runtime.py +130 -0
  574. jax_linear_attention-0.1.0/tests/test_training_schedulers.py +78 -0
  575. jax_linear_attention-0.1.0/tests/test_training_step.py +229 -0
  576. jax_linear_attention-0.1.0/tests/test_training_telemetry.py +111 -0
  577. jax_linear_attention-0.1.0/tests/test_ttt_layer.py +118 -0
  578. jax_linear_attention-0.1.0/tests/test_ttt_linear.py +149 -0
  579. jax_linear_attention-0.1.0/tests/test_update_guard.py +97 -0
  580. jax_linear_attention-0.1.0/tests/test_vector_gate_bwd_schedule.py +141 -0
  581. jax_linear_attention-0.1.0/tests/test_vector_gate_causality.py +124 -0
  582. jax_linear_attention-0.1.0/tests/test_vector_gate_doc_split.py +152 -0
  583. jax_linear_attention-0.1.0/tests/test_vector_gate_gate_grads.py +85 -0
  584. jax_linear_attention-0.1.0/tests/test_xla_tuning_1p3b.py +35 -0
  585. jax_linear_attention-0.1.0/tests/test_zero_copy_layouts.py +136 -0
@@ -0,0 +1,73 @@
1
+ # Changelog
2
+
3
+ Notable changes to jax-linear-attention. Versions follow [semantic versioning](https://semver.org/);
4
+ before 1.0 a minor release may change APIs.
5
+
6
+ ## 0.1.0 - 2026-10-21
7
+
8
+ First public release.
9
+
10
+ Requirements: Python 3.12 or newer and JAX 0.11.2 (pinned). The Mosaic GPU kernels need an NVIDIA
11
+ Hopper GPU (H100/H200, sm_90a) and a CUDA 13 driver; on any other device every op runs its plain-JAX
12
+ implementation. `requirements/jax-0.11.2-cuda13.txt` pins the tested CUDA 13 stack as a pip
13
+ constraints file.
14
+
15
+ ### Kernels
16
+
17
+ - Pallas Mosaic GPU kernels, forward and backward, for Mamba-2, Mamba-3 (SISO and MIMO), Mamba-1,
18
+ Gated DeltaNet and DeltaNet, Gated DeltaNet-2, KDA, RWKV-7, GLA and mLSTM, with packed documents
19
+ (`segment_ids`), grouped heads, and initial and final states.
20
+ - An FA3-style softmax attention kernel (causal, sliding windows, packed documents, GQA, sinks) with a
21
+ deterministic default backward and an opt-in fused one-kernel backward, an FP8 attention backward,
22
+ Multi-head Latent Attention, and DeepSeek Sparse Attention with an exact top-k kernel.
23
+ - A grouped-GEMM kernel for dropless MoE, a fused cross-entropy kernel and fused FP8 SwiGLU kernels.
24
+ - One fail-closed dispatcher (`impl="auto"`): every recurrence also ships a token-by-token reference
25
+ and a chunk-parallel JAX op, and a kernel runs only for the calls its GPU tests cover.
26
+ - Plain-JAX or opt-in paths for log-linear Mamba-2, Gated DeltaProduct, HGRN2, RWKV-6, TTT-Linear,
27
+ MiniMax-01 lightning attention, FoX, PaTH attention, MoBA and NSA sparse attention.
28
+
29
+ ### Training
30
+
31
+ - Models: a Llama/Qwen3-style transformer, Mamba-2, Mamba-3, Gated DeltaNet, Gated DeltaNet-2, KDA,
32
+ RWKV-7 and hybrids of any of them with attention (including Kimi Linear's and Qwen3-Next's layouts),
33
+ mixture-of-experts and multi-token prediction; presets from `tiny` CPU models to FLA's published
34
+ 1.3B shapes.
35
+ - One compiled train step with fp32 gradient accumulation and non-finite step rejection; data, FSDP,
36
+ tensor, expert and pipeline parallelism, and context-parallel attention as a library; FP8 training
37
+ with delayed scaling; remat policies and memory-lean VJPs; crash-consistent checkpoints with exact
38
+ resume; memory-mapped, streamed and SFT data; DPO preference tuning; JSONL, Weights & Biases and
39
+ TensorBoard logging.
40
+ - Generation, perplexity and lm-evaluation-harness evaluation; Hugging Face import and export.
41
+ - Command line: `jla train`, `show-config`, `tokenize`, `generate`, `eval`, `convert` and `dpo`.
42
+
43
+ ### Performance
44
+
45
+ Measured on H100s with JAX 0.11.2 on 20 Oct 2026, against the latest upstream code of that day. Kernel
46
+ ratios are forward + backward, the other implementation's time over ours.
47
+
48
+ - `transformer-1p3b` in FP8: 72.3% MFU on one H100 (77,094 tokens/s) and 68.2% MFU per GPU on 8 H100s
49
+ with FSDP 8 (72,709 tokens/s per GPU, 1.47x flame).
50
+ - Against flame (FLA's trainer) on one H100 with the same tokens: 1.04-1.67x in bf16 and 1.10-1.77x in
51
+ FP8 for the 1.3B transformer, sliding-window, Gated DeltaNet, KDA and Mamba-2 presets, and 1.55x for
52
+ Mamba-3 in bf16.
53
+ - In the Gated DeltaNet-2 paper's Figure 2 setting (1.3B hybrids on one H100, 16K tokens per step):
54
+ every model of the figure 1.14-1.41x the paper's numbers with a 32,000-token vocabulary. Gated DeltaNet-2 runs at 52.1 and 49.1 thousand tokens/s at 2K × 8 and 16K × 1, against
55
+ 38.0 and 36.1 ([gdn2_paper.md](benchmarks/gdn2_paper.md)).
56
+ - Kernels: the Mamba-2 scan 1.20-1.96x the official Triton kernels (the whole Mamba-2 layer 1.17-1.41x
57
+ the official fused training path), Mamba-3 SISO 1.58-2.32x and MIMO 2.70-5.37x the official
58
+ recurrence kernels, Mamba-1 1.72-1.85x the official CUDA selective scan (`d_state` 16), GLA 1.52-1.77x
59
+ FLA (dense), KDA 1.47-1.78x FLA, RWKV-7 1.06-1.46x FLA, Gated DeltaNet 1.71-2.68x FLA's Triton kernels
60
+ and 0.73-1.26x FlashQLA, and MLA 1.01-1.05x cuDNN.
61
+
62
+ Every shape, baseline commit and method: [docs/results.md](docs/results.md),
63
+ [docs/kernels.md](docs/kernels.md) and [benchmarks/](benchmarks/README.md).
64
+
65
+ ### Known limitations
66
+
67
+ - Slower than FlashQLA for Gated DeltaNet on long single sequences and with packed documents at few
68
+ heads, slower than FLA for Gated DeltaNet at head dim 64 with packed documents in short rows, slower
69
+ than FA3 for causal softmax attention, and slower than FlashKDA for KDA inference; see
70
+ [Where we lose](README.md#where-we-lose).
71
+ - Hopper only, with one pinned JAX version. The Gated DeltaNet piece-scan kernel, the Mamba-2 row
72
+ kernels and the FP8 SwiGLU kernels use Pallas Triton, which JAX 0.11.2 runs with a
73
+ DeprecationWarning; they will move to Mosaic GPU before the JAX pin moves.
@@ -0,0 +1,20 @@
1
+ cff-version: 1.2.0
2
+ message: "If you use this software, please cite it as below."
3
+ type: software
4
+ title: "jax-linear-attention"
5
+ abstract: >-
6
+ A JAX LLM training template with Pallas Mosaic GPU kernels for linear attention,
7
+ state-space models and softmax attention on NVIDIA Hopper.
8
+ authors:
9
+ - name: "KarLex AI, Inc."
10
+ version: "0.1.0"
11
+ date-released: "2026-10-21"
12
+ license: Apache-2.0
13
+ keywords:
14
+ - jax
15
+ - pallas
16
+ - mosaic-gpu
17
+ - linear-attention
18
+ - state-space-models
19
+ - llm-training
20
+ repository-code: "https://github.com/jla-org/jax-linear-attention"
@@ -0,0 +1,72 @@
1
+ # Contributing
2
+
3
+ Bug reports, fixes, kernels and ports are welcome. For anything larger than a fix, please open an
4
+ issue first to agree on the approach.
5
+
6
+ ## Setup
7
+
8
+ Python 3.12 or newer and JAX 0.11.2 (pinned):
9
+
10
+ ```bash
11
+ git clone https://github.com/jla-org/jax-linear-attention.git && cd jax-linear-attention
12
+ pip install -e ".[cuda,test]" # Linux + NVIDIA Hopper GPU (CUDA 13 wheels)
13
+ pip install -e ".[test]" # CPU only
14
+ ```
15
+
16
+ ## Tests
17
+
18
+ All tests run on CPU except the GPU-only kernel and cuDNN tests, which skip there:
19
+
20
+ ```bash
21
+ pytest tests/ # CPU machine: the whole CPU suite
22
+ JAX_PLATFORMS=cpu pytest tests/ # GPU host: CPU only, plus the kernels' CPU interpreter tests
23
+ pytest tests/ # H100: also the Mosaic GPU kernel and cuDNN tests
24
+ pytest tests/test_long_context.py --run-long-context # opt-in, one H100 (calls past 2^31 elements)
25
+ pytest tests/ --run-slow # opt-in, H100: also the slow GPU kernel cases (minutes each),
26
+ # such as the whole-op checks in tests/test_vector_gate_bwd_schedule.py
27
+ ```
28
+
29
+ Tests that need an optional extra (`transformers`, `lm-eval`, `wandb`, ...) skip when it is not
30
+ installed, and multi-GPU tests skip on fewer GPUs. Please run the CPU suite before opening a pull
31
+ request, and say which GPU tests you ran. CI runs a fast set of the CPU tests on every pull request
32
+ and push to `main` (about 10 minutes; the list is in `.github/workflows/ci.yml`), and the whole CPU
33
+ suite nightly and on demand.
34
+
35
+ ## Mosaic GPU kernels
36
+
37
+ - Kernels target H100 (sm_90a) with JAX 0.11.2. The Mosaic GPU APIs change with every JAX release,
38
+ so the JAX version is pinned and kernels are written against it.
39
+ - Every recurrence ships as a token-by-token reference (the oracle), a chunk-parallel JAX version
40
+ (`chunked`) and, where available, a Mosaic GPU kernel.
41
+ - A kernel registers a strict `supports` check (`jla.ops.register`). `impl="auto"` uses the kernel
42
+ only for the calls its GPU tests cover; every other call runs the chunked op.
43
+ - `segment_ids [B, T]` restarts the state at every document boundary, with the same semantics in
44
+ every implementation.
45
+ - Algorithms are exact: fp32 states and accumulation, no approximate gates. `exp` and similar
46
+ functions may use Mosaic GPU's `approx_math`.
47
+ - Test a kernel against the reference and, where one exists, the latest upstream code, with
48
+ packed documents, grouped heads, initial and final states and decode parity. GPU tests skip
49
+ off Hopper.
50
+ - Benchmarks follow [benchmarks/README.md](benchmarks/README.md): GPU kernel time per call,
51
+ interleaved with the baseline on one GPU, with the baseline's commit recorded.
52
+ - Minimal reproductions of Mosaic GPU issues go in `benchmarks/mosaic_gpu_repros/`.
53
+
54
+ ## Adapted code and licences
55
+
56
+ The project is Apache-2.0. Code adapted from another project names that project and its source
57
+ files in a header comment, the project is listed in `NOTICE`, and its licence text goes in
58
+ `licenses/`. New source files start with a copyright line and
59
+ `# SPDX-License-Identifier: Apache-2.0`, as the existing files do.
60
+
61
+ ## Sign-off (DCO)
62
+
63
+ Contributions are accepted under the [Developer Certificate of Origin 1.1](https://developercertificate.org/).
64
+ Sign off every commit:
65
+
66
+ ```bash
67
+ git commit -s
68
+ ```
69
+
70
+ This adds a `Signed-off-by: Your Name <your email>` line, which certifies that you wrote the
71
+ change or have the right to submit it under the project's licence. Commits without a sign-off
72
+ cannot be merged.
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright 2026 KarLex AI, Inc.
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,8 @@
1
+ # The sdist also carries what the tests and the README quick start read, the tested pins and the release files.
2
+ graft benchmarks
3
+ graft configs
4
+ graft docs
5
+ graft tests
6
+ graft requirements
7
+ include CHANGELOG.md CONTRIBUTING.md CITATION.cff
8
+ global-exclude *.py[cod] .DS_Store