hi, welcome to theseus
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 if you ended up doing that.
Installation
theseus is a template repo. You use it by having it. So, please, clone the repo:
git clone https://github.com/Jemoka/thx.git theseus
cd theseus
We use the uv package manager, so make sure you have that. Now, depending on from whomst your computers must be warm, please choose your adventure:
- cuda13:
uv sync --group all --group cuda13 - cuda12:
uv sync --group all --group cuda12 - TPUs:
uv sync --group all --group tpu - CPU:
uv sync --group all --group cpu
Start Quickly
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.
First, make a folder where things will go
mkdir /folder/where/things/go
Then, tokenize some data:
from theseus.quick import quick
with quick("/folder/where/things/go") as q:
q.build("data/tokenize/fineweb", "my-tokenize-job")
job = q.create()
job()
Finally, train a model:
with quick("/folder/where/things/go") as q:
q.build("gpt/train/pretrain", "my-training-job")
# add salt (configurate) to taste
# hint: q.config is an omegaconf, so you can print it
q.config.training.per_device_batch_size = 8 # required! idk how much hbm u have
# and then make it go brr
job = q.create()
job()
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.
What's next?
What's inside?
Code. It occasionally runs, and when it does you get features!
- models that go brrr: mid-20s MFU on a mid day and high-30s MFU on a good day
- determinism up to float: every step and every batch will be replayed exactly upon restoration
- 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)
- composition: inheritance based module-level composition
- sharding: one-click FSDP, ZERO level 1, and Tensor Parallelism
- configurationing: OmegaConf compatible configuration + discovery API with strict type resolution
- dispatch: remote dispatch infrastructure and resource solving with support for SSH, SLURM, K8s Volcano, and GCP TPU hosts
- 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
...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.
Metadata
Release files for libthx 0.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| libthx-0.3.1.tar.gz | 379.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| libthx-0.3.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 769.5 kB
Release files / libthx-0.3.1.tar.gz
| Download URL | libthx-0.3.1.tar.gz |
|---|---|
| Size | 379.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0105429d164e3b3d5ea87d117b740e397da065defea62d925c20b74d0510d0fe
|
|
BLAKE2b-256 checksum How to use checksums |
90977d761f37c6decbf34b21b6140565b0b9bed9038f437c9227e6fed3be0932
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.13 {"installer":{"name":"uv","version":"0.12.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / libthx-0.3.1-py3-none-any.whl
| Download URL | libthx-0.3.1-py3-none-any.whl |
|---|---|
| Size | 389.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
528da5b65cd407b5e84e18d51de1eecb80b831110935d4fcac959ea6bf1ec0fe
|
|
BLAKE2b-256 checksum How to use checksums |
9cbc89bb739fda9d58cdb184b52aaaa012ea07e0b2fe38c54002dfe60a6bd459
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.13 {"installer":{"name":"uv","version":"0.12.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|