JQ (@jqlive) header
JQ (@jqlive) profile picture

I like to create, I like sushi, and I like you!

Pluto
Joined August 2008
Photo by JQ (@jqlive)Photo by JQ (@jqlive)Photo by JQ (@jqlive)Photo by JQ (@jqlive)Photo by JQ (@jqlive)Photo by JQ (@jqlive)Photo by JQ (@jqlive)Photo by JQ (@jqlive)Photo by JQ (@jqlive)Photo by JQ (@jqlive)
I promised a friend I’d post this after the launch so
3
6
1
209
8,949
This is straight out of sci-fi
67
573
66
13,773
572,043
In this (extremely long) video, I'll build a distributed training framework from first principles using PyTorch. We'll derive everything from first principles, explaining the mathematics behind distributed training as well as every auxiliary component we build along the way, including Multi-head Latent Attention (MLA), Rotary Position Embeddings (RoPE) and YaRN. I'll explain process groups, ranks, collective communication operations, distributed autograd, device meshes and distributed tensors, and then use these foundations to implement the major forms of parallelism used to train modern language models. We'll derive and code pipeline parallelism, data parallelism, FSDP, HSDP, tensor parallelism and context parallelism, including pipeline schedules, block matrix multiplication, model sharding and ring attention. We'll then combine these techniques and examine how tensor layouts and gradients must be tracked as data moves between devices. Most importantly, we won't study each parallelism technique in isolation. We'll combine pipeline, data, tensor, context and expert parallelism into a single working framework and follow the tensors, communication operations and gradients as they move across GPUs. By the end, you'll understand not only how these techniques work individually, but how modern distributed training systems compose them to train large dense and mixture-of-experts models. We'll also build the important components of a modern transformer, including rotary embeddings, long-context extensions, multi-head latent attention and a mixture-of-experts architecture. This leads into expert parallelism, expert tensor parallelism, token dispatching, all-to-all communication and combining different parallel dimensions through dense and sparse device meshes. We'll also build the supporting training infrastructure, including the training loop, optimizer, learning-rate schedule, checkpointing and metrics. The goal is to give you the foundations required to understand how distributed training frameworks work internally and how to design and implement new parallelization strategies yourself. No prior knowledge of distributed training is required. Link to the video: youtube.com/watch?v=XoGvCBRn…
87
271
51
2,412
325,100
this is a weird long post without much substance I strongly recommend against reading it ... so, do you feel like whatever you're working on right now is pointless, or will have zero value soon, due to the crazy times we're living? then, perhaps you should stop, and start working on the only unsolved problem that actually matters TODAY: ✨ replicating GPT-3 in a laptop ✨ "why is that so important?" because it would make AI incredibly cheap, which would mean everyone would have Fable-class models in their laptops, without depending on Anthropic, OpenAI, or any other hyper-scaler giant. and that's amazing, don't you think? "isn't that literally impossible?" that's the cool part: as far as computer science is concerned, no. not really. not at all. is entirely plausible and, as far as we know, most likely not even hard. it takes one good idea. one breakthrough. one great "aha moment", to go from zero to "hey, this software I wrote is producing credible English sentences" and whenever that happens: - the entire AI industry collapses - clusters are liquidated - we all get Fable at home - you become famous and rich, if that's your thing sounds fun, doesn't it? "wtf you talking, OF COURSE that is hard" so prove it. show me a paper, a lean file, anything that proves that training a Fable-class model fundamentally requires billions of dollars. you can't, because, guess what - it is not true! the only "evidence" we have is purely psychological. "many attempted over decades, and the best thing we have is GPTs, so, it is a hard problem" - but that's not a scientific argument. that's a human, psychological, sociological argument. and if that's it, consider the following counter-argument: ✨ humans are stupid as hell ✨ I mean, 10 years ago we didn't have transformers, so, that very argument could be used against GPTs existing. yet, they exist. we have them now, because someone found it. and, guess what, it isn't even complex. I mean, karpathy implemented the whole thing in a napkin. and it probably compiles. we were just too dumb to figure GPTs out... for decades. just like GPTs, there ARE other approaches, other algorithms, other architectures, equally simpler or even simpler, that do work. this is a mathematical certainty. and one of them might be astronomically faster than what we're doing right now. and you might be the one to find it! "me? why me???" because you're intelligent, creative and handsome. I see a lot of potential in you. in fact, I always believed in you. and I think you're wasting your time, doing that silly agent orchestrator. nobody wants that. quit it. take your most interesting ideas, intuition, creativity, and work in a problem that matters. do your best shot at reproducing GPT-3 in your own laptop. do NOT fork llama.cpp. do NOT train another LLM. do something... ✨different✨ it must be unique, novel, full of YOUR soul. something nobody thought of, or bothered doing. go ahead and implement that thing in C/CUDA (or Bend!). no Python! zero excuses for Python. any model is fluent in GPGPU now. build a real kernel. and then, train your thing. download wikipedia, give it time and compute to absorb the patterns of English speech. you can rent GPUs anywhere nowadays. let it train. then, ask it some questions. chances are it will just respond back. just like GPT-2 answered OpenAI. computers are incredible. don't underestimate them! "many tried. nobody succeeded. why would I?* see - that's your mistake again. turns out not many actually tried, at all. I promise you. who do you think is seriously working on that? people on Mozilla? they're busy building a browser Linus Torvalds? he is busy building an OS employees at OpenAI, Anthropic, xAI? they're paid to work on what is proven to work: GPTs. what about all the AI enthusiasts all around the world? yeah, you know they're mostly fine tuning Qwen and how about your friends? if only they weren't busy building a SaaS in the eve of AGI... how about people from the past? bro - people from the past seriously expected Lisp would be AGI. just dismiss them. they didn't have the compute, the resources, the knowledge, the MODELS that we have today. that YOU have access to. so, what's left? not much. the world looks big. it is not. truth is: ✨almost nobody is working on this ✨ "I still think it is impossible. I don't trust you" well, take my word no more. Ilya himself, in his 2019 talk on GPT-2, said: > "the story of deep learning is this: empirically old simple methods which were usually invented in the 80s and the 90s when scaled up on very large clusters work really well." and then: > "(we took) normal simple reinforcement learning method, scaled it up, and discovered that it suddenly becomes very capable of solving extremely hard problems." and again: > "you take a simple tool which is unimposing and barely works, and then you run it on a big cluster and suddenly it works, it becomes a capable tool for solving problems" do you see the point here? Ilya isn't arguing that transformers are magic. Ilya is arguing that SCALING is magic step #1: take a simple, elegant algorithm. step #2: shove compute at its face. step #3: ...? step #4: your computer is talking to you THAT is the key insight that led to GPT-3 THAT is what Ilya saw THAT is what caused the OpenAI x Anthropic war THAT is the founding principle of the ongoing era not "scaling transformers work" but "scaling beautiful algorithms works" that's the incredible lesson. yet, we all took it and... threw it way. - zurk bought 100k GPUs. to train GPTs - musk bought 100k GPUs. to train GPTs - bezos bought 100k GPUs. to train GPTs ... that's what everyone is doing. so, no. not many are trying to replicate GPT-3 through other means. we're just ants, after all... whenever we find a pile of sugar, we leave a track of pheromones, which guide the rest of the colony towards the new food source. the colony then swarms around the pile, extract all of it, until no grain is left. but piles of sugar aren't spontaneously generated in the middle of nowhere. they imply something more profound: "humans are around". and, if humans are in sight, even better things must be. like a big sweet cake. a colony that only follows the pheromone trail would miss the cake for the grains. that's why every ant species has scouts and exploratory foragers. and, just like a pile of sugar implies something more profound, LLMs also imply something quite profound: *computers are capable of thinking* a pile of sugar is never alone. GPTs are most likely not the only system capable of thinking. so, if you find yourself a bit lost, without purpose, like your work is pointless and Fable 3 will soon one shot it anyway... consider becoming a scout. find a new approach to AI. bring something new to humanity. breaking out of the massive cost associated with training GPTs is the next big step in AI, and it will only happen if people like you work to make it happen.
125
103
24
1,205
77,031
Together with UC Berkeley we are announcing the laser phase plate - a breakthrough in atomic resolution imaging. This is the brightest continuous wave laser in the world, 100 million times the intensity of the surface of the sun. Phase contrast plays an important role in microscopy, but it was thought close to impossible for electron microscopy, where it would require interfering with an electron beam. Holger Mueller and Robert Glaeser proposed exactly this using a standing wave laser. It has taken over 15 years to make this a reality. Biohub partnered with UC Berkeley and Mueller to support this work and to engineer and build the technology. Contrast has been the critical barrier to achieving atomic resolution imaging of the cell. In cryo-electron tomography, a cellular imaging technology that uses electron microscopy, the low contrast makes it impossible to resolve anything but the largest proteins within their cellular context. The laser phase plate removes that barrier. With advances in AI this breakthrough in contrast will start to open up a new frontier in structural biology, that will allow us to see the molecular machines of the cell, and how they assemble into far more complex and dynamic systems, and understand how they work.
91
564
112
3,950
664,530
I just released this open source project built on @ACEStep_Music. DEMON: Diffusion Engine for Musical Orchestrated Noise. It lets you play ACEStep like a musical instrument, remixing songs and loops with feedback that approaches real-time. Its essentially StreamDiffusion but instead of Stable Diffusion it is ACEStep1.5, and instead of images it is full songs. It runs on 30/40/5090. Built with @DaydreamLiveAI team, testing, and building the demo. We are hosting it if you want to try it without installing. For full details, links, and writeup please see the pinned project page.
32
47
16
317
34,501
Me whenever the stars are visible:
40
2,100
55
9,525
167,230
I trained a 12M parameter LLM on my own ML framework using a Rust backend and CUDA kernels for flash attention, AdamW, and more. Wrote the full transformer architecture, and BPE tokenizer from scratch. The framework features: - Custom CUDA kernels (Flash Attention, fused LayerNorm, fused GELU) for 3x increased throughput - Automatic WebGPU fallback for non-NVIDIA devices - TypeScript API with Rust compute backend - One npm install to get started, prebuilt binaries for every platform Try out the model for yourself: mni-ml.github.io/demos/trans… Built with @_reesechong. Check out the repos and blog if you want to learn more. Shoutout to @modal for the compute credits allowing me to train on 2 A100 GPUs without going broke cc @sundeep @GavinSherry
132
245
54
3,562
830,964
Today we’re announcing Ternary Bonsai: Top intelligence at 1.58 bits Using ternary weights {-1, 0, +1}, we built a family of models that are 9x smaller than their 16-bit counterparts while outperforming most models in their respective parameter classes on standard benchmarks. We’re open-sourcing the models under the Apache 2.0 license in three sizes: 8B (1.75 GB), 4B (0.86 GB), and 1.7B (0.37 GB).
117
298
105
2,197
484,747
JQ retweeted
Quantization can make an LLM 4x smaller and 2x faster, with barely any quality loss. But what *is* it? @samwhoo crafted a beautiful interactive essay explaining it from first principles, aimed at coders, not mathematicians. ngrok.com/blog/quantization
16
196
29
1,574
670,328
I got rage baited by "Did RLMs just kill RAG (again)?" So, I'm catching up on this trending paper: What are recursive language models (RLMs)? RLMs are an inference strategy to allow an LLM to process "infinite" context. How it works: 1. Variable space: Instead of pasting a large document into the context window, the document is loaded as a variable inside a coding environment. (The key here is that the root LM doesn't see the content of the document, it only sees that there's a document) 2. Symbolic code: The root LM writes code to process the large document into manageable pieces (e.g., grep and chunk) 3. Recursion: The root LM spawns sub-agents to process smaller slices of the original large document and only returns the response to the root LM. This means the root LM's context window is never polluted with irrelevant information (avoids context rot) Online I've seen discussions around different topics: - How RLMs are different from coding agents? - How RLMs are different from RAG? - How RLMS are different from grep with extra steps? I think there's a key mental shift to understand the difference: Variable space vs token space Old Mental Model: You have a text. You tokenize it. You stuff as much as possible into the prompt (the "Context Window"). If it doesn't fit, you cut it or summarize it. The model "sees" the text. New Mental Model: The text exists only as a variable in a Python environment (REPL). The model never sees the text unless it explicitly writes code to print a snippet of it.
33
38
5
395
23,318
give ADHD introverts unlimited AI tokens and watch a new world born out of fire
164
416
73
4,618
269,374
AI companies seeing 300TB of music "archived" publicly
344
3,888
304
67,945
4,042,490
RIP Frank Gehry, you were every engineer’s nightmare.
172
4,291
537
36,453
6,423,700
Farthest ever landing. Titan landing. It's a shame many people don't know we landed on a moon of Saturn.
475
1,869
78
22,439
1,140,327
Replying to @jeremyphoward
for me, "get into ML" is basically this:
3
2
1
94
10,064
Folks getting started with the buzz, please don’t neglect basics. It will bite you some way or the other. This course and Francois Chollet’s DL book are perfect combos!
course.fast.ai, combined with learning help from an LLM, is more accessible than ever. Great way to learn how AI and deep learning really work at the foundations.
3
4
114
19,874
The concept of critical batch size is quite simple. Let’s assume we have a training dataset with 1M tokens. If we use a batch size of 10, we can update model param 100,000 times. On the other hand, if we increase the batch size to 100, the step size decreases to 10,000 (1/n).
Replying to @sameQCU
I vaguely recall @SeunghyunSEO7 mentioning something about a “critical batch size” though I’ll confess I’m not sure what it is. Minimum batch size required for a step to be meaningful maybe? Probably scales with model complexity?
15
81
7
977
193,182
99.9% of the job is labeling data, the other 0.1% is installing cuda drivers
This post is from an account that no longer exists. Learn more
24
42
5
933
54,050