5 ms·
I acknowledge C++'s safety concerns, but no, Java is definitely NOT running rings around C++ perf. Not a single AI/ML model is implemented in Java. The core of
by eclectic29 3y ago
I acknowledge C++'s safety concerns, but no, Java is definitely NOT running rings around C++ perf. Not a single AI/ML model is implemented in Java. The core of AI/ML runs on C++ only. You may see a lot of Python, but the core engine that Python is wrapping is written in C++. Sorry to break it to you but Java cannot even come close here.
- jeffbee 3y ago"Multiply an insane amount of stuff" is not an interesting point in complexity-safety-performance space.
- miffy900 3y ago> "Multiply an insane amount of stuff" is not an interesting point in complexity-safety-performance space. So in other words, Java is bad at scaling a basic math operation like multiplication? > "In many ways Java is running rings around C++ performance" The AI-space is proof positive of that being false. C++ is kicking Java's butt, squeezing literally trillions of ops per second of performance, all of this happening before the Java runtime can even startup. The first transformer-based language model was built with PyTorth; imagine if PyTorch was a python wrapper for Java code instead of C++ code? It'd be garbage. I mean how freaking long did it take for Java to even get a basic Vector API? C++ devs have been writing SIMD optimized code for years now. And besides that, try getting a Java program to scale at tens or even hundreds or thousands of GPUs for a large language model. You'd need GPUs with literally 20-30% more RAM just to accommodate the GC.
- lostmsu 3y agoThe reason for that mostly is CUDA only supports C and C++ natively.
- eclectic29 3y agoTry writing high performance math in Java even for CPU.