Live data from Hacker News

RustGPT: A pure-Rust transformer LLM built from scratch

github.com

111–120 of 186 posts

Re: RustGPT: A pure-Rust transformer LLM built from scratch

#111
post #52

As someone who has spent days wrestling with Python dependency hell just to get a model running, a simple cargo run feels like a dream. But I'm wondering, what was the most painful part of NOT having a framework? I'm betting my coffee money it was debugging the backpropagation logic.

> spent days wrestling with Python dependency hell I mean I would understand that comment in 2010, but in 2025 it's grossly ridiculous.

Yeah, because of a tool written in Rust, copying the Rust way of doing things for Python developers.

Re: RustGPT: A pure-Rust transformer LLM built from scratch

#114

Earlier quoted context omitted.

Have you tried uv [1]? It has removed 90% of the pain of running python projects for me. [1] https://github.com/astral-sh/uv

I'm sure it's true and all. But I've been hearing the same claim about all those tools uv is intended to replace, for years now. And every time I try to run any of those, as someone who's not really a python coder, but can shit out scripts in it if needed and sometimes tries to run python software from github, it's been a complete clusterfuck. So I guess what I'm wondering is, are you a python guy, or are you more li…

As a developer: it basically solved all of my problems that could be solved by a package manager.

As an occasional trainer of scientists: it didn't seem to help my students.

Re: RustGPT: A pure-Rust transformer LLM built from scratch

#115

Cool stuff! I can see some GPT comments that can be removed // Increased for better learning this doesn't tell me anything // Use the constants from lib.rs const MAX_SEQ_LEN: usize = 80; const EMBEDDING_DIM: usize = 128; const HIDDEN_DIM: usize = 256; these are already defined in lib.rs, why not use them (as the comment suggests)

did you add these as a PR ?

Re: RustGPT: A pure-Rust transformer LLM built from scratch

#116
post #114

Earlier quoted context omitted.

I'm sure it's true and all. But I've been hearing the same claim about all those tools uv is intended to replace, for years now. And every time I try to run any of those, as someone who's not really a python coder, but can shit out scripts in it if needed and sometimes tries to run python software from github, it's been a complete clusterfuck. So I guess what I'm wondering is, are you a python guy, or are you more li…

As a developer: it basically solved all of my problems that could be solved by a package manager. As an occasional trainer of scientists: it didn't seem to help my students.

It installs stuff super fast!

It sadly doesn’t solve stuff like transformer_engine being built with cxx11 ABI and pytorch isn’t by default, leading to missing symbols…

Re: RustGPT: A pure-Rust transformer LLM built from scratch

#117
post #20

As someone who has spent days wrestling with Python dependency hell just to get a model running, a simple cargo run feels like a dream. But I'm wondering, what was the most painful part of NOT having a framework? I'm betting my coffee money it was debugging the backpropagation logic.

lowkey ppl who praise cargo seem to have no idea of the tradeoffs involved in dependency management the difficulty of including a dependency should be proportional to the risk you're taking on, meaning it shouldn't be as difficult as it in, say, C where every other library is continually reinventing the same 5 utilities, but also not as easy as it is with npm or cargo, because you get insane dependency clutter, and a…

> the difficulty of including a dependency should be proportional to the risk you're taking on

Why? Dependency hell is an unsolvable problem. Might as well make it easier to evaluate the tradeoff between dependencies and productivity. You can always arbitrarily ban dependencies.

Re: RustGPT: A pure-Rust transformer LLM built from scratch

#118

> ndarray = "0.16.1" rand = "0.9.0" rand_distr = "0.5.0" Looking good!

This doesn't mean anything. A project can implement things from scratch inefficiently but there might be other libraries the project can use instead of reimplementing.

Re: RustGPT: A pure-Rust transformer LLM built from scratch

#119

Earlier quoted context omitted.

I was slightly curious: cargo tree llm v0.1.0 (RustGPT) ├── ndarray v0.16.1 │ ├── matrixmultiply v0.3.9 │ │ └── rawpointer v0.2.1 │ │ [build-dependencies] │ │ └── autocfg v1.4.0 │ ├── num-complex v0.4.6 │ │ └── num-traits v0.2.19 │ │ └── libm v0.2.15 │ │ [build-dependencies] │ │ └── autocfg v1.4.0 │ ├── num-integer v0.1.46 │ │ └── num-traits v0.2.19 ( ) │ ├── num-traits v0.2.19 ( ) │ └── rawpointer v0.2.1 ├── rand v0…

linking both rand-core 0.9.0 and rand-core 0.9.3 which the project could maybe avoid by just specifying 0.9 for its own dep on it

It doesn't link two versions of `rand-core`. That's not even possible with rust (you can only link two semver-incompatible versions of the same crate). And dependency specifications in Rust don't work like that - unless you explicitly override it, all dependencies are semver constraints, so "0.9.0" will happily match "0.9.3".

Re: RustGPT: A pure-Rust transformer LLM built from scratch

#120
post #82

Earlier quoted context omitted.

Okay. Humor me. I want to write a transformer-based classifier for a project. I am accustomed to the pytorch and tensorflow libraries. What is the equivalent using C?

You do know that tensorflow was written in C++ and the Python API bolted on top?

It could be written in mix of Cobol and APL. No one cares.

People saying "oh those Python libraries are just C/C++ libraries with Python API, every language can have them" have one problem - no other language has them (with such extensive documentation, tutorials etc.)

Post reply on HN