<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/java-gets-real-gpu-acceleration-and-the-benchmarks-are-hard-to-ignore-xywmpbp9c" -->

---
title: Java gets real GPU acceleration, and the benchmarks are...
description: Oracle&#x27;s HAT (Heterogeneous Accelerator Toolkit) project demonstrates Java-native GPU programming using Project Babylon&#x27;s code reflection API and Project...
canonical: https://daily.dev/posts/java-gets-real-gpu-acceleration-and-the-benchmarks-are-hard-to-ignore-xywmpbp9c
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Java gets real GPU acceleration, and the benchmarks are hard to ignore | daily.dev
og:description: Oracle&#x27;s HAT (Heterogeneous Accelerator Toolkit) project demonstrates Java-native GPU programming using Project Babylon&#x27;s code reflection API and Project...
og:url: https://daily.dev/posts/java-gets-real-gpu-acceleration-and-the-benchmarks-are-hard-to-ignore-xywmpbp9c
og:image: https://api.daily.dev/og/posts/XYwmPBp9c.png
og:image:alt: Java gets real GPU acceleration, and the benchmarks are hard to ignore
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Java gets real GPU acceleration, and the benchmarks are hard to ignore

**[Trends](https://daily.dev/sources/trends)** · 2 min read · 13 upvotes · 0 comments

## Summary

Oracle's HAT (Heterogeneous Accelerator Toolkit) project demonstrates Java-native GPU programming using Project Babylon's code reflection API and Project Panama. Developers annotate Java methods with @Reflect, and HAT compiles them to OpenCL or CUDA at runtime — no JNI, no separate kernel files. Benchmarks show a ~60x speedup for flash attention on Apple Silicon and ~80% of cuBLAS performance for matrix multiplication, written entirely in Java. The architecture includes kernel contexts, compute graphs, and an off-heap type system, with pluggable backends for CUDA, OpenCL, and a Java fallback. Still a research project presented at JavaOne 2026 and not yet in a JDK release, but the foundation on Babylon's code reflection API is considered more robust than previous attempts like Aparapi.

## Content

Oracle's HAT project just made a credible case that you don't need to leave Java to write serious GPU code.

HAT (Heterogeneous Accelerator Toolkit) is built on Project Babylon's code reflection API and Project Panama. The pitch: annotate your Java methods with `@Reflect`, and HAT transforms them into OpenCL or CUDA at runtime. No JNI glue, no separate kernel files, no context switching between languages.

The benchmarks are what's getting attention. A flash attention demo on Apple Silicon hit roughly 60x speedup over sequential Java. A matrix multiplication benchmark came in at around 80% of Nvidia's cuBLAS performance, using shared memory, register tiling, and FP16 — all written in Java. That last number is the one worth sitting with. cuBLAS is hand-tuned native code. Getting to 80% from Java is not nothing.

The programming model has three main pieces. Kernel contexts handle thread management inside a GPU kernel. Compute graphs let you orchestrate multiple kernels together. And there's an extensible type system for user-defined data structures stored off-heap, which is how you avoid the usual Java memory model headaches when talking to a GPU.

Backends are pluggable: CUDA, OpenCL, and a pure-Java fallback for debugging. The design is explicitly open to new targets like TPUs or FPGAs, which suggests Oracle is thinking about this as infrastructure, not a one-off experiment.

The honest caveat: this is still an Oracle research project, presented at JavaOne 2026. It's not shipping in a JDK release. The gap between "impressive demo" and "production-ready" is real, and Java's GPU story has had false starts before (Aparapi, anyone?).

But the foundation here is different. Babylon's code reflection API is a genuine platform capability, not a bolted-on bytecode hack. If HAT matures, it could mean ML inference, image processing, and scientific computing workloads staying in the JVM instead of punting to Python or C++. That's a meaningful shift for the Java ecosystem — if it ships.

## Questions this post answers

### What is Oracle's HAT project and how does it let Java code run on a GPU?

HAT (Heterogeneous Accelerator Toolkit) is an Oracle research project that lets developers annotate Java methods with @Reflect, after which HAT transforms them into OpenCL or CUDA code at runtime, eliminating JNI glue and separate kernel files. It is built on Project Babylon's code reflection API and Project Panama, with pluggable CUDA, OpenCL, and pure-Java backends, plus support for kernel contexts, compute graphs, and an off-heap type system.

_Java developers tracking GPU acceleration options can follow HAT's progress toward production readiness on daily.dev._

### How fast is Oracle's HAT compared to Nvidia's cuBLAS for matrix multiplication in Java?

A matrix multiplication benchmark written entirely in Java using HAT, applying shared memory, register tiling, and FP16 precision, reached roughly 80% of Nvidia's cuBLAS performance, which is hand-tuned native code. A separate flash attention demo on Apple Silicon showed about a 60x speedup over sequential Java execution.

_Anyone weighing whether Java can compete with native GPU libraries can track these benchmarks on daily.dev._

### Is Oracle's HAT project for Java GPU acceleration ready for production use?

No, HAT is still an Oracle research project presented at JavaOne 2026 and is not shipping in any JDK release. Java has had prior GPU acceleration attempts that stalled, such as Aparapi, so the gap between an impressive demo and a production-ready feature remains real despite HAT's stronger foundation in the Babylon code reflection API.

_Developers deciding whether to bet on Java for GPU workloads can watch HAT's maturity signals via daily.dev._

## Similar posts on daily.dev

- [Optimizing GPU Programs from Java using Babylon and HAT](https://daily.dev/posts/optimizing-gpu-programs-from-java-using-babylon-and-hat-ynbfqkbv8) · Inside Java · 0 upvotes · 0 comments

---

Tags: [#java](https://daily.dev/tags/java), [#gpu](https://daily.dev/tags/gpu), [#opencl](https://daily.dev/tags/opencl)

[View this post on daily.dev](https://daily.dev/posts/java-gets-real-gpu-acceleration-and-the-benchmarks-are-hard-to-ignore-xywmpbp9c)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Java gets real GPU acceleration, and the benchmarks are hard to ignore","url":"https://daily.dev/posts/java-gets-real-gpu-acceleration-and-the-benchmarks-are-hard-to-ignore-xywmpbp9c","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/java-gets-real-gpu-acceleration-and-the-benchmarks-are-hard-to-ignore-xywmpbp9c"},"datePublished":"2026-07-30T07:13:16.708Z","dateModified":"2026-09-13T19:18:56.060Z","description":"Oracle's HAT (Heterogeneous Accelerator Toolkit) project demonstrates Java-native GPU programming using Project Babylon's code reflection API and Project...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/32bf638c636109231e23c03afad232f8?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/32bf638c636109231e23c03afad232f8?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Trends","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Trends","logo":"https://media.daily.dev/image/upload/s--ZfSp3asX--/f_auto,q_auto/v1780996004/logos/trends?_a=BAMAMiWQ0","url":"https://daily.dev/sources/trends"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/java-gets-real-gpu-acceleration-and-the-benchmarks-are-hard-to-ignore-xywmpbp9c","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":13},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"java,gpu,opencl","timeRequired":"PT2M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Trends","item":"https://daily.dev/sources/trends"},{"@type":"ListItem","position":3,"name":"Java gets real GPU acceleration, and the benchmarks are hard to ignore"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/java-gets-real-gpu-acceleration-and-the-benchmarks-are-hard-to-ignore-xywmpbp9c#faq","mainEntity":[{"@type":"Question","name":"What is Oracle's HAT project and how does it let Java code run on a GPU?","acceptedAnswer":{"@type":"Answer","text":"HAT (Heterogeneous Accelerator Toolkit) is an Oracle research project that lets developers annotate Java methods with @Reflect, after which HAT transforms them into OpenCL or CUDA code at runtime, eliminating JNI glue and separate kernel files. It is built on Project Babylon's code reflection API and Project Panama, with pluggable CUDA, OpenCL, and pure-Java backends, plus support for kernel contexts, compute graphs, and an off-heap type system. Java developers tracking GPU acceleration options can follow HAT's progress toward production readiness on daily.dev."}},{"@type":"Question","name":"How fast is Oracle's HAT compared to Nvidia's cuBLAS for matrix multiplication in Java?","acceptedAnswer":{"@type":"Answer","text":"A matrix multiplication benchmark written entirely in Java using HAT, applying shared memory, register tiling, and FP16 precision, reached roughly 80% of Nvidia's cuBLAS performance, which is hand-tuned native code. A separate flash attention demo on Apple Silicon showed about a 60x speedup over sequential Java execution. Anyone weighing whether Java can compete with native GPU libraries can track these benchmarks on daily.dev."}},{"@type":"Question","name":"Is Oracle's HAT project for Java GPU acceleration ready for production use?","acceptedAnswer":{"@type":"Answer","text":"No, HAT is still an Oracle research project presented at JavaOne 2026 and is not shipping in any JDK release. Java has had prior GPU acceleration attempts that stalled, such as Aparapi, so the gap between an impressive demo and a production-ready feature remains real despite HAT's stronger foundation in the Babylon code reflection API. Developers deciding whether to bet on Java for GPU workloads can watch HAT's maturity signals via daily.dev."}}]}
```

