Using vectors in Java [...]
summary
Explains why power limits create dark silicon and shows how the Java Vector API maps to CPU vector registers, giving a concrete example: a cosine‑similarity JMH benchmark using fused multiply‑add and reductions that runs about ~20× speedup versus scalar code. Covers species (register shapes), masked loads and shuffles, columnar layout needs, memory‑bound limits, and that reductions and tail handling are expensive. Notes real adopters (Llama 2 inference, AstraDB and Cassandra vector search) and the JVM caveat: deoptimization can allocate huge objects until value types land.
AI-written summary · about
chapters (10)
- 0:00Introduction and setup
- 2:39State of the art loops
- 5:16Moore's law and dark silicon
- 14:08Vector registers explained
- 19:48Hello world with vectors
- 26:55Vector embeddings and dot product
- 37:45Benchmarking vector vs scalar
- 40:21Data layout for vectorization
- 45:43Vector register operations
- 53:00Performance caveats and future
related talks
01h 02mVectors and the Numerics on the JVM
44mVector API for Java
44mHotspot JVM Auto Vectorization and Vector API
48mSIMD Parallel Programming with the Vector API
43mHow to make your electrons do more in Java?
57mJava Enable Preview: Vector API
43mJava Vector API
40mHow to make your electrons do more in Java
