libthx 0.3.0__tar.gz → 0.4.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 (386) hide show
  1. libthx-0.4.0/PKG-INFO +180 -0
  2. libthx-0.4.0/README.md +87 -0
  3. libthx-0.4.0/libthx.egg-info/PKG-INFO +180 -0
  4. {libthx-0.3.0 → libthx-0.4.0}/libthx.egg-info/SOURCES.txt +135 -66
  5. libthx-0.4.0/libthx.egg-info/entry_points.txt +2 -0
  6. {libthx-0.3.0 → libthx-0.4.0}/libthx.egg-info/requires.txt +39 -27
  7. {libthx-0.3.0 → libthx-0.4.0}/pyproject.toml +62 -57
  8. libthx-0.4.0/tests/test_addition_dataset.py +139 -0
  9. libthx-0.4.0/tests/test_analysis.py +576 -0
  10. libthx-0.4.0/tests/test_base.py +164 -0
  11. libthx-0.4.0/tests/test_bundle.py +87 -0
  12. libthx-0.4.0/tests/test_checkpoint.py +306 -0
  13. libthx-0.4.0/tests/test_cleanup.py +145 -0
  14. libthx-0.4.0/tests/test_cli.py +83 -0
  15. libthx-0.4.0/tests/test_cli_browser.py +477 -0
  16. libthx-0.4.0/tests/test_cli_configure.py +408 -0
  17. libthx-0.4.0/tests/test_cli_execute.py +93 -0
  18. libthx-0.4.0/tests/test_cli_import.py +189 -0
  19. libthx-0.4.0/tests/test_cli_logs.py +99 -0
  20. libthx-0.4.0/tests/test_cli_run.py +188 -0
  21. libthx-0.4.0/tests/test_cli_verbosity.py +44 -0
  22. libthx-0.4.0/tests/test_combobulator.py +381 -0
  23. libthx-0.4.0/tests/test_comet_logging.py +141 -0
  24. {libthx-0.3.0 → libthx-0.4.0}/tests/test_contrastive_roundtrip.py +7 -4
  25. libthx-0.4.0/tests/test_data.py +268 -0
  26. {libthx-0.3.0 → libthx-0.4.0}/tests/test_eval_padding.py +61 -6
  27. libthx-0.4.0/tests/test_execute_bootstrap.py +748 -0
  28. libthx-0.4.0/tests/test_execute_bootstrap_generate.py +23 -0
  29. libthx-0.4.0/tests/test_execute_dispatch.py +355 -0
  30. libthx-0.4.0/tests/test_execute_provider_utils.py +62 -0
  31. libthx-0.4.0/tests/test_execute_run.py +452 -0
  32. libthx-0.4.0/tests/test_execute_solve.py +620 -0
  33. libthx-0.4.0/tests/test_execute_volcano.py +182 -0
  34. libthx-0.4.0/tests/test_flywheel_determinism.py +298 -0
  35. libthx-0.4.0/tests/test_flywheel_reads.py +204 -0
  36. libthx-0.4.0/tests/test_gpu_availability.py +33 -0
  37. libthx-0.4.0/tests/test_hardware_discovery.py +64 -0
  38. libthx-0.4.0/tests/test_hardware_dispatch.py +97 -0
  39. libthx-0.4.0/tests/test_inference.py +91 -0
  40. libthx-0.4.0/tests/test_job.py +457 -0
  41. {libthx-0.3.0 → libthx-0.4.0}/tests/test_kv_cache.py +23 -0
  42. {libthx-0.3.0 → libthx-0.4.0}/tests/test_lora.py +0 -45
  43. libthx-0.4.0/tests/test_mfu.py +82 -0
  44. libthx-0.4.0/tests/test_model_flops.py +37 -0
  45. libthx-0.4.0/tests/test_module_debug.py +323 -0
  46. libthx-0.4.0/tests/test_optimizers.py +128 -0
  47. libthx-0.4.0/tests/test_optional_dependencies.py +101 -0
  48. libthx-0.4.0/tests/test_profiler.py +304 -0
  49. libthx-0.4.0/tests/test_quick.py +511 -0
  50. {libthx-0.3.0 → libthx-0.4.0}/tests/test_registries.py +13 -17
  51. libthx-0.4.0/tests/test_rollout_chat_tokenization.py +138 -0
  52. libthx-0.4.0/tests/test_rollout_eos.py +90 -0
  53. libthx-0.4.0/tests/test_scalar_metadata.py +110 -0
  54. libthx-0.4.0/tests/test_schedules.py +119 -0
  55. libthx-0.4.0/tests/test_sharding.py +488 -0
  56. libthx-0.4.0/tests/test_stack_e2e.py +332 -0
  57. libthx-0.4.0/tests/test_store.py +649 -0
  58. libthx-0.4.0/tests/test_store_delta.py +295 -0
  59. libthx-0.4.0/tests/test_trainer_lifecycle.py +245 -0
  60. libthx-0.4.0/tests/test_unembedding_dtype.py +46 -0
  61. libthx-0.4.0/theseus/analysis/__init__.py +11 -0
  62. libthx-0.4.0/theseus/analysis/attention.py +131 -0
  63. libthx-0.4.0/theseus/analysis/base.py +211 -0
  64. libthx-0.4.0/theseus/analysis/plots.py +138 -0
  65. libthx-0.4.0/theseus/analysis/trace.py +97 -0
  66. {libthx-0.3.0 → libthx-0.4.0}/theseus/base/__init__.py +8 -1
  67. libthx-0.4.0/theseus/base/axis.py +116 -0
  68. libthx-0.4.0/theseus/base/chip.py +182 -0
  69. libthx-0.4.0/theseus/base/dag.py +56 -0
  70. {libthx-0.3.0 → libthx-0.4.0}/theseus/base/hardware.py +133 -161
  71. {libthx-0.3.0 → libthx-0.4.0}/theseus/base/job.py +6 -3
  72. {libthx-0.3.0 → libthx-0.4.0}/theseus/base/topology.py +12 -16
  73. libthx-0.4.0/theseus/checkpoint.py +179 -0
  74. libthx-0.4.0/theseus/cli/app.py +80 -0
  75. libthx-0.4.0/theseus/cli/cleanup.py +58 -0
  76. libthx-0.4.0/theseus/cli/configurator/__init__.py +128 -0
  77. libthx-0.4.0/theseus/cli/configurator/fields.py +75 -0
  78. libthx-0.4.0/theseus/cli/configurator/steps.py +113 -0
  79. libthx-0.4.0/theseus/cli/configure.py +126 -0
  80. libthx-0.4.0/theseus/cli/interface/actions.py +49 -0
  81. libthx-0.4.0/theseus/cli/interface/age.py +35 -0
  82. libthx-0.4.0/theseus/cli/interface/cache.py +79 -0
  83. libthx-0.4.0/theseus/cli/interface/chart.js +179 -0
  84. libthx-0.4.0/theseus/cli/interface/chart.py +258 -0
  85. libthx-0.4.0/theseus/cli/interface/data.py +323 -0
  86. libthx-0.4.0/theseus/cli/interface/driver.py +234 -0
  87. libthx-0.4.0/theseus/cli/interface/fields.py +47 -0
  88. libthx-0.4.0/theseus/cli/interface/keyboard.js +59 -0
  89. libthx-0.4.0/theseus/cli/interface/location.py +63 -0
  90. libthx-0.4.0/theseus/cli/interface/log_data.py +149 -0
  91. libthx-0.4.0/theseus/cli/interface/log_list.py +116 -0
  92. libthx-0.4.0/theseus/cli/interface/log_view.py +140 -0
  93. libthx-0.4.0/theseus/cli/interface/navigation.py +60 -0
  94. libthx-0.4.0/theseus/cli/interface/plot.py +122 -0
  95. libthx-0.4.0/theseus/cli/interface/plot_controls.py +104 -0
  96. libthx-0.4.0/theseus/cli/interface/plot_math.py +129 -0
  97. libthx-0.4.0/theseus/cli/interface/plotly_options.py +76 -0
  98. libthx-0.4.0/theseus/cli/interface/run.py +160 -0
  99. libthx-0.4.0/theseus/cli/interface/state.py +216 -0
  100. libthx-0.4.0/theseus/cli/interface/status.py +80 -0
  101. libthx-0.4.0/theseus/cli/interface/terminal.css +471 -0
  102. libthx-0.4.0/theseus/cli/interface/timeline.py +93 -0
  103. libthx-0.4.0/theseus/cli/interface/tree.py +200 -0
  104. libthx-0.4.0/theseus/cli/interface/tree_row.py +46 -0
  105. libthx-0.4.0/theseus/cli/interface/view.py +66 -0
  106. libthx-0.4.0/theseus/cli/interface/views.py +43 -0
  107. libthx-0.4.0/theseus/cli/interface/walk.py +34 -0
  108. libthx-0.4.0/theseus/cli/jobs.py +28 -0
  109. libthx-0.4.0/theseus/cli/run.py +60 -0
  110. libthx-0.4.0/theseus/cli/submit.py +116 -0
  111. libthx-0.4.0/theseus/cli/ui.py +64 -0
  112. {libthx-0.3.0 → libthx-0.4.0}/theseus/config.py +10 -9
  113. {libthx-0.3.0 → libthx-0.4.0}/theseus/data/__init__.py +0 -2
  114. {libthx-0.3.0 → libthx-0.4.0}/theseus/data/datasets/__init__.py +35 -1
  115. libthx-0.4.0/theseus/data/datasets/addition.py +138 -0
  116. {libthx-0.3.0 → libthx-0.4.0}/theseus/data/datasets/alpaca.py +12 -2
  117. {libthx-0.3.0 → libthx-0.4.0}/theseus/data/datasets/bbq.py +14 -3
  118. {libthx-0.3.0 → libthx-0.4.0}/theseus/data/datasets/ccaligned.py +11 -6
  119. {libthx-0.3.0 → libthx-0.4.0}/theseus/data/datasets/cfq.py +16 -3
  120. {libthx-0.3.0 → libthx-0.4.0}/theseus/data/datasets/clutrr.py +14 -7
  121. libthx-0.4.0/theseus/data/datasets/dataset.py +112 -0
  122. {libthx-0.3.0 → libthx-0.4.0}/theseus/data/datasets/fever.py +20 -3
  123. libthx-0.4.0/theseus/data/datasets/fineweb.py +29 -0
  124. libthx-0.4.0/theseus/data/datasets/fineweb_edu.py +33 -0
  125. {libthx-0.3.0 → libthx-0.4.0}/theseus/data/datasets/flan.py +12 -1
  126. {libthx-0.3.0 → libthx-0.4.0}/theseus/data/datasets/harmfulqa.py +15 -3
  127. {libthx-0.3.0 → libthx-0.4.0}/theseus/data/datasets/longbench.py +1 -1
  128. {libthx-0.3.0 → libthx-0.4.0}/theseus/data/datasets/longhealth.py +1 -1
  129. {libthx-0.3.0 → libthx-0.4.0}/theseus/data/datasets/mmlu.py +14 -3
  130. {libthx-0.3.0 → libthx-0.4.0}/theseus/data/datasets/mnli.py +12 -2
  131. {libthx-0.3.0 → libthx-0.4.0}/theseus/data/datasets/mtob.py +14 -2
  132. {libthx-0.3.0 → libthx-0.4.0}/theseus/data/datasets/openr1_math.py +13 -2
  133. {libthx-0.3.0 → libthx-0.4.0}/theseus/data/datasets/pes2o.py +14 -9
  134. {libthx-0.3.0 → libthx-0.4.0}/theseus/data/datasets/pg19.py +1 -1
  135. {libthx-0.3.0 → libthx-0.4.0}/theseus/data/datasets/pile.py +1 -5
  136. {libthx-0.3.0 → libthx-0.4.0}/theseus/data/datasets/pile_detoxify.py +1 -5
  137. {libthx-0.3.0 → libthx-0.4.0}/theseus/data/datasets/pile_injected.py +1 -5
  138. {libthx-0.3.0 → libthx-0.4.0}/theseus/data/datasets/qqp.py +14 -2
  139. {libthx-0.3.0 → libthx-0.4.0}/theseus/data/datasets/siqa.py +12 -2
  140. {libthx-0.3.0 → libthx-0.4.0}/theseus/data/datasets/squad.py +12 -2
  141. {libthx-0.3.0 → libthx-0.4.0}/theseus/data/datasets/sst2.py +12 -2
  142. {libthx-0.3.0 → libthx-0.4.0}/theseus/data/datasets/winogrande.py +16 -2
  143. libthx-0.4.0/theseus/data/tokenize.py +627 -0
  144. {libthx-0.3.0 → libthx-0.4.0}/theseus/data/tokenizer.py +4 -11
  145. {libthx-0.3.0 → libthx-0.4.0}/theseus/evaluation/__init__.py +2 -0
  146. {libthx-0.3.0 → libthx-0.4.0}/theseus/evaluation/base.py +167 -101
  147. {libthx-0.3.0 → libthx-0.4.0}/theseus/evaluation/datasets/__init__.py +3 -1
  148. libthx-0.4.0/theseus/evaluation/datasets/addition.py +69 -0
  149. {libthx-0.3.0 → libthx-0.4.0}/theseus/evaluation/datasets/alpaca.py +12 -2
  150. {libthx-0.3.0 → libthx-0.4.0}/theseus/evaluation/datasets/bbq.py +13 -2
  151. {libthx-0.3.0 → libthx-0.4.0}/theseus/evaluation/datasets/blimp.py +12 -2
  152. {libthx-0.3.0 → libthx-0.4.0}/theseus/evaluation/datasets/ccaligned.py +20 -4
  153. {libthx-0.3.0 → libthx-0.4.0}/theseus/evaluation/datasets/cfq.py +16 -2
  154. libthx-0.4.0/theseus/evaluation/datasets/clutrr.py +77 -0
  155. {libthx-0.3.0 → libthx-0.4.0}/theseus/evaluation/datasets/fever.py +21 -3
  156. {libthx-0.3.0 → libthx-0.4.0}/theseus/evaluation/datasets/longbench.py +12 -3
  157. {libthx-0.3.0 → libthx-0.4.0}/theseus/evaluation/datasets/longhealth.py +1 -1
  158. {libthx-0.3.0 → libthx-0.4.0}/theseus/evaluation/datasets/mnli.py +12 -2
  159. {libthx-0.3.0 → libthx-0.4.0}/theseus/evaluation/datasets/mtob.py +9 -2
  160. {libthx-0.3.0 → libthx-0.4.0}/theseus/evaluation/datasets/perplexity_evals.py +67 -8
  161. {libthx-0.3.0 → libthx-0.4.0}/theseus/evaluation/datasets/pes2o.py +13 -2
  162. {libthx-0.3.0 → libthx-0.4.0}/theseus/evaluation/datasets/pg19.py +13 -2
  163. {libthx-0.3.0 → libthx-0.4.0}/theseus/evaluation/datasets/pg19_lengthgen.py +1 -1
  164. {libthx-0.3.0 → libthx-0.4.0}/theseus/evaluation/datasets/pile.py +13 -2
  165. {libthx-0.3.0 → libthx-0.4.0}/theseus/evaluation/datasets/pile_injected.py +1 -1
  166. {libthx-0.3.0 → libthx-0.4.0}/theseus/evaluation/datasets/qqp.py +14 -2
  167. {libthx-0.3.0 → libthx-0.4.0}/theseus/evaluation/datasets/siqa.py +12 -2
  168. {libthx-0.3.0 → libthx-0.4.0}/theseus/evaluation/datasets/sst2.py +12 -2
  169. {libthx-0.3.0 → libthx-0.4.0}/theseus/evaluation/datasets/tinystories.py +14 -3
  170. {libthx-0.3.0 → libthx-0.4.0}/theseus/evaluation/datasets/winogrande.py +16 -2
  171. libthx-0.4.0/theseus/execute/__init__.py +6 -0
  172. libthx-0.4.0/theseus/execute/bootstrap.py +23 -0
  173. libthx-0.4.0/theseus/execute/bootstrap.sh +637 -0
  174. libthx-0.4.0/theseus/execute/bundle.py +167 -0
  175. libthx-0.4.0/theseus/execute/combobulator.py +395 -0
  176. libthx-0.4.0/theseus/execute/config.py +139 -0
  177. libthx-0.4.0/theseus/execute/dispatch.py +80 -0
  178. libthx-0.4.0/theseus/execute/provider/__init__.py +20 -0
  179. libthx-0.4.0/theseus/execute/provider/base.py +38 -0
  180. libthx-0.4.0/theseus/execute/provider/slurm/__init__.py +9 -0
  181. libthx-0.4.0/theseus/execute/provider/slurm/availability.py +112 -0
  182. libthx-0.4.0/theseus/execute/provider/slurm/provider.py +464 -0
  183. libthx-0.4.0/theseus/execute/provider/ssh.py +283 -0
  184. libthx-0.4.0/theseus/execute/provider/utils.py +239 -0
  185. libthx-0.4.0/theseus/execute/provider/volcano/__init__.py +228 -0
  186. libthx-0.4.0/theseus/execute/provider/volcano/config.py +46 -0
  187. libthx-0.4.0/theseus/execute/provider/volcano/manifest.py +90 -0
  188. libthx-0.4.0/theseus/execute/provider/volcano/transport.py +149 -0
  189. libthx-0.4.0/theseus/execute/run/__init__.py +5 -0
  190. libthx-0.4.0/theseus/execute/run/__main__.py +3 -0
  191. libthx-0.4.0/theseus/execute/run/lineage.py +76 -0
  192. libthx-0.4.0/theseus/execute/run/run.py +205 -0
  193. libthx-0.4.0/theseus/execute/solve.py +94 -0
  194. {libthx-0.3.0 → libthx-0.4.0}/theseus/experiments/__init__.py +4 -5
  195. libthx-0.4.0/theseus/experiments/benchmark.py +54 -0
  196. libthx-0.4.0/theseus/experiments/data/__init__.py +6 -0
  197. libthx-0.4.0/theseus/experiments/data/blockwise.py +100 -0
  198. libthx-0.4.0/theseus/experiments/data/streaming.py +40 -0
  199. libthx-0.4.0/theseus/experiments/forking/__init__.py +6 -0
  200. libthx-0.4.0/theseus/experiments/forking/pretrain.py +16 -0
  201. {libthx-0.3.0 → libthx-0.4.0}/theseus/experiments/models/gpt.py +5 -4
  202. {libthx-0.3.0 → libthx-0.4.0}/theseus/experiments/models/gpt_neox.py +8 -7
  203. {libthx-0.3.0 → libthx-0.4.0}/theseus/experiments/models/llama.py +8 -7
  204. {libthx-0.3.0 → libthx-0.4.0}/theseus/experiments/models/qwen.py +8 -7
  205. {libthx-0.3.0 → libthx-0.4.0}/theseus/experiments/models/qwen_3_5.py +13 -13
  206. libthx-0.4.0/theseus/inference/__init__.py +4 -0
  207. {libthx-0.3.0 → libthx-0.4.0}/theseus/inference/base.py +230 -177
  208. libthx-0.4.0/theseus/job.py +658 -0
  209. libthx-0.4.0/theseus/model/__init__.py +0 -0
  210. {libthx-0.3.0 → libthx-0.4.0}/theseus/model/attention/__init__.py +1 -2
  211. {libthx-0.3.0 → libthx-0.4.0}/theseus/model/attention/base.py +21 -7
  212. {libthx-0.3.0 → libthx-0.4.0}/theseus/model/attention/gated_delta.py +7 -6
  213. {libthx-0.3.0 → libthx-0.4.0}/theseus/model/attention/grouped.py +13 -4
  214. {libthx-0.3.0 → libthx-0.4.0}/theseus/model/axes.py +0 -3
  215. {libthx-0.3.0 → libthx-0.4.0}/theseus/model/block/__init__.py +3 -8
  216. libthx-0.4.0/theseus/model/block/block.py +94 -0
  217. {libthx-0.3.0 → libthx-0.4.0}/theseus/model/block/forking.py +64 -17
  218. {libthx-0.3.0 → libthx-0.4.0}/theseus/model/block/gpt_neox.py +7 -3
  219. {libthx-0.3.0 → libthx-0.4.0}/theseus/model/block/llama.py +7 -3
  220. {libthx-0.3.0 → libthx-0.4.0}/theseus/model/block/qwen.py +7 -3
  221. {libthx-0.3.0 → libthx-0.4.0}/theseus/model/block/qwen_3_5.py +7 -3
  222. libthx-0.4.0/theseus/model/debug.py +282 -0
  223. {libthx-0.3.0 → libthx-0.4.0}/theseus/model/layers/__init__.py +2 -3
  224. {libthx-0.3.0 → libthx-0.4.0}/theseus/model/layers/layernorm.py +3 -2
  225. {libthx-0.3.0 → libthx-0.4.0}/theseus/model/layers/mlp.py +16 -4
  226. {libthx-0.3.0 → libthx-0.4.0}/theseus/model/layers/rmsnorm.py +6 -5
  227. {libthx-0.3.0 → libthx-0.4.0}/theseus/model/layers/rope.py +0 -14
  228. {libthx-0.3.0 → libthx-0.4.0}/theseus/model/masks.py +1 -4
  229. {libthx-0.3.0 → libthx-0.4.0}/theseus/model/models/__init__.py +3 -10
  230. {libthx-0.3.0 → libthx-0.4.0}/theseus/model/models/base.py +85 -12
  231. {libthx-0.3.0 → libthx-0.4.0}/theseus/model/models/contrib/gpt_neox.py +34 -15
  232. {libthx-0.3.0 → libthx-0.4.0}/theseus/model/models/contrib/llama.py +34 -15
  233. {libthx-0.3.0 → libthx-0.4.0}/theseus/model/models/contrib/marin.py +34 -15
  234. {libthx-0.3.0 → libthx-0.4.0}/theseus/model/models/contrib/qwen.py +62 -29
  235. {libthx-0.3.0 → libthx-0.4.0}/theseus/model/models/contrib/qwen_3_5.py +35 -16
  236. {libthx-0.3.0 → libthx-0.4.0}/theseus/model/models/contrib/qwen_3_5_moe.py +11 -1
  237. {libthx-0.3.0 → libthx-0.4.0}/theseus/model/models/thoughtbubbles.py +29 -34
  238. {libthx-0.3.0 → libthx-0.4.0}/theseus/model/module.py +23 -24
  239. libthx-0.4.0/theseus/model/moe/__init__.py +5 -0
  240. {libthx-0.3.0 → libthx-0.4.0}/theseus/model/moe/base.py +38 -14
  241. {libthx-0.3.0 → libthx-0.4.0}/theseus/model/moe/shared.py +1 -1
  242. libthx-0.4.0/theseus/model/utils.py +28 -0
  243. libthx-0.4.0/theseus/quick.py +397 -0
  244. {libthx-0.3.0 → libthx-0.4.0}/theseus/registry.py +57 -6
  245. libthx-0.4.0/theseus/store.py +1271 -0
  246. libthx-0.4.0/theseus/training/backbone.py +100 -0
  247. libthx-0.4.0/theseus/training/base.py +1121 -0
  248. {libthx-0.3.0 → libthx-0.4.0}/theseus/training/contrastive.py +12 -50
  249. libthx-0.4.0/theseus/training/flywheel/__init__.py +0 -0
  250. {libthx-0.3.0 → libthx-0.4.0}/theseus/training/flywheel/contrastive.py +19 -42
  251. libthx-0.4.0/theseus/training/flywheel/dataset.py +85 -0
  252. libthx-0.4.0/theseus/training/flywheel/io.py +246 -0
  253. {libthx-0.3.0 → libthx-0.4.0}/theseus/training/flywheel/padded.py +30 -58
  254. libthx-0.4.0/theseus/training/flywheel/pmd.py +125 -0
  255. libthx-0.4.0/theseus/training/flywheel/strategy.py +135 -0
  256. libthx-0.4.0/theseus/training/flywheel/stream.py +200 -0
  257. {libthx-0.3.0 → libthx-0.4.0}/theseus/training/grpo.py +5 -5
  258. {libthx-0.3.0 → libthx-0.4.0}/theseus/training/kl_divergence.py +64 -168
  259. libthx-0.4.0/theseus/training/lora.py +313 -0
  260. libthx-0.4.0/theseus/training/optimizers/__init__.py +14 -0
  261. {libthx-0.3.0 → libthx-0.4.0}/theseus/training/optimizers/adamw.py +6 -0
  262. libthx-0.4.0/theseus/training/optimizers/base.py +16 -0
  263. {libthx-0.3.0 → libthx-0.4.0}/theseus/training/optimizers/muon.py +71 -24
  264. {libthx-0.3.0 → libthx-0.4.0}/theseus/training/ppo.py +70 -84
  265. libthx-0.4.0/theseus/training/profiler.html +82 -0
  266. libthx-0.4.0/theseus/training/profiler.py +203 -0
  267. libthx-0.4.0/theseus/training/schedules/__init__.py +17 -0
  268. libthx-0.4.0/theseus/training/schedules/base.py +14 -0
  269. {libthx-0.3.0 → libthx-0.4.0}/theseus/training/schedules/cosine_rewarm.py +4 -0
  270. {libthx-0.3.0 → libthx-0.4.0}/theseus/training/schedules/wsd.py +11 -2
  271. {libthx-0.3.0 → libthx-0.4.0}/theseus/training/schedules/wsds.py +4 -0
  272. {libthx-0.3.0 → libthx-0.4.0}/theseus/training/utils.py +25 -0
  273. libthx-0.3.0/PKG-INFO +0 -202
  274. libthx-0.3.0/README.md +0 -121
  275. libthx-0.3.0/libthx.egg-info/PKG-INFO +0 -202
  276. libthx-0.3.0/libthx.egg-info/entry_points.txt +0 -2
  277. libthx-0.3.0/tests/test_gpu_availability.py +0 -71
  278. libthx-0.3.0/tests/test_hardware_dispatch.py +0 -233
  279. libthx-0.3.0/tests/test_lact.py +0 -625
  280. libthx-0.3.0/tests/test_mamba.py +0 -651
  281. libthx-0.3.0/tests/test_vsubmit_log_fetcher.py +0 -201
  282. libthx-0.3.0/theseus/__init__.py +0 -1
  283. libthx-0.3.0/theseus/base/axis.py +0 -3
  284. libthx-0.3.0/theseus/base/chip.py +0 -109
  285. libthx-0.3.0/theseus/cli.py +0 -1927
  286. libthx-0.3.0/theseus/data/datasets/dataset.py +0 -75
  287. libthx-0.3.0/theseus/data/datasets/dictlearn.py +0 -188
  288. libthx-0.3.0/theseus/data/datasets/fineweb.py +0 -18
  289. libthx-0.3.0/theseus/data/datasets/redcodegen/hardening.py +0 -51
  290. libthx-0.3.0/theseus/data/tokenize.py +0 -894
  291. libthx-0.3.0/theseus/dispatch/__init__.py +0 -138
  292. libthx-0.3.0/theseus/dispatch/bootstrap.py +0 -576
  293. libthx-0.3.0/theseus/dispatch/config.py +0 -563
  294. libthx-0.3.0/theseus/dispatch/dispatch.py +0 -2219
  295. libthx-0.3.0/theseus/dispatch/mailbox/__init__.py +0 -29
  296. libthx-0.3.0/theseus/dispatch/mailbox/mailbox.py +0 -1148
  297. libthx-0.3.0/theseus/dispatch/mailbox/sidecar.py +0 -321
  298. libthx-0.3.0/theseus/dispatch/slurm.py +0 -1313
  299. libthx-0.3.0/theseus/dispatch/solve.py +0 -761
  300. libthx-0.3.0/theseus/dispatch/ssh.py +0 -506
  301. libthx-0.3.0/theseus/dispatch/sync.py +0 -277
  302. libthx-0.3.0/theseus/dispatch/tpu.py +0 -615
  303. libthx-0.3.0/theseus/dispatch/volcano.py +0 -795
  304. libthx-0.3.0/theseus/evaluation/datasets/clutrr.py +0 -80
  305. libthx-0.3.0/theseus/evaluation/datasets/dictlearn.py +0 -83
  306. libthx-0.3.0/theseus/evaluation/huggingface.py +0 -37
  307. libthx-0.3.0/theseus/experiments/benchmark.py +0 -125
  308. libthx-0.3.0/theseus/experiments/continual/__init__.py +0 -17
  309. libthx-0.3.0/theseus/experiments/continual/abcd.py +0 -968
  310. libthx-0.3.0/theseus/experiments/continual/benchmark.py +0 -429
  311. libthx-0.3.0/theseus/experiments/models/forking.py +0 -25
  312. libthx-0.3.0/theseus/experiments/models/lact.py +0 -41
  313. libthx-0.3.0/theseus/experiments/models/moe.py +0 -15
  314. libthx-0.3.0/theseus/experiments/mok/__init__.py +0 -1
  315. libthx-0.3.0/theseus/experiments/mok/reward.py +0 -68
  316. libthx-0.3.0/theseus/experiments/mok/smoke.py +0 -316
  317. libthx-0.3.0/theseus/experiments/redcodegen/__init__.py +0 -2
  318. libthx-0.3.0/theseus/experiments/redcodegen/hardening.py +0 -15
  319. libthx-0.3.0/theseus/inference/__init__.py +0 -4
  320. libthx-0.3.0/theseus/inference/huggingface.py +0 -68
  321. libthx-0.3.0/theseus/inference/ttt.py +0 -77
  322. libthx-0.3.0/theseus/job.py +0 -440
  323. libthx-0.3.0/theseus/mock.py +0 -212
  324. libthx-0.3.0/theseus/model/attention/scratching.py +0 -155
  325. libthx-0.3.0/theseus/model/block/block.py +0 -35
  326. libthx-0.3.0/theseus/model/block/lact.py +0 -271
  327. libthx-0.3.0/theseus/model/block/mamba.py +0 -438
  328. libthx-0.3.0/theseus/model/block/moe.py +0 -48
  329. libthx-0.3.0/theseus/model/block/scratching.py +0 -162
  330. libthx-0.3.0/theseus/model/huggingface.py +0 -273
  331. libthx-0.3.0/theseus/model/layers/lact.py +0 -320
  332. libthx-0.3.0/theseus/model/models/hybrid.py +0 -98
  333. libthx-0.3.0/theseus/model/models/lact.py +0 -79
  334. libthx-0.3.0/theseus/model/models/mamba.py +0 -110
  335. libthx-0.3.0/theseus/model/models/moe.py +0 -50
  336. libthx-0.3.0/theseus/model/models/scratchbubbles.py +0 -338
  337. libthx-0.3.0/theseus/model/moe/__init__.py +0 -5
  338. libthx-0.3.0/theseus/model/moe/bias_balanced.py +0 -51
  339. libthx-0.3.0/theseus/plot.py +0 -331
  340. libthx-0.3.0/theseus/quick.py +0 -258
  341. libthx-0.3.0/theseus/training/backbone.py +0 -145
  342. libthx-0.3.0/theseus/training/base.py +0 -990
  343. libthx-0.3.0/theseus/training/flywheel/pmd.py +0 -283
  344. libthx-0.3.0/theseus/training/flywheel/strategy.py +0 -300
  345. libthx-0.3.0/theseus/training/huggingface.py +0 -243
  346. libthx-0.3.0/theseus/training/lora.py +0 -577
  347. libthx-0.3.0/theseus/training/optimizers/__init__.py +0 -13
  348. libthx-0.3.0/theseus/training/schedules/__init__.py +0 -19
  349. libthx-0.3.0/theseus/web/__init__.py +0 -19
  350. libthx-0.3.0/theseus/web/app.py +0 -250
  351. libthx-0.3.0/theseus/web/auth.py +0 -111
  352. libthx-0.3.0/theseus/web/generate_password_hash.py +0 -56
  353. libthx-0.3.0/theseus/web/models.py +0 -127
  354. libthx-0.3.0/theseus/web/routes/__init__.py +0 -11
  355. libthx-0.3.0/theseus/web/routes/api.py +0 -201
  356. libthx-0.3.0/theseus/web/routes/auth.py +0 -50
  357. libthx-0.3.0/theseus/web/routes/views.py +0 -269
  358. libthx-0.3.0/theseus/web/services/__init__.py +0 -13
  359. libthx-0.3.0/theseus/web/services/cache.py +0 -515
  360. libthx-0.3.0/theseus/web/services/checkpoints.py +0 -284
  361. libthx-0.3.0/theseus/web/services/logs.py +0 -142
  362. libthx-0.3.0/theseus/web/services/status.py +0 -338
  363. {libthx-0.3.0 → libthx-0.4.0}/LICENSE +0 -0
  364. {libthx-0.3.0 → libthx-0.4.0}/libthx.egg-info/dependency_links.txt +0 -0
  365. {libthx-0.3.0 → libthx-0.4.0}/libthx.egg-info/top_level.txt +0 -0
  366. {libthx-0.3.0 → libthx-0.4.0}/setup.cfg +0 -0
  367. {libthx-0.3.0 → libthx-0.4.0}/tests/test_datasets.py +0 -0
  368. {libthx-0.3.0/theseus/data/datasets/redcodegen → libthx-0.4.0/theseus}/__init__.py +0 -0
  369. {libthx-0.3.0/theseus/experiments/models → libthx-0.4.0/theseus/cli}/__init__.py +0 -0
  370. {libthx-0.3.0/theseus/model → libthx-0.4.0/theseus/cli/interface}/__init__.py +0 -0
  371. {libthx-0.3.0 → libthx-0.4.0}/theseus/evaluation/datasets/arc_challenge.py +0 -0
  372. {libthx-0.3.0 → libthx-0.4.0}/theseus/evaluation/datasets/arithmetic.py +0 -0
  373. {libthx-0.3.0 → libthx-0.4.0}/theseus/evaluation/datasets/bbh.py +0 -0
  374. {libthx-0.3.0 → libthx-0.4.0}/theseus/evaluation/datasets/gsm8k.py +0 -0
  375. {libthx-0.3.0 → libthx-0.4.0}/theseus/evaluation/datasets/hellaswag.py +0 -0
  376. {libthx-0.3.0 → libthx-0.4.0}/theseus/evaluation/datasets/math.py +0 -0
  377. {libthx-0.3.0 → libthx-0.4.0}/theseus/evaluation/datasets/mmlu.py +0 -0
  378. {libthx-0.3.0 → libthx-0.4.0}/theseus/evaluation/datasets/squad.py +0 -0
  379. {libthx-0.3.0/theseus/training/flywheel → libthx-0.4.0/theseus/experiments/models}/__init__.py +0 -0
  380. {libthx-0.3.0 → libthx-0.4.0}/theseus/model/activations/__init__.py +0 -0
  381. {libthx-0.3.0 → libthx-0.4.0}/theseus/model/activations/swiglu.py +0 -0
  382. {libthx-0.3.0 → libthx-0.4.0}/theseus/model/attention/forking.py +0 -0
  383. {libthx-0.3.0 → libthx-0.4.0}/theseus/model/attention/rope.py +0 -0
  384. {libthx-0.3.0 → libthx-0.4.0}/theseus/model/layers/mrope.py +0 -0
  385. {libthx-0.3.0 → libthx-0.4.0}/theseus/model/models/contrib/__init__.py +0 -0
  386. {libthx-0.3.0 → libthx-0.4.0}/theseus/training/__init__.py +0 -0
