Apsi
← Community

Apsi 2.6.0 (Improved version): faster than PyTorch on the same card, a fixed setup, and more

Hi everyone! 👋

This is an updated build of Apsi 2.6.0. It replaces the 2.6.0 from 13 November, so please download it again. Your programs keep working as they are.

Faster than PyTorch on the same card

We trained a 127 M-parameter GPT for 2 epochs on an RTX 3060, using the same model, the same data and the same temperature:

Run Tokens/s Card
Apsi 2.6.0 (its own 16-bit kernels, no cuBLAS) 20,708 79 °C max, never 80
PyTorch 2.14 (bf16 autocast, flash attention) 18,809 80 °C max
  • That makes Apsi 1.10× faster, with no CUDA toolkit, no PyTorch and no Python to install, only the NVIDIA driver.
  • The large matrix products run at a steady 21–22 TFLOPS.
  • Training holds the card at 78–79 °C and never reaches 80. It uses a fixed power limit and turns the fans up to 100 %, and lowers the power gently only when the fans are not enough. There are no pauses.

A fixed setup (Setup 1.50.0)

  • No more waiting at 70 %. The GPU helper step now takes seconds, because it no longer measures the card during setup.
  • The setup shows each stage, the time spent so far and what it is doing right now.
  • Uninstalling just works. The uninstaller turns the GPU helper off first, after one administrator prompt. To do it by hand, run apsi gpu remove in a terminal opened as administrator.
  • The Apsi GPU Tuner is gone. You don't need it any more, because the GPU helper in the setup does its job. If you applied it before, the GPU guide shows how to remove it.

New in this build

  • Sealed model packages: pack_model puts a trained model into one encrypted file (ChaCha20 + HMAC-SHA256). apsi package lib then builds a library that runs it without the training code.
  • Embedded and binary layouts: use layout gives you C structs (alignment, packing, endianness, bit fields), register maps and generated C headers. With the FFI, C code can also write straight into Apsi's memory.
  • More language features: enum, match with built-in types (case int(n) if n > 100:), and 0xFF / 0b1010 / 0o755 literals.
  • Graphs: GINE layers with edge features, and batch_graphs for many graphs with different sizes. Both are checked against the exact reference on the card.
  • Conversion: apsi convert now also takes Jupyter notebooks (.ipynb).
  • Fewer tokens: tokens.focus gives a language model only the code that matters to a question.

Tested

  • 445 tests run on every push, on Linux, macOS and Windows.
  • 112 tests run on a real RTX 3060, and every kernel there is checked against the exact reference (13 of 13 checks).
  • Training gives the same weights twice, bit for bit.

Honest numbers

Every result on the Benchmarks page comes with its raw log and the machine it ran on. PyTorch still uses less GPU memory on the 127 M model (3.9 GB against Apsi's 5.4 GB), and we're working on that. Your hardware may give different numbers, so please measure it yourself with apsi gpu bench.

Get it

How you can help

  • Speed: run apsi gpu bench and post the result with your CPU and GPU.
  • Bugs: tell me your OS, your GPU and the full error message.
  • Convert something: try one of your own Python projects and post what happened, whether it worked or not.

If you'd like to support Apsi, the Sponsor button goes to GitHub Sponsors. It's completely optional, and Apsi stays free for everyone. 💙

Thanks for testing, reporting and building with Apsi. I read every post! 🙏

GitHub: https://github.com/ATECTechnologies/apsi

2 0 Report

0 comments

Sign in to comment.