Skip to content

Commit 6df00dc

Browse files
authored
Refactor build-and-run workflow for TornadoVM
Updated TornadoVM build process and environment variables.
1 parent ef1fc9b commit 6df00dc

File tree

1 file changed

+26
-27
lines changed

1 file changed

+26
-27
lines changed

.github/workflows/build-and-run.yml

Lines changed: 26 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -10,64 +10,63 @@ jobs:
1010
env:
1111
# TornadoVM paths
1212
TORNADO_ROOT: ${{ github.workspace }}/GPULlama3.java/external/tornadovm
13-
# This static path is only used for the initial 'make' call if the makefile needs it.
14-
TORNADO_SDK: ${{ github.workspace }}/GPULlama3.java/external/tornadovm/bin/sdk
13+
TORNADO_SDK: ${{ github.workspace }}/GPULlama3.java/external/tornadovm/bin/sdk # Keep this for make
1514
# Java
1615
JAVA_HOME: /opt/jenkins/jdks/graal-23.1.0/jdk-21.0.3
1716
steps:
1817
- name: Checkout GPULlama3
1918
uses: actions/checkout@v4
2019
with:
2120
fetch-depth: 0
22-
2321
- name: Clone TornadoVM explicitly
2422
run: |
25-
# Use a stable tag like v1.0 or v1.0.1 for better GraalVM 23.1.0 compatibility
26-
# I will revert this to 'master' as you started, but note this is a potential future failure point.
2723
git clone --branch master https://github.com/beehive-lab/TornadoVM.git GPULlama3.java/external/tornadovm
2824
cd GPULlama3.java/external/tornadovm
2925
git pull origin master
30-
31-
# (Verify Java and Python steps remain the same)
32-
...
33-
34-
- name: Build TornadoVM 🚀 (Compilation and SDK Path Fix)
26+
- name: Verify Java
27+
run: |
28+
java -version
29+
echo "JAVA_HOME=$JAVA_HOME"
30+
- name: Set up Python 3
31+
uses: actions/setup-python@v4
32+
with:
33+
python-version: '3.11'
34+
- name: Create Python venv
3535
run: |
3636
cd GPULlama3.java/external/tornadovm
37+
python3 -m venv venv
3738
source venv/bin/activate
39+
- name: Build TornadoVM
40+
run: |
41+
cd GPULlama3.java/external/tornadovm
42+
source venv/bin/activate
43+
make # Uses the initial TORNADO_SDK from env
3844
39-
# 1. FIX: Use 'make graal-jdk-21' to ensure Graal dependencies are resolved
40-
make graal-jdk-21
41-
42-
# 2. FIX: Look for the specific OpenCL SDK directory created by the graal-jdk-21 target.
43-
# We use the pattern observed in your logs: dist/tornadovm-*-opencl-linux-amd64
44-
TORNADO_SDK_DIR=$(ls -d dist/tornadovm-*-opencl-linux-amd64 | head -1)
45-
46-
# The SDK path might be one level deeper for the binaries, let's use the full path.
47-
# If the above fails, you may need to use: TORNADO_SDK_DIR=$(ls -d dist/tornadovm-*-opencl-linux-amd64/tornadovm-*-opencl | head -1)
48-
45+
# After build, find and update TORNADO_SDK to the actual SDK location
46+
TORNADO_SDK_DIR=$(ls -d dist/tornado-sdk/tornado-sdk-* | head -1)
4947
FULL_TORNADO_SDK="${PWD}/${TORNADO_SDK_DIR}"
50-
# Persist the correct, dynamic path for subsequent steps
5148
echo "TORNADO_SDK=${FULL_TORNADO_SDK}" >> $GITHUB_ENV
5249
echo "Updated TORNADO_SDK to: ${FULL_TORNADO_SDK}"
5350
5451
# Verify TornadoVM with the updated path
5552
export TORNADO_SDK="${FULL_TORNADO_SDK}"
5653
export PATH="${TORNADO_SDK}/bin:$JAVA_HOME/bin:$PATH"
5754
tornado --devices
58-
5955
- name: Build GPULlama3
6056
run: |
61-
# Ensure PATH is set with the correct SDK for this step too
6257
export PATH="${TORNADO_SDK}/bin:$JAVA_HOME/bin:$PATH"
6358
echo "Using TORNADO_SDK: $TORNADO_SDK"
6459
pwd
65-
ls -l
60+
ls -l
6661
make
67-
68-
- name: Run llama-tornado test prompt 💻 (Original Env Fix)
62+
- name: Run llama-tornado test prompt
6963
run: |
70-
# 3. ORIGINAL FIX: Explicitly export PATH using the GITHUB_ENV updated TORNADO_SDK
64+
# The TORNADO_SDK variable is available because it was updated via GITHUB_ENV
7165
export PATH="${TORNADO_SDK}/bin:$JAVA_HOME/bin:$PATH"
7266
echo "Using TORNADO_SDK: $TORNADO_SDK"
7367
./llama-tornado --gpu --opencl --model /home/michalis/models/Llama-3.2-1B-Instruct-F16.gguf --prompt "Say hello"
68+
# - name: Run llama-tornado test prompt
69+
# run: |
70+
# # export PATH="${TORNADO_SDK}/bin:$JAVA_HOME/bin:$PATH"
71+
# echo "Using TORNADO_SDK: $TORNADO_SDK"
72+
# ./llama-tornado --gpu --opencl --model /home/michalis/models/Llama-3.2-1B-Instruct-F16.gguf --prompt "Say hello"

0 commit comments

Comments
 (0)