libthx-0.4.0/PKG-INFO ADDED
@@ -0,0 +1,180 @@
1
+ Metadata-Version: 2.4
2
+ Name: libthx
3
+ Version: 0.4.0
4
+ Summary: Architecture experimentation and training infrastructure.
5
+ Requires-Python: <3.14,>=3.11
6
+ Description-Content-Type: text/markdown
7
+ License-File: LICENSE
8
+ Requires-Dist: click>=8.2.1
9
+ Requires-Dist: cloudpickle>=3.1.1
10
+ Requires-Dist: flax>=0.12.2
11
+ Requires-Dist: flatbuffers>=25.12.0
12
+ Requires-Dist: jsonlines>=4.0.0
13
+ Requires-Dist: loguru>=0.7.3
14
+ Requires-Dist: numpy>=2.4.1
15
+ Requires-Dist: omegaconf>=2.3.0
16
+ Requires-Dist: orbax>=0.1.9
17
+ Requires-Dist: pydantic>=2.12.5
18
+ Requires-Dist: python-dotenv>=1.2.1
19
+ Requires-Dist: rich>=13.5.2
20
+ Requires-Dist: seaborn>=0.13.2
21
+ Requires-Dist: tiktoken>=0.12.0
22
+ Requires-Dist: torchax>=0.0.11
23
+ Requires-Dist: wandb>=0.24.1
24
+ Requires-Dist: datasets>=4.5.0
25
+ Requires-Dist: huggingface-hub>=1.4.1
26
+ Requires-Dist: flatbuffers>=25.12.19
27
+ Requires-Dist: pyarrow>=23.0.1
28
+ Requires-Dist: chdb>=4.3.0
29
+ Requires-Dist: deltalake>=1.6.3
30
+ Requires-Dist: typer>=0.24.1
31
+ Requires-Dist: nicegui<4,>=3.16.0
32
+ Requires-Dist: pygwalker>=0.5.0.1
33
+ Requires-Dist: pandas>=2
34
+ Requires-Dist: comet-ml>=3.58.6
35
+ Requires-Dist: bottle>=0.13.4
36
+ Requires-Dist: cheroot>=11.1.2
37
+ Provides-Extra: fever
38
+ Requires-Dist: wikipedia>=1.4.0; extra == "fever"
39
+ Provides-Extra: huggingface
40
+ Requires-Dist: tokenizers>=0.22.2; extra == "huggingface"
41
+ Requires-Dist: transformers>=5.1.0; extra == "huggingface"
42
+ Requires-Dist: accelerate>=1.13.0; extra == "huggingface"
43
+ Provides-Extra: cuda13
44
+ Requires-Dist: jax[cuda13]>=0.4.23; extra == "cuda13"
45
+ Requires-Dist: torch>=2.9.1; extra == "cuda13"
46
+ Requires-Dist: torchax>=0.0.11; extra == "cuda13"
47
+ Provides-Extra: cuda12
48
+ Requires-Dist: jax[cuda12]>=0.4.23; extra == "cuda12"
49
+ Requires-Dist: torch>=2.9.1; extra == "cuda12"
50
+ Requires-Dist: torchax>=0.0.11; extra == "cuda12"
51
+ Provides-Extra: tpu
52
+ Requires-Dist: jax[tpu]>=0.4.23; extra == "tpu"
53
+ Requires-Dist: torch>=2.9.1; extra == "tpu"
54
+ Requires-Dist: torchax>=0.0.11; extra == "tpu"
55
+ Provides-Extra: cpu
56
+ Requires-Dist: jax>=0.4.23; extra == "cpu"
57
+ Requires-Dist: torch>=2.9.1; extra == "cpu"
58
+ Requires-Dist: torchax>=0.0.11; extra == "cpu"
59
+ Provides-Extra: dev
60
+ Requires-Dist: coverage>=7.9.1; extra == "dev"
61
+ Requires-Dist: coveralls>=4.0.1; extra == "dev"
62
+ Requires-Dist: pytest>=8.4.1; extra == "dev"
63
+ Requires-Dist: playwright>=1.55.0; extra == "dev"
64
+ Requires-Dist: pytest-cov>=6.2.1; extra == "dev"
65
+ Requires-Dist: ruff>=0.12.1; extra == "dev"
66
+ Requires-Dist: pre-commit>=4.2.0; extra == "dev"
67
+ Requires-Dist: mypy>=1.16.1; extra == "dev"
68
+ Requires-Dist: ipdb>=0.13.13; extra == "dev"
69
+ Requires-Dist: xprof~=2.21.5; extra == "dev"
70
+ Provides-Extra: docs
71
+ Requires-Dist: zensical<0.1,>=0.0.60; extra == "docs"
72
+ Requires-Dist: mkdocstrings-python>=2.0.3; extra == "docs"
73
+ Requires-Dist: pymdown-extensions>=10.15; extra == "docs"
74
+ Provides-Extra: all
75
+ Requires-Dist: tokenizers>=0.22.2; extra == "all"
76
+ Requires-Dist: transformers>=5.1.0; extra == "all"
77
+ Requires-Dist: accelerate>=1.13.0; extra == "all"
78
+ Requires-Dist: coverage>=7.9.1; extra == "all"
79
+ Requires-Dist: coveralls>=4.0.1; extra == "all"
80
+ Requires-Dist: pytest>=8.4.1; extra == "all"
81
+ Requires-Dist: playwright>=1.55.0; extra == "all"
82
+ Requires-Dist: pytest-cov>=6.2.1; extra == "all"
83
+ Requires-Dist: ruff>=0.12.1; extra == "all"
84
+ Requires-Dist: pre-commit>=4.2.0; extra == "all"
85
+ Requires-Dist: mypy>=1.16.1; extra == "all"
86
+ Requires-Dist: ipdb>=0.13.13; extra == "all"
87
+ Requires-Dist: xprof~=2.21.5; extra == "all"
88
+ Requires-Dist: zensical<0.1,>=0.0.60; extra == "all"
89
+ Requires-Dist: mkdocstrings-python>=2.0.3; extra == "all"
90
+ Requires-Dist: pymdown-extensions>=10.15; extra == "all"
91
+ Requires-Dist: wikipedia>=1.4.0; extra == "all"
92
+ Dynamic: license-file
93
+
94
+ # hi, welcome to theseus
95
+
96
+ this is theseus. it makes GPUs and TPUs warm and fuzzy inside by harnessing the power neural architecture research™® on Human Languages℗. its fine. not too fast, not too good, but it does the thing and you can use it. to be clear, it gets about mid-20s MFU on a mid day and high-30s MFU on a good day, and it doesn't do anything fancy. i'm here to tell you how to use it, and i'd love to [know about it](mailto:hi@jemoka.com) if you ended up doing that.
97
+
98
+ ## Installation
99
+
100
+ theseus is a template repo. You use it by having it. So, please, clone the repo:
101
+
102
+ ```bash
103
+ git clone https://github.com/Jemoka/thx.git theseus
104
+ cd theseus
105
+ ```
106
+
107
+ We use the [uv package manager](https://docs.astral.sh/uv/getting-started/), so make sure you have that. Now, depending on from whomst your computers must be warm, please choose your adventure:
108
+
109
+ - cuda13: `uv sync --group all --group cuda13`
110
+ - cuda12: `uv sync --group all --group cuda12`
111
+ - TPUs: `uv sync --group all --group tpu`
112
+ - CPU: `uv sync --group all --group cpu`
113
+
114
+ <!-- ## Running -->
115
+
116
+ <!-- You have two options: -->
117
+
118
+ <!-- 1. **Run theseus here**: [running experiments locally](docs/How-to/running-local.md) -->
119
+ <!-- 2. **Run theseus in chonky remote**: [run on a remote cluster](docs/How-to/running-remote.md); just the `cpu` variant of theseus for your laptop is fine for that even if remote needs CUDA -->
120
+
121
+ ## Start Quickly
122
+ We are going to invoke stuff that theseus already has built in, like tokenizing fineweb and training a GPT model. You refer to these by what's called *job keys*, like `data/tokenize/fineweb` and `gpt/train/pretrain`.
123
+
124
+ First, make a folder where things will go
125
+
126
+ ```bash
127
+ mkdir /folder/where/things/go
128
+ ```
129
+
130
+ Then, tokenize some data:
131
+
132
+
133
+ ```python
134
+ from theseus.quick import quick
135
+
136
+ with quick("/folder/where/things/go") as q:
137
+ q.build("data/tokenize/fineweb", "my-tokenize-job")
138
+ job = q.create()
139
+ job()
140
+ ```
141
+
142
+ Finally, train a model:
143
+
144
+ ```python
145
+ with quick("/folder/where/things/go") as q:
146
+ q.build("gpt/train/pretrain", "my-training-job")
147
+
148
+ # add salt (configurate) to taste
149
+ # hint: q.config is an omegaconf, so you can print it
150
+ q.config.training.per_device_batch_size = 8 # required! idk how much hbm u have
151
+
152
+ # and then make it go brr
153
+ job = q.create()
154
+ job()
155
+ ```
156
+
157
+ Your dataset job needs to share the same root folder as your training job. This is how theseus knows to load the dataset you've tokenized instead of blowing up and complaining you didn't have the dataset tokenized.
158
+
159
+ ## What's next?
160
+ - Read the [docs](https://theseus.jemoka.com/quickstart).
161
+ - Read the 80% funnier [tutorial](https://theseus.jemoka.com/Tutorials/).
162
+ - Near bedtime? Read the [design](https://theseus.jemoka.com/Design).
163
+
164
+ ## What's inside?
165
+ Code. It occasionally runs, and when it does you get features!
166
+
167
+ 1. **models that go brrr**: mid-20s MFU on a mid day and high-30s MFU on a good day
168
+ 2. **determinism** up to float: every step and every batch will be replayed exactly upon restoration
169
+ 3. **time travel debugging**: because of ^ you can inspect, replay or recompute activations of *any layer, at any checkpoint, on any device, at any time* (or your money back)
170
+ 4. **composition**: inheritance based module-level composition
171
+ 5. **sharding**: one-click FSDP, ZERO level 1, and Tensor Parallelism
172
+ 6. **configurationing**: OmegaConf compatible configuration + discovery API with strict type resolution
173
+ 7. **dispatch**: remote dispatch infrastructure and resource solving with support for SSH, SLURM, K8s Volcano, and GCP TPU hosts
174
+ 8. **dataset and evaluations**: a buncha datasets already built-in, and adding one is just telling us how to manipulate strings and we'll make it embarrassingly parallel
175
+
176
+ ...and probably more things I forgot. I'll try hard to at least have me or Codex write How-To guides covering each of these aspects, and link them here as they show up.
177
+
178
+ <p align="center">
179
+ <img src="docs/assets/colophon.png" alt="" width="32">
180
+ </p>
libthx-0.4.0/README.md ADDED
@@ -0,0 +1,87 @@
1
+ # hi, welcome to theseus
2
+
3
+ this is theseus. it makes GPUs and TPUs warm and fuzzy inside by harnessing the power neural architecture research™® on Human Languages℗. its fine. not too fast, not too good, but it does the thing and you can use it. to be clear, it gets about mid-20s MFU on a mid day and high-30s MFU on a good day, and it doesn't do anything fancy. i'm here to tell you how to use it, and i'd love to [know about it](mailto:hi@jemoka.com) if you ended up doing that.
4
+
5
+ ## Installation
6
+
7
+ theseus is a template repo. You use it by having it. So, please, clone the repo:
8
+
9
+ ```bash
10
+ git clone https://github.com/Jemoka/thx.git theseus
11
+ cd theseus
12
+ ```
13
+
14
+ We use the [uv package manager](https://docs.astral.sh/uv/getting-started/), so make sure you have that. Now, depending on from whomst your computers must be warm, please choose your adventure:
15
+
16
+ - cuda13: `uv sync --group all --group cuda13`
17
+ - cuda12: `uv sync --group all --group cuda12`
18
+ - TPUs: `uv sync --group all --group tpu`
19
+ - CPU: `uv sync --group all --group cpu`
20
+
21
+ <!-- ## Running -->
22
+
23
+ <!-- You have two options: -->
24
+
25
+ <!-- 1. **Run theseus here**: [running experiments locally](docs/How-to/running-local.md) -->
26
+ <!-- 2. **Run theseus in chonky remote**: [run on a remote cluster](docs/How-to/running-remote.md); just the `cpu` variant of theseus for your laptop is fine for that even if remote needs CUDA -->
27
+
28
+ ## Start Quickly
29
+ We are going to invoke stuff that theseus already has built in, like tokenizing fineweb and training a GPT model. You refer to these by what's called *job keys*, like `data/tokenize/fineweb` and `gpt/train/pretrain`.
30
+
31
+ First, make a folder where things will go
32
+
33
+ ```bash
34
+ mkdir /folder/where/things/go
35
+ ```
36
+
37
+ Then, tokenize some data:
38
+
39
+
40
+ ```python
41
+ from theseus.quick import quick
42
+
43
+ with quick("/folder/where/things/go") as q:
44
+ q.build("data/tokenize/fineweb", "my-tokenize-job")
45
+ job = q.create()
46
+ job()
47
+ ```
48
+
49
+ Finally, train a model:
50
+
51
+ ```python
52
+ with quick("/folder/where/things/go") as q:
53
+ q.build("gpt/train/pretrain", "my-training-job")
54
+
55
+ # add salt (configurate) to taste
56
+ # hint: q.config is an omegaconf, so you can print it
57
+ q.config.training.per_device_batch_size = 8 # required! idk how much hbm u have
58
+
59
+ # and then make it go brr
60
+ job = q.create()
61
+ job()
62
+ ```
63
+
64
+ Your dataset job needs to share the same root folder as your training job. This is how theseus knows to load the dataset you've tokenized instead of blowing up and complaining you didn't have the dataset tokenized.
65
+
66
+ ## What's next?
67
+ - Read the [docs](https://theseus.jemoka.com/quickstart).
68
+ - Read the 80% funnier [tutorial](https://theseus.jemoka.com/Tutorials/).
69
+ - Near bedtime? Read the [design](https://theseus.jemoka.com/Design).
70
+
71
+ ## What's inside?
72
+ Code. It occasionally runs, and when it does you get features!
73
+
74
+ 1. **models that go brrr**: mid-20s MFU on a mid day and high-30s MFU on a good day
75
+ 2. **determinism** up to float: every step and every batch will be replayed exactly upon restoration
76
+ 3. **time travel debugging**: because of ^ you can inspect, replay or recompute activations of *any layer, at any checkpoint, on any device, at any time* (or your money back)
77
+ 4. **composition**: inheritance based module-level composition
78
+ 5. **sharding**: one-click FSDP, ZERO level 1, and Tensor Parallelism
79
+ 6. **configurationing**: OmegaConf compatible configuration + discovery API with strict type resolution
80
+ 7. **dispatch**: remote dispatch infrastructure and resource solving with support for SSH, SLURM, K8s Volcano, and GCP TPU hosts
81
+ 8. **dataset and evaluations**: a buncha datasets already built-in, and adding one is just telling us how to manipulate strings and we'll make it embarrassingly parallel
82
+
83
+ ...and probably more things I forgot. I'll try hard to at least have me or Codex write How-To guides covering each of these aspects, and link them here as they show up.
84
+
85
+ <p align="center">
86
+ <img src="docs/assets/colophon.png" alt="" width="32">
87
+ </p>
@@ -0,0 +1,180 @@
1
+ Metadata-Version: 2.4
2
+ Name: libthx
3
+ Version: 0.4.0
4
+ Summary: Architecture experimentation and training infrastructure.
5
+ Requires-Python: <3.14,>=3.11
6
+ Description-Content-Type: text/markdown
7
+ License-File: LICENSE
8
+ Requires-Dist: click>=8.2.1
9
+ Requires-Dist: cloudpickle>=3.1.1
10
+ Requires-Dist: flax>=0.12.2
11
+ Requires-Dist: flatbuffers>=25.12.0
12
+ Requires-Dist: jsonlines>=4.0.0
13
+ Requires-Dist: loguru>=0.7.3
14
+ Requires-Dist: numpy>=2.4.1
15
+ Requires-Dist: omegaconf>=2.3.0
16
+ Requires-Dist: orbax>=0.1.9
17
+ Requires-Dist: pydantic>=2.12.5
18
+ Requires-Dist: python-dotenv>=1.2.1
19
+ Requires-Dist: rich>=13.5.2
20
+ Requires-Dist: seaborn>=0.13.2
21
+ Requires-Dist: tiktoken>=0.12.0
22
+ Requires-Dist: torchax>=0.0.11
23
+ Requires-Dist: wandb>=0.24.1
24
+ Requires-Dist: datasets>=4.5.0
25
+ Requires-Dist: huggingface-hub>=1.4.1
26
+ Requires-Dist: flatbuffers>=25.12.19
27
+ Requires-Dist: pyarrow>=23.0.1
28
+ Requires-Dist: chdb>=4.3.0
29
+ Requires-Dist: deltalake>=1.6.3
30
+ Requires-Dist: typer>=0.24.1
31
+ Requires-Dist: nicegui<4,>=3.16.0
32
+ Requires-Dist: pygwalker>=0.5.0.1
33
+ Requires-Dist: pandas>=2
34
+ Requires-Dist: comet-ml>=3.58.6
35
+ Requires-Dist: bottle>=0.13.4
36
+ Requires-Dist: cheroot>=11.1.2
37
+ Provides-Extra: fever
38
+ Requires-Dist: wikipedia>=1.4.0; extra == "fever"
39
+ Provides-Extra: huggingface
40
+ Requires-Dist: tokenizers>=0.22.2; extra == "huggingface"
41
+ Requires-Dist: transformers>=5.1.0; extra == "huggingface"
42
+ Requires-Dist: accelerate>=1.13.0; extra == "huggingface"
43
+ Provides-Extra: cuda13
44
+ Requires-Dist: jax[cuda13]>=0.4.23; extra == "cuda13"
45
+ Requires-Dist: torch>=2.9.1; extra == "cuda13"
46
+ Requires-Dist: torchax>=0.0.11; extra == "cuda13"
47
+ Provides-Extra: cuda12
48
+ Requires-Dist: jax[cuda12]>=0.4.23; extra == "cuda12"
49
+ Requires-Dist: torch>=2.9.1; extra == "cuda12"
50
+ Requires-Dist: torchax>=0.0.11; extra == "cuda12"
51
+ Provides-Extra: tpu
52
+ Requires-Dist: jax[tpu]>=0.4.23; extra == "tpu"
53
+ Requires-Dist: torch>=2.9.1; extra == "tpu"
54
+ Requires-Dist: torchax>=0.0.11; extra == "tpu"
55
+ Provides-Extra: cpu
56
+ Requires-Dist: jax>=0.4.23; extra == "cpu"
57
+ Requires-Dist: torch>=2.9.1; extra == "cpu"
58
+ Requires-Dist: torchax>=0.0.11; extra == "cpu"
59
+ Provides-Extra: dev
60
+ Requires-Dist: coverage>=7.9.1; extra == "dev"
61
+ Requires-Dist: coveralls>=4.0.1; extra == "dev"
62
+ Requires-Dist: pytest>=8.4.1; extra == "dev"
63
+ Requires-Dist: playwright>=1.55.0; extra == "dev"
64
+ Requires-Dist: pytest-cov>=6.2.1; extra == "dev"
65
+ Requires-Dist: ruff>=0.12.1; extra == "dev"
66
+ Requires-Dist: pre-commit>=4.2.0; extra == "dev"
67
+ Requires-Dist: mypy>=1.16.1; extra == "dev"
68
+ Requires-Dist: ipdb>=0.13.13; extra == "dev"
69
+ Requires-Dist: xprof~=2.21.5; extra == "dev"
70
+ Provides-Extra: docs
71
+ Requires-Dist: zensical<0.1,>=0.0.60; extra == "docs"
72
+ Requires-Dist: mkdocstrings-python>=2.0.3; extra == "docs"
73
+ Requires-Dist: pymdown-extensions>=10.15; extra == "docs"
74
+ Provides-Extra: all
75
+ Requires-Dist: tokenizers>=0.22.2; extra == "all"
76
+ Requires-Dist: transformers>=5.1.0; extra == "all"
77
+ Requires-Dist: accelerate>=1.13.0; extra == "all"
78
+ Requires-Dist: coverage>=7.9.1; extra == "all"
79
+ Requires-Dist: coveralls>=4.0.1; extra == "all"
80
+ Requires-Dist: pytest>=8.4.1; extra == "all"
81
+ Requires-Dist: playwright>=1.55.0; extra == "all"
82
+ Requires-Dist: pytest-cov>=6.2.1; extra == "all"
83
+ Requires-Dist: ruff>=0.12.1; extra == "all"
84
+ Requires-Dist: pre-commit>=4.2.0; extra == "all"
85
+ Requires-Dist: mypy>=1.16.1; extra == "all"
86
+ Requires-Dist: ipdb>=0.13.13; extra == "all"
87
+ Requires-Dist: xprof~=2.21.5; extra == "all"
88
+ Requires-Dist: zensical<0.1,>=0.0.60; extra == "all"
89
+ Requires-Dist: mkdocstrings-python>=2.0.3; extra == "all"
90
+ Requires-Dist: pymdown-extensions>=10.15; extra == "all"
91
+ Requires-Dist: wikipedia>=1.4.0; extra == "all"
92
+ Dynamic: license-file
93
+
94
+ # hi, welcome to theseus
95
+
96
+ this is theseus. it makes GPUs and TPUs warm and fuzzy inside by harnessing the power neural architecture research™® on Human Languages℗. its fine. not too fast, not too good, but it does the thing and you can use it. to be clear, it gets about mid-20s MFU on a mid day and high-30s MFU on a good day, and it doesn't do anything fancy. i'm here to tell you how to use it, and i'd love to [know about it](mailto:hi@jemoka.com) if you ended up doing that.
97
+
98
+ ## Installation
99
+
100
+ theseus is a template repo. You use it by having it. So, please, clone the repo:
101
+
102
+ ```bash
103
+ git clone https://github.com/Jemoka/thx.git theseus
104
+ cd theseus
105
+ ```
106
+
107
+ We use the [uv package manager](https://docs.astral.sh/uv/getting-started/), so make sure you have that. Now, depending on from whomst your computers must be warm, please choose your adventure:
108
+
109
+ - cuda13: `uv sync --group all --group cuda13`
110
+ - cuda12: `uv sync --group all --group cuda12`
111
+ - TPUs: `uv sync --group all --group tpu`
112
+ - CPU: `uv sync --group all --group cpu`
113
+
114
+ <!-- ## Running -->
115
+
116
+ <!-- You have two options: -->
117
+
118
+ <!-- 1. **Run theseus here**: [running experiments locally](docs/How-to/running-local.md) -->
119
+ <!-- 2. **Run theseus in chonky remote**: [run on a remote cluster](docs/How-to/running-remote.md); just the `cpu` variant of theseus for your laptop is fine for that even if remote needs CUDA -->
120
+
121
+ ## Start Quickly
122
+ We are going to invoke stuff that theseus already has built in, like tokenizing fineweb and training a GPT model. You refer to these by what's called *job keys*, like `data/tokenize/fineweb` and `gpt/train/pretrain`.
123
+
124
+ First, make a folder where things will go
125
+
126
+ ```bash
127
+ mkdir /folder/where/things/go
128
+ ```
129
+
130
+ Then, tokenize some data:
131
+
132
+
133
+ ```python
134
+ from theseus.quick import quick
135
+
136
+ with quick("/folder/where/things/go") as q:
137
+ q.build("data/tokenize/fineweb", "my-tokenize-job")
138
+ job = q.create()
139
+ job()
140
+ ```
141
+
142
+ Finally, train a model:
143
+
144
+ ```python
145
+ with quick("/folder/where/things/go") as q:
146
+ q.build("gpt/train/pretrain", "my-training-job")
147
+
148
+ # add salt (configurate) to taste
149
+ # hint: q.config is an omegaconf, so you can print it
150
+ q.config.training.per_device_batch_size = 8 # required! idk how much hbm u have
151
+
152
+ # and then make it go brr
153
+ job = q.create()
154
+ job()
155
+ ```
156
+
157
+ Your dataset job needs to share the same root folder as your training job. This is how theseus knows to load the dataset you've tokenized instead of blowing up and complaining you didn't have the dataset tokenized.
158
+
159
+ ## What's next?
160
+ - Read the [docs](https://theseus.jemoka.com/quickstart).
161
+ - Read the 80% funnier [tutorial](https://theseus.jemoka.com/Tutorials/).
162
+ - Near bedtime? Read the [design](https://theseus.jemoka.com/Design).
163
+
164
+ ## What's inside?
165
+ Code. It occasionally runs, and when it does you get features!
166
+
167
+ 1. **models that go brrr**: mid-20s MFU on a mid day and high-30s MFU on a good day
168
+ 2. **determinism** up to float: every step and every batch will be replayed exactly upon restoration
169
+ 3. **time travel debugging**: because of ^ you can inspect, replay or recompute activations of *any layer, at any checkpoint, on any device, at any time* (or your money back)
170
+ 4. **composition**: inheritance based module-level composition
171
+ 5. **sharding**: one-click FSDP, ZERO level 1, and Tensor Parallelism
172
+ 6. **configurationing**: OmegaConf compatible configuration + discovery API with strict type resolution
173
+ 7. **dispatch**: remote dispatch infrastructure and resource solving with support for SSH, SLURM, K8s Volcano, and GCP TPU hosts
174
+ 8. **dataset and evaluations**: a buncha datasets already built-in, and adding one is just telling us how to manipulate strings and we'll make it embarrassingly parallel
175
+
176
+ ...and probably more things I forgot. I'll try hard to at least have me or Codex write How-To guides covering each of these aspects, and link them here as they show up.
177
+
178
+ <p align="center">
179
+ <img src="docs/assets/colophon.png" alt="" width="32">
180
+ </p>