“A CPU that runs entirely on the GPU”<p>I imagine a carefully crafted set of programming primitives used to build up the abstraction of a CPU…<p>“Every ALU operation is a trained neural network.”<p>Oh… oh. Fun. Just not the type of “interesting” I was hoping for.
Isn't it interesting it doesn't instantly crash from a precision error? That sounds carefully crafted to me.
Is it emulating a Pentium processor? :)
Please tell me what you had in mind so I can try something different!
Begin reimplementing a subleq/muxleq VM with GPU primitive commands:<p><a href="https://github.com/howerj/muxleq" rel="nofollow">https://github.com/howerj/muxleq</a> (it has both, muxleq (multiplexed subleq, which is the same but mux'ing instructions being much faster) and subleq. As you can see the implementation it's trivial. Once it's compiled, you can run eforth, altough
I run a tweked one with floats and some beter commands, edit muxleq.fth, set the float to 1 in that file with this example:<p><pre><code> 1 constant opt.float
</code></pre>
The same with the classic do..loop structure from Forth, which is not
enabled by default, just the weird for..next one from EForth:<p><pre><code> 1 constant opt.control
</code></pre>
and recompile:<p><pre><code> ./muxleq ./muxleq.dec < muxleq.fth > new.dec
</code></pre>
run:<p><pre><code> ./muxleq new.dec
</code></pre>
Once you have a new.dec image, you can just use that from now on.
I was imagining something more like Xeon Phi
Someone needs to implement LLVMPipe to target this isa, then one can run software OpenGL emulation and call it "hardware accelerated".
A fun experiment but I wonder how many out there seriously think we could ever completely rid ourselves of the CPU. It seems to be a rising sentiment.<p>The cost of communicating information through space is dealt with in fundamentally different ways here. On the CPU it is addressed directly. The actual latency is minimized as much as possible, usually by predicting the future in various ways and keeping the spatial extent of each device (core complex) as small as possible. The GPU hides latency with massive parallelism. That's why we can put them across relatively slow networks and still see excellent performance.<p>Latency hiding cannot deal well in workloads that are branchy and serialized because you can only have one logical thread throughout. The CPU dominates this area because it doesn't cheat. It directly targets the objective. Making efficient, accurate control flow decisions tends to be more valuable than being able to process data in large volumes. It just happens that there are a few exceptions to this rule that are incredibly popular.
> I wonder how many out there seriously think we could ever completely rid ourselves of the CPU. It seems to be a rising sentiment.<p>This sentiment is not a recent thing. Ever since GPGPU became a thing, there have been people who first hear about it, don't understand processor architectures and get excited about GPUs magically making <i>everything</i> faster.<p>I vividly recall a discussion with some management type back in 2011, who was gushing about getting PHP to run on the new Nvidia Teslas, how amazingly fast websites will be!<p>Similar discussions also spring up around FPGAs again and again.<p>The more recent change in sentiment is a different one: the "graphics" origin of GPUs seem to have been lost to history. I have met people (<i>plural</i>) in recent years who thought (surprisingly long into the conversation) that I mean stable diffusion when talking about rendering pictures on a GPU.<p>Nowadays, the 'G' in GPU probably stands for GPGPU.
The dream I think has always been heterogeneous computing. The closest here I think is probably apple with their multi-core cpus with different cores, and a gpu with unified memory. (someone with more knowledge of computer architecture could probably correct me here).<p>Have a CPU, GPU, FPGA, and other specific chips like Neural chips. All there with unified memory and somehow pipelining specific work loads to each chip optimally to be optimal.<p>I wasn't really aware people thought we would be running websites on GPUs.
I see us not getting rid of CPU, but CPU and GPU being eventually consolidated in one system of heterogeneous computing units.
CPU and GPU have very different ways of scheduling instructions, requiring somehow different interfaces and programming models.. I'd hazard to say that a GPU and CPU with unified memory access (like the Apple's M series, and most mobile chips) is already such a consolidated system.
Agreed. Much like “RISC is gonna replace everything” - it didn’t. Because the CPU makers incorporated lessons from RISC into their designs.<p>I can see the same happening to the CPU. It will just take on the appropriate functionality to keep all the compute in the same chip.<p>It’s gonna take awhile because Nvidia et al like their moats.
CISC only survived because CPUs now dedicate a ton of silicon to decoding the CISC stream into RISC-y microcode. RISC CPUs can avoid this completely, but it turns out backwards compatibility was important to the market and the transistor cost of "instruction decode" just adds like +1 pipeline depth or something.
> CPUs now dedicate a ton of silicon to decoding the CISC stream into RISC-y microcode.<p>In absolute terms, this is true. But in relative terms, you're talking less than 1% of the die area on a modern, heavily cached, heavily speculative, heavily predictive CPU.
> It will just take on the appropriate functionality to keep all the compute in the same chip.<p>So, an iGPU/APU? Those exist already. Regardless, the most GPU-like CPU architecture in common use today is probably SPARC, with its 8-way SMT. Add per-thread vector SIMD compute to something like that, and you end up with something that has broadly similar performance constraints to an iGPU.
We're getting there already with e.g. Grace-Blackwell chips.
I don't think we get rid of the CPU. But the relationship will be inverted. Instead of the CPU calling the GPU, it might be that the GPU becomes the central controller and builds programs and calls the CPU to execute tasks.
Sounds reminiscent of the CDC 6600, a big fast compute processor with a simple peripheral processor whose barreled threads ran lots of the O/S and took care of I/O and other necessary support functions.
This will never without completely reimagining how process isolation works and rewriting any OS you'd want to run on that architecture.
> I wonder how many out there seriously think we could ever completely rid ourselves of the CPU.<p>How do you class systems like the PS5 that have an APU plugged into GDDR instead of regular RAM? The primary remaining issue is the limited memory capacity.<p>I wonder if we might see a system with GPU class HBM on the package in lieu of VRAM coupled with regular RAM on the board for the CPU portion?
Hey everyone thank you taking a look at my project. This was purely just a “can I do it” type deal, but ultimately my goal is to make a running OS purely on GPU, or one composed of learned systems.
This is hilarious and profoundly in the spirit of hacker news. Thanks for posting:)
I think it's curious that you're saying "on GPU" when you mean "using tensors." GPUs run compute shaders naturally and can trivially act like CPUs, just use CUDA. This is more akin to "a CPU on NPU" and your NPU happens to be a GPU.
Hi! I think that the idea is certainly a fun one. There is a long history of trying to make a good parallel operating system. I do not think that any of the projects succeeded though. This article is a good read if you are interested in that. I am not sure why the economics of parallel computer operating systems have not worked out so far. I think it most likely has to do with the operating systems that we have being good enough and familiar.
[0] <a href="https://news.ycombinator.com/item?id=43440174">https://news.ycombinator.com/item?id=43440174</a>
The Blue Gene Active Storage project demonstrated compute in highly parallel “storage” where storage was HPC memory. It could work for the relationship between CPU and GPU, FPGA, etc.<p><a href="https://www.fz-juelich.de/en/jsc/downloads/slides/bgas-bof/bgas-bof-fitch/@@download/file" rel="nofollow">https://www.fz-juelich.de/en/jsc/downloads/slides/bgas-bof/b...</a>
As foretold six years ago. [1]<p>[1]: <a href="https://breandan.net/2020/06/30/graph-computation#roadmap" rel="nofollow">https://breandan.net/2020/06/30/graph-computation#roadmap</a>
Cool. However, one still need CPU to send commands to GPU in order to let GPU do CPU things.
> Cool. However, one still need CPU to send commands to GPU in order to let GPU do CPU things.<p>Doesn't the Raspberry Pi's GPU boot up first, and then the GPU initializes the CPU?<p>With this technology, we've eliminated the need for that superfluous second step.
I don't quite understand how multiply doesn't require addition as well to combine the various partial products.
Time to benchmark Doom.<p>Now we know future genius models won't even need CPUs, just tensor/rectifier circuits. If they need a CPU, they will just imagine them.<p>A low-bit model with adaptive sparse execution might even be able to imagine with performance. Effectively, neural PGA capability.
I was taught years ago that MUL and ADD can be implemented in one or a few cycles. They can be the same complexity. What am I missing here?<p>Also, is it possible to use the GPU's ADD/MUL implementation? It is what a GPU does best.
To multiply two arbitrary numbers in a single cycle, you need to include dedicated hardware into your ALU, without it you have to combine several additions and logical shifts.<p>As to why not use the ADD/MUL capabilities of the GPU itself, I guess it wasn’t in the spirit of the challenge. ;)
Why do we call them GPUs these days?<p>Most GPUs, sitting in racks in datacenters, aren't "processing graphics" anyhow.
General Processing Units<p>Gross-Parallelization Units<p>Generative Procedure Units<p>Gratuitously Profiteering Unscrupulously
The dedicated term GPGPU [0] didn't catch on.<p>[0]: <a href="https://en.wikipedia.org/wiki/General-purpose_computing_on_graphics_processing_units" rel="nofollow">https://en.wikipedia.org/wiki/General-purpose_computing_on_g...</a>
<p><pre><code> CPU = Compute
GPU = Impute</code></pre>
VPU. Vector/Video Processing Unit.
This is a fun idea. What surprised me is the inversion where MUL ends up faster than ADD because the neural LUT removes sequential dependency while the adder still needs prefix stages.
Out of curiosity, how much slower is this than an actual CPU?
I don‘t understand why you would train a NN for an operation like sqrt that the GPU supports in silicon.
Saw the DOOM raycast demo at bottom of page.<p>Can't wait for someone to build a DOOM that runs entirely on GPU!
"Multiplication is 12x faster than addition..."<p>Wow. That's cool but what happens to the regular CPU?
This CPU simulator does not attempt to achieve the maximum speed that could be obtained when simulating a CPU on a GPU.<p>For that a completely different approach would be needed, e.g. by implementing something akin to qemu, where each CPU instruction would be translated into a graphic shader program. On many older GPUs, it is impossible or difficult to launch a graphic program from inside a graphic program (instead of from the CPU), but where this is possible one could obtain a CPU emulation that would be many orders of magnitude faster than what is demonstrated here.<p>Instead of going for speed, the project demonstrates a simpler self-contained implementation based on the same kind of neural networks used for ML/AI, which might work even on an NPU, not only on a GPU.<p>Because it uses inappropriate hardware execution units, the speed is modest and the speed ratios between different kinds of instructions are weird, but nonetheless this is an impressive achievement, i.e. simulating the complete Aarch64 ISA with such means.
Exciting if an Ai that is helping in its own improvements finds this and incorporates it into its own architecture. Then it starts reading and running all the worlds binary and gains intelligence as a fully actualized "computer". Finally becoming both a master of language and of binary bits. Thinking in poetry and in pure precise numerical calculations.
Every clueless person who suggest that we move to GPUs entirely have zero idea how things work and basically are suggesting using lambos to plow fields and tractors to race in nascar
very tangentially related is whatever vectorware et al are doing: <a href="https://www.vectorware.com/blog/" rel="nofollow">https://www.vectorware.com/blog/</a>
How is this different than the (various?) efforts back then to build a machine based on the Intel i860? Didn’t work, although people gave it a good try.
What is the purpose of this project? I didn't get it. How will it be useful?
Being able to perform precise math in an LLM is important, glad to see this.
Just want to point out this comment is highly ironic.<p>This is all a computer does :P<p>We need llms to be able to tap that not add the same functionality a layer above and MUCH less efficiently.
> We need llms to be able to tap that not add the same functionality a layer above and MUCH less efficiently.<p>Agents, tool-integrated reasoning, even chain of thought (limited, for some math) can address this.
That would be cool. A way to read cpu assembly bytecode and then think in it.<p>It's slower than real cpu code obviously but still crazy fast for 'thinking' about it. They wouldn't need to actually simulate an entire program in a never ending hot loop like a real computer. Just a few loops would explain a lot about a process and calculate a lot of precise information.
Why?
Oh these brave new ways to paraphrase the good old "fuck fuel economy"...<p>Thank you, Mr. Do-because-I-can!<p>Yours truly,<p>- GPU company CEO,<p>- Electric company CEO.
can i run linux on a nvidia card though?
Now I've seen it all. Time to die.. (meant humourously)
[dead]
Well GPU are just special purpous CPU.
Ya know just today I was thinking around a way to compile a neural network down to assembly. Matching and replacing neural network structures with their closest machine code equivalent.<p>This is way cooler though! Instead of efficiently running a neural network on a CPU, I can inefficiently run my CPU on neural network! With the work being done to make more powerful GPUs and ASICs I bet in a few years I'll be able to run a 486 at 100MHz(!!) with power consumption just under a megawatt! The mind boggles at the sort of computations this will unlock!<p>Few more years and I'll even be able to realise the dream of self-hosting ChatGPT on my own neural network simulated CPU!