Dev.to · 3 min read

I built a programming language that trains AI on your own GPU — no Python, no PyTorch

I built a programming language that trains AI on your own GPU — no Python, no PyTorch

Hi DEV! I'm the 17-year-old developer of Apsi, a programming language for AI and physics. I'd love for you to try it, break it, and help build the community around it. What is Apsi? Apsi is designed to be simple and direct: code you can read once and understand. It looks like Python, but it checks physical units and tensor shapes before the program runs, so a whole class of bugs never reaches run time. It comes as one installer for Windows and Linux. No Python, no PyTorch, no CUDA toolkit to set up first. Train a model on your own GPU Apsi trains models on NVIDIA cards with its own kernels, generated on your machine from the display driver alone (LLVM → PTX): use layers # a GPT, trained with Apsi's own GPU kernels let model = transformer_lm(257, d=384, heads=6, layers=6, context=128) let r = fit(model, model.init(seed=0), X, Y, loss="cross_entropy", opt=adamw(lr=1e-3), epochs=3, batch_size=32, backend="gpu") # physical units are checked before the program runs let g = 9.81[m/s^2] print(0.5 * g * (2.5s) ** 2) # 30.65625 m Under the hood: tiled tensor-core matrix products with the bias, activation and residual fused in fused attention and a one-kernel AdamW the dataset stays on the card, so the GPU never waits for the CPU every matrix product has several builds; your card times them on the real shapes and keeps the fastest the GPU is held near 77 °C by moving its power limit, so long runs stay at a steady speed instead of throttling Numbers Measured on a Ryzen 5 5500 + RTX 3060 12GB, same model and same data file for both: Training (10.9M-param GPT, bf16, 3 epochs) Speed Time Apsi 151,744 tokens/s 11.2 s PyTorch 2.14 126,993 tokens/s 13.4 s That's 1.19× PyTorch on this model, with every epoch at the same speed. Running language models fully on the same card: Model Speed Qwen2.5 0.5B ~210 tokens/s Qwen2.5 3B ~46 tokens/s Qwen2.5 14B ~20 tokens/s The benchmarks page has the raw logs of every run. Bring your Python apsi convert script.py turns Python and PyTorch code into Apsi with the same behaviour. Converted code still being Python-shaped means you can move existing work over instead of starting from zero. It's young — help me test it Apsi still has its limitations and rough edges. The most useful thing right now is people running it on their own hardware and their own code and telling me what fails. Bug reports, benchmark results from other GPUs, and conversion attempts on real projects are all very welcome. Apsi was built by one developer working with Claude (Anthropic). 🌐 Website, docs and downloads: https://apsi.dev/ 💻 GitHub: https://github.com/ATECTechnologies/apsi Thanks for reading. I'll be in the comments!

This is a summary aggregated from Dev.to. Read the complete article on the original site:

Read full article at Dev.to

More AI & Machine Learning News