Skip to main content

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!

  1. models that go brrr: mid-20s MFU on a mid day and high-30s MFU on a good day
  2. determinism up to float: every step and every batch will be replayed exactly upon restoration
  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)
  4. composition: inheritance based module-level composition
  5. sharding: one-click FSDP, ZERO level 1, and Tensor Parallelism
  6. configurationing: OmegaConf compatible configuration + discovery API with strict type resolution
  7. dispatch: remote dispatch infrastructure and resource solving with support for SSH, SLURM, K8s Volcano, and GCP TPU hosts
  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

...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)

Source distribution for libthx 0.3.1
File Size Uploaded
libthx-0.3.1.tar.gz 379.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for libthx 0.3.1
File Interpreter ABI Platform
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}

Release history Release notifications | RSS feed

0.4.0

2 release files

This release

0.3.1 This release

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page