Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-and-run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ jobs:
# Export for current shell session
export TORNADOVM_HOME="$FULL_SDK"
export PATH="$FULL_SDK/bin:$JAVA_HOME/bin:$PATH"

# Save for subsequent steps
echo "TORNADOVM_HOME=$FULL_SDK" >> $GITHUB_ENV
echo "PATH=$PATH" >> $GITHUB_ENV
Expand Down
20 changes: 15 additions & 5 deletions .github/workflows/deploy-maven-central.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,20 @@ on:

jobs:
deploy:
name: Deploy to Maven Central
name: Deploy to Maven Central (${{ matrix.jdk.name }})
if: github.repository == 'beehive-lab/GPULlama3.java'
runs-on: [self-hosted, Linux, x64]
timeout-minutes: 15
strategy:
fail-fast: false # if one JDK fails, still attempt the other
matrix:
jdk:
- name: jdk21
java_home: /opt/jenkins/jdks/graal-23.1.0/jdk-21.0.3
- name: jdk25
java_home: /opt/jenkins/jdks/jdk-25.0.2
env:
JAVA_HOME: /opt/jenkins/jdks/graal-23.1.0/jdk-21.0.3
JAVA_HOME: ${{ matrix.jdk.java_home }}

steps:
- name: Checkout code
Expand Down Expand Up @@ -98,13 +106,15 @@ jobs:
- name: Deployment Summary
if: ${{ !inputs.dry_run }}
run: |
echo "## 🚀 Maven Central Deployment" >> $GITHUB_STEP_SUMMARY
DEPLOYED_VERSION=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout 2>/dev/null)
echo "## 🚀 Maven Central Deployment (${{ matrix.jdk.name }})" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "| Detail | Value |" >> $GITHUB_STEP_SUMMARY
echo "|--------|-------|" >> $GITHUB_STEP_SUMMARY
echo "| Version | ${{ steps.version.outputs.version }} |" >> $GITHUB_STEP_SUMMARY
echo "| JDK | ${{ matrix.jdk.name }} |" >> $GITHUB_STEP_SUMMARY
echo "| Version | ${DEPLOYED_VERSION} |" >> $GITHUB_STEP_SUMMARY
echo "| GroupId | io.github.beehive-lab |" >> $GITHUB_STEP_SUMMARY
echo "| ArtifactId | gpu-llama3 |" >> $GITHUB_STEP_SUMMARY
echo "| Status | ✅ Deployed |" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "📍 [View on Maven Central](https://central.sonatype.com/artifact/io.github.beehive-lab/gpu-llama3/${{ steps.version.outputs.version }})" >> $GITHUB_STEP_SUMMARY
echo "📍 [View on Maven Central](https://central.sonatype.com/artifact/io.github.beehive-lab/gpu-llama3/${DEPLOYED_VERSION})" >> $GITHUB_STEP_SUMMARY
7 changes: 5 additions & 2 deletions .github/workflows/prepare-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,17 @@ jobs:

- name: Update Maven version
run: |
./mvnw versions:set -DnewVersion=${{ env.VERSION }} -DgenerateBackupPoms=false
# Update <revision> property directly; versions:set would overwrite
# the CI-friendly ${revision}${jdk.version.suffix} expression.
sed -i 's|<revision>.*</revision>|<revision>${{ env.VERSION }}</revision>|' pom.xml
echo "✅ Maven version updated to ${{ env.VERSION }}"

- name: Update README.md
run: |
if [ -f "README.md" ]; then
# Update version in Maven dependency example
# Update version in Maven dependency examples (handles plain X.Y.Z and X.Y.Z-jdkNN suffixes)
sed -i 's|<version>[0-9]\+\.[0-9]\+\.[0-9]\+</version>|<version>${{ env.VERSION }}</version>|g' README.md
sed -i 's|<version>[0-9]\+\.[0-9]\+\.[0-9]\+-jdk[0-9]\+</version>|<version>${{ env.VERSION }}-jdk25</version>|g' README.md
echo "✅ Updated README.md"
fi

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ pom.xml.versionsBackup
pom.xml.next
release.properties
dependency-reduced-pom.xml
.flattened-pom.xml
buildNumber.properties
.mvn/timing.properties
.mvn/wrapper/maven-wrapper.jar
Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ Despite being deprecated, OpenCL can still run on Apple Silicon; albeit, with ol

You can add **GPULlama3.java** directly to your Maven project by including the following dependency in your `pom.xml`:

**JDK 21:**
```xml
<dependency>
<groupId>io.github.beehive-lab</groupId>
Expand All @@ -137,6 +138,15 @@ You can add **GPULlama3.java** directly to your Maven project by including the f
</dependency>
```

**JDK 25:**
```xml
<dependency>
<groupId>io.github.beehive-lab</groupId>
<artifactId>gpu-llama3</artifactId>
<version>0.3.1-jdk25</version>
</dependency>
```

## ☕ Integration with Your Java Codebase or Tools

To integrate it into your codebase or IDE (e.g., IntelliJ) or custom build system (like IntelliJ, Maven, or Gradle), use the `--show-command` flag.
Expand Down
121 changes: 111 additions & 10 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<!-- Use your verified namespace -->
<groupId>io.github.beehive-lab</groupId>
<artifactId>gpu-llama3</artifactId>
<version>0.3.3</version> <!-- release version (no -SNAPSHOT) -->
<version>${revision}${jdk.version.suffix}</version>

<name>GPU Llama3</name>
<description>GPU-accelerated LLaMA3 inference using TornadoVM</description>
Expand Down Expand Up @@ -37,6 +37,12 @@
</scm>

