Loading video...

Video Failed to Load

Go Home

I wrote the full Craftax RL environment + PPO in one CUDA file. zero python in the loop. training from scratch on my RTX PRO 6000 > 0.6s: first wood, first crafting table, first dungeon entered > 1.7s: first zombie + skeleton kills, first bow found > 2.9s: first...

51,510 views • 3 months ago •via X (Twitter)

36 Comments

Elliot Arledge's profile picture
Elliot Arledge3 months ago

no single magic kernel. it is boring systems work stacked end to end: env (312M steps/s, no NN in the loop): - struct-of-arrays state so every warp load is coalesced - worldgen resets are warp-cooperative: one warp rebuilds a dying world's noise fields in shared memory, bit-exact with the scalar path - rare divergent events (mob spawn scans) get compacted into queues drained by a separate kernel instead of stalling every thread - the whole step is CUDA-graph captured training (5.5M steps/s at the quality recipe, 42M full-batch): - the entire PPO loop lives on the GPU: rollout, GAE, backward, Adam. no python, no transfers, weights never leave the card - obs recorded as 996 compact uint8 bytes, then expansion + encoder run as one big GEMM instead of per-env scatter loops (2.4x on the trainer) - GRU chain backward chunked to fit in L2 - analytic grads checked against finite differences, trajectories hash-sealed against the C reference build i actually tried some ambitious kernel fusion but ended up losing to a plain GEMM and env separation strategy

kache's profile picture
kache3 months ago

Incredible work

Elliot Arledge's profile picture
Elliot Arledge3 months ago

❤️

Dan Advantage's profile picture
Dan Advantage3 months ago

8192 is max sps for gb10 (dgx spark) training a policy now

Elliot Arledge's profile picture
Elliot Arledge3 months ago

wow!

Kevin Patrick Murphy's profile picture
Kevin Patrick Murphy3 months ago

That’s pretty cool! training on craftax won’t give you an agent that generalizes, but if you can procedurally change the environment and automatically update your cuda code, then you can quickly meta learn something interesting…

Epicarism's profile picture
Epicarism3 months ago

Ok can i play Minecraft with claude now or in near future

Elliot Arledge's profile picture
Elliot Arledge3 months ago

a tiny policy will beat minecraft for you in a min or so at my achieved sim speed. need to cook for another day

Epicarism's profile picture
Epicarism3 months ago

What about a friend maxxing / playmate rl env pls for us lonesome folk

Seth Karten's profile picture
Seth Karten3 months ago

how does the trained policy perform back in the original craftax environment?

HumanoidRobots.com Tom's profile picture
HumanoidRobots.com Tom3 months ago

the environment count becoming the video beats another terminal chart. 524,288 tiny worlds is hard to argue with.

utsab's profile picture
utsab3 months ago

Bruh how?? Insane!

𝗹𝗶𝗴𝗵𝘁's profile picture
𝗹𝗶𝗴𝗵𝘁3 months ago

now this is some next lvl shit

Elliot Arledge's profile picture
Elliot Arledge3 months ago

<3

Matteo's profile picture
Matteo3 months ago

epic, nice visuals too

Igor Petrović's profile picture
Igor Petrović3 months ago

What mfs will do just to avoid working on sample efficient RL methods

webXOS's profile picture
webXOS3 months ago

gpu gaming

Sulaiman Khan Ghori's profile picture
Sulaiman Khan Ghori3 months ago

Impressive

7-Eleven intern's profile picture
7-Eleven intern3 months ago

well done

Mohammed Hossam's profile picture
Mohammed Hossam3 months ago

Huge 👀 Great work 👏

Jake Wind's profile picture
Jake Wind3 months ago

Wow, would be cool to see some charts with before/after (original Craftax vs your version)

Matt H. Lee's profile picture
Matt H. Lee3 months ago

Hell yeah brother

Craig Certo's profile picture
Craig Certo3 months ago

This is insane

David de Villiers's profile picture
David de Villiers3 months ago

Amazing! I did my Masters in Curoisity-Based RL for managing sparse rewards pre-Craftax. I attempted to build my own env and trained on it, but a few months later they came out with Craftax. This is just next level. Will be checking it out soon!

Aimar Haddadi's profile picture
Aimar Haddadi3 months ago

crazyyy

Lucky Cat's profile picture
Lucky Cat3 months ago

impressive speed benchmarks on that RTX PRO 6000, 312M env steps/s is wild

0xidative's profile picture
0xidative3 months ago

Holy aura will be checking this out

Jebrim's profile picture
Jebrim3 months ago

This is the way to go!

Inspector fomo's profile picture
Inspector fomo3 months ago

The claim of zero python in the loop overstates the setup. The environment still relies on python for initialization and orchestration.

Siddhant's profile picture
Siddhant3 months ago

This is an insanely amazing project

Ecliptix's profile picture
Ecliptix3 months ago

That's based

UriG's profile picture
UriG3 months ago

This is awesome!

smyanthota's profile picture
smyanthota3 months ago

@yacineMTB What a legend

Shubham Arora's profile picture
Shubham Arora3 months ago

Very cool!

Isha's profile picture
Isha3 months ago

Absolutely insane

Laythe's profile picture
Laythe3 months ago

is this a sign to learn cuda

Related Videos