<properties>
<!-- CI-friendly version: resolved by flatten-maven-plugin at build time -->
<revision>0.3.1</revision>
<jdk.version.suffix></jdk.version.suffix> <!-- empty=JDK21, -jdk25=JDK25 -->
<!-- TornadoVM version: overridden per JDK profile -->
<tornadovm.version>3.0.0</tornadovm.version> <!-- JDK21 default -->
<!-- Compiler defaults (overridden by JDK profiles below) -->
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand All @@ -54,31 +60,55 @@
<dependency>
<groupId>io.github.beehive-lab</groupId>
<artifactId>tornado-api</artifactId>
<version>2.2.0</version>
<version>${tornadovm.version}</version>
</dependency>
<dependency>
<groupId>io.github.beehive-lab</groupId>
<artifactId>tornado-runtime</artifactId>
<version>2.2.0</version>
<version>${tornadovm.version}</version>
</dependency>
</dependencies>

<build>
<plugins>
<!-- Compiler -->
<!-- Compiler: enable-preview for both JDKs.
--add-modules jdk.incubator.vector is added per JDK profile (see below).
The Vector API remains in jdk.incubator.vector on both JDK 21 and JDK 25
(JEP 508 — 10th Incubator in JDK 25); the flag is required for all JDKs. -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<configuration>
<compilerArgs>
<arg>--enable-preview</arg>
<arg>--add-modules</arg>
<arg>jdk.incubator.vector</arg>
</compilerArgs>
</configuration>
</plugin>

<!-- Flatten: resolves ${revision}${jdk.version.suffix} in the published POM -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>flatten-maven-plugin</artifactId>
<version>1.6.0</version>
<configuration>
<updatePomFile>true</updatePomFile>
<flattenMode>resolveCiFriendliesOnly</flattenMode>
</configuration>
<executions>
<execution>
<id>flatten</id>
<phase>process-resources</phase>
<goals><goal>flatten</goal></goals>
</execution>
<execution>
<id>flatten.clean</id>
<phase>clean</phase>
<goals><goal>clean</goal></goals>
</execution>
</executions>
</plugin>

<!-- Shade (fat jar) -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand All @@ -103,6 +133,72 @@

<!-- Profiles for optional/conditional builds -->
<profiles>

<!-- ─── JDK 21 ───────────────────────────────────────────────────────────
Auto-activates for JDK 21.x builds.
Publishes: gpu-llama3:${revision} (no suffix)
TornadoVM: 3.0.0
Adds add-modules jdk.incubator.vector (still incubating in JDK21)
─────────────────────────────────────────────────────────────────────── -->
<profile>
<id>jdk21</id>
<activation><jdk>[21,25)</jdk></activation>
<properties>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<tornadovm.version>3.0.0</tornadovm.version>
<jdk.version.suffix></jdk.version.suffix>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<!-- Appended to enable-preview already in main build -->
<compilerArgs combine.children="append">
<arg>--add-modules</arg>
<arg>jdk.incubator.vector</arg>
</compilerArgs>
</configuration>
</plugin>
</plugins>
</build>
</profile>

<!-- ─── JDK 25 ───────────────────────────────────────────────────────────
Auto-activates for JDK 25.0.2+ builds (minimum required version).
Publishes: gpu-llama3:${revision}-jdk25
TornadoVM: 3.0.0-jdk25
Vector API is still incubating in JDK 25 (JEP 508 — 10th Incubator);
--add-modules jdk.incubator.vector is required for compilation.
─────────────────────────────────────────────────────────────────────── -->
<profile>
<id>jdk25</id>
<activation><jdk>[25.0.2,)</jdk></activation>
<properties>
<maven.compiler.source>25</maven.compiler.source>
<maven.compiler.target>25</maven.compiler.target>
<tornadovm.version>3.0.0-jdk25</tornadovm.version>
<jdk.version.suffix>-jdk25</jdk.version.suffix>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<!-- Appended to enable-preview already in main build -->
<compilerArgs combine.children="append">
<arg>--add-modules</arg>
<arg>jdk.incubator.vector</arg>
</compilerArgs>
</configuration>
</plugin>
</plugins>
</build>
</profile>

<profile>
<id>release</id>
<properties>
Expand All @@ -126,20 +222,25 @@
</executions>
</plugin>

<!-- Javadocs with preview feature support -->
<!-- Javadocs with preview feature support.
--add-modules jdk.incubator.vector is required on all currently
supported JDKs (21 and 25) because the Vector API remains in the
incubator module (JEP 508 — 10th Incubator in JDK 25). -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.6.3</version>
<configuration>
<source>21</source>
<release>21</release>
<source>${maven.compiler.source}</source>
<release>${maven.compiler.source}</release>
<additionalJOptions>
<additionalJOption>--enable-preview</additionalJOption>
<additionalJOption>--add-modules=jdk.incubator.vector</additionalJOption>
<additionalJOption>--add-modules</additionalJOption>
<additionalJOption>jdk.incubator.vector</additionalJOption>
</additionalJOptions>
Comment on lines 236 to 240
Copy link

Copilot AI Feb 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The removal of --add-modules=jdk.incubator.vector from the javadoc plugin configuration may cause javadoc generation to fail on JDK 21 when the code uses Vector API classes. Since the Vector API is still incubating in JDK 21, the javadoc generation needs access to the module. Consider conditionally adding this flag based on the active profile, similar to how it's handled in the compiler plugin configuration.

Copilot uses AI. Check for mistakes.
<additionalOptions>
<additionalOption>--enable-preview</additionalOption>
<additionalOption>--add-modules jdk.incubator.vector</additionalOption>
</additionalOptions>
<failOnError>false</failOnError>
<failOnWarnings>false</failOnWarnings>
Expand Down
Loading