Initial commit: ROCmFPX automated multi-architecture build pipeline

This commit is contained in:
John Smith
2026-08-20 18:43:21 -04:00
commit ab77426bd6
12 changed files with 2074 additions and 0 deletions
+92
View File
@@ -0,0 +1,92 @@
name: Bug Report on ROCmFPX + ROCm builds
description: Report an issue specific to running ROCmFPX with ROCm builds
labels: ["bug"]
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to report an issue! Please fill in the details below so we can help you as quickly as possible.
- type: dropdown
id: os
attributes:
label: Operating System
description: Which OS are you running?
options:
- Windows 10
- Windows 11
- Ubuntu 22.04
- Ubuntu 24.04
- Fedora
- Arch Linux
- Other Linux (specify below)
validations:
required: true
- type: input
id: os-other
attributes:
label: OS Details (if "Other" or additional info)
description: Kernel version, distro version, or any other relevant OS details.
placeholder: e.g. Debian 12, kernel 6.1
- type: input
id: gpu
attributes:
label: GPU Model
description: Which AMD GPU are you using?
placeholder: e.g. Radeon 8060S (Strix Halo), Ryzen AI 300 (Strix Point), RX 7900 XTX, RX 6800 XT, MI210
validations:
required: true
- type: input
id: build-version
attributes:
label: ROCmFPX Build Version
description: Which release tag or build did you use? Check the releases page.
placeholder: e.g. b1000
validations:
required: true
- type: input
id: model
attributes:
label: Model Used
description: Provide the Hugging Face link or checkpoint/GGUF filename.
placeholder: e.g. Ornith1.0-35b-CIRU-DUALVIEW-FPX7+Q8-MTP.gguf or Qwen3.8-27B-CIRU-ActiveFPX-PromptForge.gguf
validations:
required: true
- type: dropdown
id: quant-format
attributes:
label: Quantization Format
description: Which ROCmFPX format are you running?
options:
- Q2_0_ROCMFPX
- Q3_0_ROCMFPX
- Q4_0_ROCMFP4 / FAST
- Q6_0_ROCMFPX
- Q7_0_ROCMFPX (DualView)
- Q8_0_ROCMFPX
- Standard GGUF (e.g. Q4_K_M, Q8_0, BF16)
- Other / Not sure
validations:
required: true
- type: textarea
id: description
attributes:
label: Issue Description
description: Describe what happened and what you expected to happen.
placeholder: When I run ... I get ...
validations:
required: true
- type: textarea
id: additional-info
attributes:
label: Additional Information
description: |
Any other context that might help — logs, screenshots, command-line flags, environment variables (e.g. GGML_ROCM_GFX1151_Q7_Q8_VIEW), etc.
render: text
+8
View File
@@ -0,0 +1,8 @@
blank_issues_enabled: false
contact_links:
- name: ROCmFPX Upstream Repo
url: https://github.com/ciru-ai/ROCmFPX
about: For questions and issues with ROCmFPX core formats, kernels, and quantization logic.
- name: TheRock ROCm SDK
url: https://github.com/ROCm/TheRock
about: For questions and issues related to AMD ROCm TheRock nightly builds.
+20
View File
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this automated build repository
title: ''
labels: enhancement
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is.
**Describe the solution you'd like**
A clear and concise description of what you want to happen (e.g. support for a new GPU target, additional ROCm bundling, build flags).
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.
+8
View File
@@ -0,0 +1,8 @@
---
name: Other
about: General inquiry or discussion
title: ''
labels: ''
assignees: ''
---
@@ -0,0 +1,184 @@
name: 'Test ROCmFPX Build'
description: 'Download and test ROCmFPX build artifacts'
inputs:
os_type:
description: 'Operating system type (Windows or Linux)'
required: true
gfx_target:
description: 'GPU target (e.g., gfx1151, gfx1150)'
required: true
artifact_name:
description: 'Full artifact name to download'
required: true
runs:
using: "composite"
steps:
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: ${{ inputs.artifact_name }}
path: rocmfpx-binaries
- name: Download test model (Windows)
if: inputs.os_type == 'Windows'
shell: powershell
run: |
$modelUrl = "https://huggingface.co/unsloth/Qwen3-0.6B-GGUF/resolve/main/Qwen3-0.6B-Q4_0.gguf?download=true"
$modelPath = "Qwen3-0.6B-Q4_0.gguf"
Write-Host "Downloading test model from: $modelUrl"
curl.exe -L -o $modelPath $modelUrl
if (Test-Path $modelPath) {
$fileSize = (Get-Item $modelPath).Length
Write-Host "Model downloaded successfully. Size: $fileSize bytes"
} else {
Write-Error "Failed to download model"
exit 1
}
- name: Download test model (Linux)
if: inputs.os_type == 'Linux'
shell: bash
run: |
model_url="https://huggingface.co/unsloth/Qwen3-0.6B-GGUF/resolve/main/Qwen3-0.6B-Q4_0.gguf?download=true"
model_path="Qwen3-0.6B-Q4_0.gguf"
echo "Downloading test model from: $model_url"
curl -L -o "$model_path" "$model_url"
if [ -f "$model_path" ]; then
file_size=$(stat -c%s "$model_path")
echo "Model downloaded successfully. Size: $file_size bytes"
else
echo "Failed to download model"
exit 1
fi
- name: Set up library path (Linux)
if: inputs.os_type == 'Linux'
shell: bash
run: |
echo "LD_LIBRARY_PATH=$(pwd)/rocmfpx-binaries:$LD_LIBRARY_PATH" >> $GITHUB_ENV
- name: Run llama-cli test (Windows)
if: inputs.os_type == 'Windows'
shell: powershell
run: |
$llamaCliPath = "rocmfpx-binaries\llama-cli.exe"
$modelPath = "Qwen3-0.6B-Q4_0.gguf"
if (-not (Test-Path $llamaCliPath)) {
Write-Error "llama-cli.exe not found at: $llamaCliPath"
Write-Host "Available files in rocmfpx-binaries:"
Get-ChildItem -Recurse "rocmfpx-binaries"
exit 1
}
Write-Host "Running llama-cli test for ${{ inputs.gfx_target }}..."
Write-Host "Command: $llamaCliPath -m `"$modelPath`" -ngl 99 -p `"I believe the meaning of life is`" -st -v"
try {
$process = Start-Process -FilePath $llamaCliPath -ArgumentList @("-m", "`"$modelPath`"", "-ngl", "99", "-p", "`"I believe the meaning of life is`"", "-st", "-v") -NoNewWindow -Wait -PassThru -RedirectStandardOutput "stdout.txt" -RedirectStandardError "stderr.txt"
$process.WaitForExit()
$stdout = Get-Content "stdout.txt" -Raw -ErrorAction SilentlyContinue
$stderr = Get-Content "stderr.txt" -Raw -ErrorAction SilentlyContinue
Write-Host "=== LLAMA-CLI STDOUT ==="
if ($stdout) { Write-Host $stdout } else { Write-Host "(empty)" }
Write-Host "=== LLAMA-CLI STDERR ==="
if ($stderr) { Write-Host $stderr } else { Write-Host "(empty)" }
Write-Host "=== END OUTPUT ==="
Write-Host "Process exit code: $($process.ExitCode)"
$output = $stdout + $stderr
Remove-Item "stdout.txt" -ErrorAction SilentlyContinue
Remove-Item "stderr.txt" -ErrorAction SilentlyContinue
}
catch {
Write-Error "Failed to start llama-cli process: $_"
Get-ChildItem "rocmfpx-binaries" | Format-Table Name, Length
exit 1
}
if ($process.ExitCode -ne 0) {
Write-Host "❌ llama-cli exited with error code: $($process.ExitCode)"
exit 1
}
$foundGpuOffload = $output -match "offloaded 29/29 layers to GPU"
$foundThinkTag = $output -match "</think>"
Write-Host "=== TEST RESULTS ==="
Write-Host "Expected 'offloaded 29/29 layers to GPU': $(if ($foundGpuOffload) { 'FOUND' } else { 'NOT FOUND' })"
Write-Host "Expected '</think>' tag: $(if ($foundThinkTag) { 'FOUND' } else { 'NOT FOUND' })"
if ($foundGpuOffload -and $foundThinkTag) {
Write-Host "✅ Test PASSED"
} else {
Write-Host "❌ Test FAILED - Missing expected outputs"
exit 1
}
- name: Run llama-cli test (Linux)
if: inputs.os_type == 'Linux'
shell: bash
run: |
llama_cli_path="./rocmfpx-binaries/llama-cli"
model_path="Qwen3-0.6B-Q4_0.gguf"
output_file="llama_output.txt"
chmod +x "$llama_cli_path"
if [ ! -f "$llama_cli_path" ]; then
echo "llama-cli not found at: $llama_cli_path"
find rocmfpx-binaries -type f
exit 1
fi
echo "Running llama-cli test for ${{ inputs.gfx_target }}..."
set +e
"$llama_cli_path" -m "$model_path" -ngl 99 -p "I believe the meaning of life is" -st -v > "$output_file" 2>&1
exit_code=$?
set -e
echo "=== LLAMA-CLI OUTPUT ==="
if [ -f "$output_file" ] && [ -s "$output_file" ]; then
cat "$output_file"
fi
echo "=== END OUTPUT ==="
echo "Process exit code: $exit_code"
if [ $exit_code -ne 0 ]; then
echo "❌ llama-cli exited with error code: $exit_code"
ldd "$llama_cli_path" || true
rm -f "$output_file"
exit 1
fi
found_gpu_offload=false
found_think_tag=false
if grep -F "offloaded 29/29 layers to GPU" "$output_file" > /dev/null 2>&1; then
found_gpu_offload=true
fi
if grep -F "</think>" "$output_file" > /dev/null 2>&1; then
found_think_tag=true
fi
echo "=== TEST RESULTS ==="
echo "Expected 'offloaded 29/29 layers to GPU': $(if [ "$found_gpu_offload" = true ]; then echo 'FOUND'; else echo 'NOT FOUND'; fi)"
echo "Expected '</think>' tag: $(if [ "$found_think_tag" = true ]; then echo 'FOUND'; else echo 'NOT FOUND'; fi)"
rm -f "$output_file"
if [ "$found_gpu_offload" = true ] && [ "$found_think_tag" = true ]; then
echo "✅ Test PASSED"
else
echo "❌ Test FAILED - Missing expected outputs"
exit 1
fi
+965
View File
@@ -0,0 +1,965 @@
name: Build ROCmFPX + ROCm
on:
workflow_dispatch:
inputs:
operating_systems:
description: 'Operating systems to build for (comma-separated: windows,ubuntu)'
required: false
default: 'windows,ubuntu'
gfx_target:
description: 'AMD GPU targets (comma-separated)'
required: false
default: 'gfx1151,gfx1150,gfx120X,gfx110X,gfx103X,gfx90a,gfx908'
rocm_version:
description: 'ROCm version to use (e.g., 7.13.0a20260318) or "latest" to auto-detect'
required: false
default: 'latest'
rocmfpx_version:
description: 'ROCmFPX version (tag, branch, commit hash, or "latest"/"main")'
required: false
default: 'main'
create_release:
description: 'Create a GitHub release after successful build'
required: false
default: true
type: boolean
# Trigger on pull requests
pull_request:
types: [opened, synchronize, reopened]
# Trigger on a schedule to build nightly releases
schedule:
# Runs at 1:00 PM UTC, which is 5:00 AM PST (UTC-8)
- cron: '0 13 * * *'
env:
OPERATING_SYSTEMS: ${{ github.event.inputs.operating_systems || 'windows,ubuntu' }}
GFX_TARGETS: ${{ github.event.inputs.gfx_target || 'gfx1151,gfx1150,gfx120X,gfx110X,gfx103X,gfx90a,gfx908' }}
ROCM_VERSION: ${{ github.event.inputs.rocm_version || 'latest' }}
ROCMFPX_VERSION: ${{ github.event.inputs.rocmfpx_version || 'main' }}
jobs:
prepare-matrix:
runs-on: ubuntu-22.04
outputs:
windows_matrix: ${{ steps.set-matrix.outputs.windows_matrix }}
ubuntu_matrix: ${{ steps.set-matrix.outputs.ubuntu_matrix }}
should_build_windows: ${{ steps.set-matrix.outputs.should_build_windows }}
should_build_ubuntu: ${{ steps.set-matrix.outputs.should_build_ubuntu }}
steps:
- name: Set matrix
id: set-matrix
run: |
targets="${{ env.GFX_TARGETS }}"
operating_systems="${{ env.OPERATING_SYSTEMS }}"
echo "Input targets: $targets"
echo "Input operating systems: $operating_systems"
# Convert targets to JSON array
matrix_targets=$(echo "$targets" \
| tr ',' '\n' \
| sed 's/^ *//;s/ *$//' \
| sed 's/^"//;s/"$//' \
| jq -R . \
| jq -s '{gfx_target: .}' \
| jq -c)
# Check which operating systems to build
should_build_windows="false"
should_build_ubuntu="false"
if [[ "$operating_systems" == *"windows"* ]]; then
should_build_windows="true"
echo "windows_matrix=$matrix_targets" >> $GITHUB_OUTPUT
fi
if [[ "$operating_systems" == *"ubuntu"* ]]; then
should_build_ubuntu="true"
echo "ubuntu_matrix=$matrix_targets" >> $GITHUB_OUTPUT
fi
echo "should_build_windows=$should_build_windows" >> $GITHUB_OUTPUT
echo "should_build_ubuntu=$should_build_ubuntu" >> $GITHUB_OUTPUT
echo "Windows build: $should_build_windows"
echo "Ubuntu build: $should_build_ubuntu"
echo "Generated matrix: $matrix_targets"
build-windows:
# Pinned to windows-2022 (VS 2022 / MSVC 14.4x). The windows-latest image moved to
# VS 2026 (MSVC 14.51), whose <cmath> declares isgreater/isless/etc. as
# constexpr (implicitly __host__ __device__), which collides with ROCm clang's
# __device__-only HIP math wrappers and breaks the HIP build.
runs-on: windows-2022
needs: prepare-matrix
if: needs.prepare-matrix.outputs.should_build_windows == 'true'
strategy:
matrix: ${{fromJson(needs.prepare-matrix.outputs.windows_matrix)}}
fail-fast: false
outputs:
rocm_version: ${{ steps.set-outputs.outputs.rocm_version }}
rocmfpx_commit_hash: ${{ steps.set-outputs.outputs.rocmfpx_commit_hash }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Clean up existing directories (safety precaution)
run: |
# Remove existing ROCmFPX directory if it exists
if (Test-Path "ROCmFPX") {
Write-Host "Removing existing ROCmFPX directory..."
Remove-Item -Recurse -Force "ROCmFPX"
}
# Remove existing C:\opt\rocm directory if it exists
if (Test-Path "C:\opt\rocm") {
Write-Host "Removing existing C:\opt\rocm directory..."
Remove-Item -Recurse -Force "C:\opt\rocm"
}
# Remove any existing ROCm tarball
if (Test-Path "rocm.tar.gz") {
Write-Host "Removing existing rocm.tar.gz..."
Remove-Item -Force "rocm.tar.gz"
}
Write-Host "Cleanup completed successfully"
- name: Install Visual Studio Build Tools
run: |
$vsInstallerUrl = "https://aka.ms/vs/17/release/vs_buildtools.exe"
$vsInstallerPath = "$env:TEMP\vs_buildtools.exe"
Write-Host "Downloading Visual Studio Build Tools..."
Invoke-WebRequest -Uri $vsInstallerUrl -OutFile $vsInstallerPath
Write-Host "Installing Visual Studio Build Tools..."
Start-Process -FilePath $vsInstallerPath -ArgumentList "--quiet", "--wait", "--norestart", "--add", "Microsoft.VisualStudio.Component.VC.Tools.x86.x64", "--add", "Microsoft.VisualStudio.Component.VC.CMake.Project", "--add", "Microsoft.VisualStudio.Component.VC.ATL", "--add", "Microsoft.VisualStudio.Component.Windows11SDK.22621" -Wait
Remove-Item $vsInstallerPath -Force
- name: Install build dependencies
run: |
Write-Host "Installing build dependencies..."
# Install Ninja
Write-Host "Installing Ninja..."
$ninjaUrl = "https://github.com/ninja-build/ninja/releases/download/v1.11.1/ninja-win.zip"
$ninjaPath = "$env:TEMP\ninja-win.zip"
$ninjaDir = "C:\ninja"
New-Item -ItemType Directory -Force -Path $ninjaDir
Invoke-WebRequest -Uri $ninjaUrl -OutFile $ninjaPath
Expand-Archive -Path $ninjaPath -DestinationPath $ninjaDir -Force
# Install Strawberry Perl
Write-Host "Installing Strawberry Perl..."
$perlUrl = "http://strawberryperl.com/download/5.32.1.1/strawberry-perl-5.32.1.1-64bit.msi"
$perlPath = "$env:TEMP\strawberry-perl-5.32.1.1-64bit.msi"
Invoke-WebRequest -Uri $perlUrl -OutFile $perlPath
Start-Process msiexec.exe -ArgumentList "/i $perlPath /quiet /norestart" -Wait
# Verify installations
$env:PATH = "C:\ninja;C:\Strawberry\perl\bin;$env:PATH"
Write-Host "Verifying installations..."
ninja --version
perl --version
Write-Host "Build dependencies installation completed"
- name: Download ROCm nightly tarball
run: |
$rocmVersion = "${{ env.ROCM_VERSION }}"
$currentTarget = "${{ matrix.gfx_target }}"
# Add appropriate suffixes for different GPU targets
$s3Target = $currentTarget
if ($currentTarget -eq "gfx103X" -or $currentTarget -eq "gfx110X" -or $currentTarget -eq "gfx120X") {
$s3Target = "$currentTarget-all"
Write-Host "Using target with -all suffix: $s3Target"
}
$baseUrl = "https://rocm.nightlies.amd.com/tarball-multi-arch"
if ($rocmVersion -eq "latest") {
Write-Host "Auto-detecting latest ROCm version for target: $currentTarget"
$indexHtml = (Invoke-WebRequest "$baseUrl/" -UseBasicParsing).Content
$filesMatch = [regex]::Match($indexHtml, 'const files = (\[.*?\]);', [System.Text.RegularExpressions.RegexOptions]::Singleline)
if (-not $filesMatch.Success) {
Write-Error "Failed to parse file index from $baseUrl/"
exit 1
}
$allFiles = $filesMatch.Groups[1].Value | ConvertFrom-Json
$prefix = "therock-dist-windows-$s3Target-"
$versionPattern = "^$([regex]::Escape($prefix))\d+\.\d+\.\d+(a|rc)\d+\.tar\.gz$"
$latest = $allFiles |
Where-Object { $_.name -match $versionPattern } |
Sort-Object { [regex]::Match($_.name, '(\d{8})\.tar\.gz$').Groups[1].Value } |
Select-Object -Last 1
if (-not $latest) {
Write-Error "No tarball found for prefix '$prefix' at $baseUrl/"
exit 1
}
$latestFile = $latest.name
Write-Host "Found latest file: $latestFile"
if ($latestFile -match "therock-dist-windows-$s3Target-(\d+\.\d+\.\d+(?:a|rc)\d+)\.tar\.gz") {
$rocmVersion = $matches[1]
Write-Host "Detected latest ROCm version: $rocmVersion"
} else {
Write-Error "Failed to extract ROCm version from latest file: $latestFile"
exit 1
}
$rocmUrl = "$baseUrl/$latestFile"
} else {
$rocmUrl = "$baseUrl/therock-dist-windows-$s3Target-$rocmVersion.tar.gz"
}
echo "DETECTED_ROCM_VERSION=$rocmVersion" >> $env:GITHUB_ENV
Write-Host "Downloading ROCm from: $rocmUrl"
Invoke-WebRequest -Uri $rocmUrl -OutFile "rocm.tar.gz"
- name: Extract ROCm to C:\opt\rocm
run: |
New-Item -ItemType Directory -Force -Path "C:\opt\rocm"
tar -xzf rocm.tar.gz -C C:\opt\rocm --strip-components=1
- name: Clone ROCmFPX
run: |
$rocmfpxVersion = "${{ env.ROCMFPX_VERSION }}"
if ($rocmfpxVersion -eq "latest" -or $rocmfpxVersion -eq "main") {
Write-Host "Cloning main branch with shallow clone"
git clone --depth 1 --single-branch --branch main https://github.com/ciru-ai/ROCmFPX.git
} else {
Write-Host "Cloning ROCmFPX version: $rocmfpxVersion with shallow clone"
git clone --depth 1 --single-branch --branch $rocmfpxVersion https://github.com/ciru-ai/ROCmFPX.git
}
cd ROCmFPX
$commitHash = git rev-parse --short=7 HEAD
echo "ROCMFPX_COMMIT_HASH=$commitHash" >> $env:GITHUB_ENV
Write-Host "ROCmFPX commit hash: $commitHash"
Write-Host "Current ROCmFPX commit:"
git log --oneline -1
- name: Build ROCmFPX + ROCm
shell: cmd
run: |
REM Map GPU targets
set "current_target=${{ matrix.gfx_target }}"
echo Input target: %current_target%
if "%current_target%"=="gfx110X" (
set "mapped_target=gfx1100;gfx1101;gfx1102;gfx1103"
) else if "%current_target%"=="gfx103X" (
set "mapped_target=gfx1030;gfx1031;gfx1032;gfx1034"
) else if "%current_target%"=="gfx1151" (
set "mapped_target=gfx1151"
) else if "%current_target%"=="gfx1150" (
set "mapped_target=gfx1150"
) else if "%current_target%"=="gfx120X" (
set "mapped_target=gfx1200;gfx1201"
) else (
set "mapped_target=%current_target%"
)
echo Mapped target: %mapped_target%
REM Set up environment variables and PATH
set HIP_PATH=C:\opt\rocm
set HIP_PLATFORM=amd
set PATH=%HIP_PATH%\lib\llvm\bin;%HIP_PATH%\bin;%PATH%
REM Set up x64 Native Tools Command Prompt environment
call "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath > vs_path.txt
set /p VS_PATH=<vs_path.txt
call "%VS_PATH%\VC\Auxiliary\Build\vcvars64.bat"
REM Create build directory
cd ROCmFPX
mkdir build
cd build
REM Configure the project
cmake .. -G Ninja ^
-DCMAKE_C_COMPILER="C:\opt\rocm\lib\llvm\bin\clang.exe" ^
-DCMAKE_CXX_COMPILER="C:\opt\rocm\lib\llvm\bin\clang++.exe" ^
-DCMAKE_CXX_FLAGS="-IC:\opt\rocm\include" ^
-DCMAKE_CROSSCOMPILING=ON ^
-DCMAKE_BUILD_TYPE=Release ^
-DGPU_TARGETS="%mapped_target%" ^
-DBUILD_SHARED_LIBS=ON ^
-DLLAMA_BUILD_TESTS=OFF ^
-DGGML_HIP=ON ^
-DGGML_HIP_FORCE_MMQ=ON ^
-DGGML_OPENMP=OFF ^
-DGGML_CUDA_FORCE_CUBLAS=OFF ^
-DGGML_RPC=ON ^
-DGGML_HIP_ROCWMMA_FATTN=OFF ^
-DLLAMA_BUILD_BORINGSSL=ON ^
-DGGML_NATIVE=OFF ^
-DGGML_STATIC=OFF ^
-DCMAKE_SYSTEM_NAME=Windows
REM Build the project
cmake --build . -j %NUMBER_OF_PROCESSORS%
- name: Copy ROCm core DLLs to build directory
run: |
$rocmVersion = if ($env:DETECTED_ROCM_VERSION) { $env:DETECTED_ROCM_VERSION } else { $env:ROCM_VERSION }
$buildBinPath = "ROCmFPX\build\bin"
$rocmBinPath = "C:\opt\rocm\bin"
Write-Host "Copying ROCm core DLL files to build directory..."
Write-Host "Source: $rocmBinPath"
Write-Host "Destination: $buildBinPath"
if (Test-Path $rocmBinPath) {
$filesToCopy = @(
"amdhip64_*.dll",
"rocm_kpack.dll",
"amd_comgr*.dll",
"libhipblas.dll",
"rocblas.dll",
"rocsolver.dll",
"hipblaslt.dll",
"libhipblaslt.dll",
"hipblas.dll",
"origami.dll"
)
foreach ($pattern in $filesToCopy) {
$matchingFiles = Get-ChildItem -Path $rocmBinPath -Name $pattern -ErrorAction SilentlyContinue
if ($matchingFiles) {
foreach ($file in $matchingFiles) {
$sourcePath = Join-Path $rocmBinPath $file
$destPath = Join-Path $buildBinPath $file
Copy-Item $sourcePath $destPath
Write-Host "Copied: $file"
}
} else {
Write-Host "Warning: No files found matching pattern: $pattern"
}
}
# Copy rocblas\library folder
$rocblasLibPath = Join-Path $rocmBinPath "rocblas\library"
if (Test-Path $rocblasLibPath) {
Write-Host "Copying rocblas\library folder..."
$destRocblasPath = Join-Path $buildBinPath "rocblas\library"
Copy-Item -Path $rocblasLibPath -Destination $destRocblasPath -Recurse -Force
Write-Host "Copied: rocblas\library folder"
} else {
Write-Host "Warning: rocblas\library folder not found at: $rocblasLibPath"
}
# Copy hipblaslt\library folder
$hipblasltLibPath = Join-Path $rocmBinPath "hipblaslt\library"
if (Test-Path $hipblasltLibPath) {
Write-Host "Copying hipblaslt\library folder..."
$destHipblasltPath = Join-Path $buildBinPath "hipblaslt\library"
Copy-Item -Path $hipblasltLibPath -Destination $destHipblasltPath -Recurse -Force
Write-Host "Copied: hipblaslt\library folder"
} else {
Write-Host "Warning: hipblaslt\library folder not found at: $hipblasltLibPath"
}
Write-Host "ROCm core files successfully copied to build directory"
} else {
Write-Error "ROCm bin directory not found: $rocmBinPath"
exit 1
}
- name: List build artifacts (including ROCm files)
run: |
cd ROCmFPX\build\bin
Write-Host "Final build artifacts (including ROCm core files):"
Get-ChildItem -Recurse | Format-Table Name, Length, LastWriteTime
- name: Upload build artifacts
id: upload-artifacts
uses: actions/upload-artifact@v4
with:
name: rocmfpx-windows-rocm-${{ matrix.gfx_target }}-x64
path: ROCmFPX/build/bin/
retention-days: 30
- name: Set job outputs
id: set-outputs
run: |
Write-Host "Setting job outputs..."
Write-Host "Current target: ${{ matrix.gfx_target }}"
Write-Host "DETECTED_ROCM_VERSION: $env:DETECTED_ROCM_VERSION"
Write-Host "ROCM_VERSION: $env:ROCM_VERSION"
Write-Host "ROCMFPX_COMMIT_HASH: $env:ROCMFPX_COMMIT_HASH"
$rocmVersion = if ($env:DETECTED_ROCM_VERSION) { $env:DETECTED_ROCM_VERSION } else { $env:ROCM_VERSION }
echo "rocm_version=$rocmVersion" >> $env:GITHUB_OUTPUT
echo "rocmfpx_commit_hash=$env:ROCMFPX_COMMIT_HASH" >> $env:GITHUB_OUTPUT
Write-Host "Final rocm_version: $rocmVersion"
Write-Host "Final rocmfpx_commit_hash: $env:ROCMFPX_COMMIT_HASH"
- name: Create release summary
run: |
$summary = @"
# ROCmFPX + ROCm Build Summary (Windows - ${{ matrix.gfx_target }})
## Build Configuration
- **GPU Target**: ${{ matrix.gfx_target }}
- **ROCm Version**: ${{ env.DETECTED_ROCM_VERSION || env.ROCM_VERSION }}
- **ROCmFPX Commit Hash**: ${{ env.ROCMFPX_COMMIT_HASH }}
- **Build Type**: Release
- **Platform**: Windows
## Build Artifacts
The compiled binaries are available in the build artifacts.
"@
Set-Content -Path "build-summary-windows-${{ matrix.gfx_target }}.md" -Value $summary
- name: Upload build summary
id: upload-summary
uses: actions/upload-artifact@v4
with:
name: build-summary-windows-${{ matrix.gfx_target }}
path: build-summary-windows-${{ matrix.gfx_target }}.md
retention-days: 30
- name: Clean up build artifacts and temporary files
if: always()
run: |
Write-Host "Starting cleanup process..."
if (Test-Path "rocm.tar.gz") {
Remove-Item -Force "rocm.tar.gz"
}
if (Test-Path "C:\opt\rocm") {
Remove-Item -Recurse -Force "C:\opt\rocm"
}
if (Test-Path "ROCmFPX") {
Remove-Item -Recurse -Force "ROCmFPX"
}
if (Test-Path "build-summary-windows-${{ matrix.gfx_target }}.md") {
Remove-Item -Force "build-summary-windows-${{ matrix.gfx_target }}.md"
}
Write-Host "Cleanup completed successfully"
build-ubuntu:
runs-on: ubuntu-22.04
needs: prepare-matrix
if: needs.prepare-matrix.outputs.should_build_ubuntu == 'true'
strategy:
matrix: ${{fromJson(needs.prepare-matrix.outputs.ubuntu_matrix)}}
fail-fast: false
outputs:
rocm_version: ${{ steps.set-outputs.outputs.rocm_version }}
rocmfpx_commit_hash: ${{ steps.set-outputs.outputs.rocmfpx_commit_hash }}
steps:
- name: Free disk space
run: curl -fsSL https://raw.githubusercontent.com/kou/arrow/e49d8ae15583ceff03237571569099a6ad62be32/ci/scripts/util_free_space.sh | bash
- name: Checkout repository
uses: actions/checkout@v4
- name: Clean up existing directories (safety precaution)
run: |
if [ -d "ROCmFPX" ]; then
echo "Removing existing ROCmFPX directory..."
rm -rf ROCmFPX
fi
if [ -d "/opt/rocm" ]; then
echo "Removing existing /opt/rocm directory..."
sudo rm -rf /opt/rocm
fi
if [ -f "rocm.tar.gz" ]; then
echo "Removing existing rocm.tar.gz..."
rm -f rocm.tar.gz
fi
echo "Cleanup completed successfully"
- name: Install build dependencies
run: |
echo "Installing build dependencies..."
sudo apt update
sudo apt install -y cmake ninja-build unzip curl patchelf
echo "Verifying installations..."
cmake --version
ninja --version
echo "Build dependencies installation completed"
- name: Download and extract ROCm directly to /opt/rocm
run: |
rocm_version="${{ env.ROCM_VERSION }}"
current_target="${{ matrix.gfx_target }}"
s3_target="$current_target"
if [[ "$current_target" = "gfx103X" || "$current_target" = "gfx110X" || "$current_target" = "gfx120X" ]]; then
s3_target="${current_target}-all"
echo "Using target with -all suffix: $s3_target"
fi
base_url="https://rocm.nightlies.amd.com/tarball-multi-arch"
if [ "$rocm_version" = "latest" ]; then
echo "Auto-detecting latest ROCm version for target: $current_target"
prefix="therock-dist-linux-${s3_target}-"
files_json=$(curl -s "$base_url/" | tr '\n' ' ' | grep -oP 'const files = \K\[.*?\](?=\s*;)')
if [ -z "$files_json" ]; then
echo "Failed to parse file index from $base_url/"
exit 1
fi
latest_file=$(echo "$files_json" | jq -r --arg p "$prefix" \
'[.[] | select(.name | test("^" + $p + "[0-9]+\\.[0-9]+\\.[0-9]+(a|rc)[0-9]+\\.tar\\.gz$"))] | sort_by(.name | capture("(?<d>[0-9]{8})\\.tar\\.gz$").d) | last | .name // empty')
if [ -z "$latest_file" ]; then
echo "No tarball found for prefix '$prefix' at $base_url/"
exit 1
fi
echo "Found latest file: $latest_file"
if [[ "$latest_file" =~ therock-dist-linux-${s3_target}-([0-9]+\.[0-9]+\.[0-9]+(a|rc)[0-9]+)\.tar\.gz ]]; then
rocm_version="${BASH_REMATCH[1]}"
echo "Detected latest ROCm version: $rocm_version"
else
echo "Failed to extract ROCm version from latest file: $latest_file"
exit 1
fi
rocm_url="$base_url/$latest_file"
else
rocm_url="$base_url/therock-dist-linux-${s3_target}-${rocm_version}.tar.gz"
fi
echo "DETECTED_ROCM_VERSION=$rocm_version" >> $GITHUB_ENV
echo "Streaming ROCm from: $rocm_url directly to extraction"
sudo mkdir -p /opt/rocm
curl -sL "$rocm_url" | sudo tar --use-compress-program=gzip -xf - -C /opt/rocm --strip-components=1
- name: Set ROCm environment variables
run: |
echo "Setting ROCm environment variables..."
echo "HIP_PATH=/opt/rocm" >> $GITHUB_ENV
echo "ROCM_PATH=/opt/rocm" >> $GITHUB_ENV
echo "HIP_PLATFORM=amd" >> $GITHUB_ENV
echo "HIP_CLANG_PATH=/opt/rocm/llvm/bin" >> $GITHUB_ENV
echo "HIP_INCLUDE_PATH=/opt/rocm/include" >> $GITHUB_ENV
echo "HIP_LIB_PATH=/opt/rocm/lib" >> $GITHUB_ENV
echo "HIP_DEVICE_LIB_PATH=/opt/rocm/lib/llvm/amdgcn/bitcode" >> $GITHUB_ENV
echo "/opt/rocm/bin:/opt/rocm/llvm/bin:$PATH" >> $GITHUB_PATH
echo "LD_LIBRARY_PATH=/opt/rocm/lib:/opt/rocm/lib64:/opt/rocm/llvm/lib:${LD_LIBRARY_PATH:-}" >> $GITHUB_ENV
echo "LIBRARY_PATH=/opt/rocm/lib:/opt/rocm/lib64:${LIBRARY_PATH:-}" >> $GITHUB_ENV
echo "CPATH=/opt/rocm/include:${CPATH:-}" >> $GITHUB_ENV
echo "PKG_CONFIG_PATH=/opt/rocm/lib/pkgconfig:${PKG_CONFIG_PATH:-}" >> $GITHUB_ENV
echo "ROCm environment variables set successfully"
- name: Clone ROCmFPX
run: |
rocmfpx_version="${{ env.ROCMFPX_VERSION }}"
if [ "$rocmfpx_version" = "latest" ] || [ "$rocmfpx_version" = "main" ]; then
echo "Cloning main branch with shallow clone"
git clone --depth 1 --single-branch --branch main https://github.com/ciru-ai/ROCmFPX.git
else
echo "Cloning ROCmFPX version: $rocmfpx_version with shallow clone"
git clone --depth 1 --single-branch --branch "$rocmfpx_version" https://github.com/ciru-ai/ROCmFPX.git
fi
cd ROCmFPX
commit_hash=$(git rev-parse --short=7 HEAD)
echo "ROCMFPX_COMMIT_HASH=$commit_hash" >> $GITHUB_ENV
echo "ROCmFPX commit hash: $commit_hash"
echo "Current ROCmFPX commit:"
git log --oneline -1
- name: Build ROCmFPX + ROCm
run: |
# Map GPU targets
current_target="${{ matrix.gfx_target }}"
echo "Input target: $current_target"
if [ "$current_target" = "gfx110X" ]; then
mapped_target="gfx1100;gfx1101;gfx1102;gfx1103"
elif [ "$current_target" = "gfx103X" ]; then
mapped_target="gfx1030;gfx1031;gfx1032;gfx1034"
elif [ "$current_target" = "gfx1151" ]; then
mapped_target="gfx1151"
elif [ "$current_target" = "gfx1150" ]; then
mapped_target="gfx1150"
elif [ "$current_target" = "gfx120X" ]; then
mapped_target="gfx1200;gfx1201"
else
mapped_target="$current_target"
fi
echo "Mapped target: $mapped_target"
# Create build directory
cd ROCmFPX
mkdir build
cd build
# Configure the project
cmake .. -G Ninja \
-DCMAKE_C_COMPILER=/opt/rocm/llvm/bin/clang \
-DCMAKE_CXX_COMPILER=/opt/rocm/llvm/bin/clang++ \
-DCMAKE_CXX_FLAGS="-I/opt/rocm/include" \
-DCMAKE_CROSSCOMPILING=ON \
-DCMAKE_BUILD_TYPE=Release \
-DGPU_TARGETS="$mapped_target" \
-DBUILD_SHARED_LIBS=ON \
-DLLAMA_BUILD_TESTS=OFF \
-DGGML_HIP=ON \
-DGGML_HIP_FORCE_MMQ=ON \
-DGGML_OPENMP=OFF \
-DGGML_CUDA_FORCE_CUBLAS=OFF \
-DGGML_RPC=ON \
-DGGML_HIP_ROCWMMA_FATTN=OFF \
-DLLAMA_BUILD_BORINGSSL=ON \
-DGGML_NATIVE=OFF \
-DGGML_STATIC=OFF \
-DCMAKE_SYSTEM_NAME=Linux
# Build the project
cmake --build . -j $(nproc)
- name: Copy ROCm core libs to build directory
run: |
build_bin_path="ROCmFPX/build/bin"
# Copy rocblas/library folder
rocblas_lib_path="/opt/rocm/lib/rocblas/library"
if [ -d "$rocblas_lib_path" ]; then
echo "Copying rocblas/library folder and all contents..."
dest_rocblas_path="$build_bin_path/rocblas/library"
mkdir -p "$(dirname "$dest_rocblas_path")"
cp -r "$rocblas_lib_path" "$(dirname "$dest_rocblas_path")/"
echo "Copied rocblas/library"
fi
# Copy hipblaslt/library folder
hipblaslt_lib_path="/opt/rocm/lib/hipblaslt/library"
if [ -d "$hipblaslt_lib_path" ]; then
echo "Copying hipblaslt/library folder and all contents..."
dest_hipblaslt_path="$build_bin_path/hipblaslt/library"
mkdir -p "$(dirname "$dest_hipblaslt_path")"
cp -r "$hipblaslt_lib_path" "$(dirname "$dest_hipblaslt_path")/"
echo "Copied hipblaslt/library"
fi
echo "Copying required ROCm libraries to build directory..."
cp -v /opt/rocm/lib/libhipblas.so* "$build_bin_path/" 2>/dev/null || echo "libhipblas.so* not found"
cp -v /opt/rocm/lib/librocblas.so* "$build_bin_path/" 2>/dev/null || echo "librocblas.so* not found"
cp -v /opt/rocm/lib/libamdhip64.so* "$build_bin_path/" 2>/dev/null || echo "libamdhip64.so* not found"
cp -v /opt/rocm/lib/librocsolver.so* "$build_bin_path/" 2>/dev/null || echo "librocsolver.so* not found"
cp -v /opt/rocm/lib/libroctx64.so* "$build_bin_path/" 2>/dev/null || echo "libroctx64.so* not found"
cp -v /opt/rocm/lib/libhipblaslt.so* "$build_bin_path/" 2>/dev/null || echo "libhipblaslt.so* not found"
cp -v /opt/rocm/lib/rocm_sysdeps/lib/librocm_sysdeps_liblzma.so* "$build_bin_path/" 2>/dev/null || echo "librocm_sysdeps_liblzma.so* not found"
cp -v /opt/rocm/lib/librocprofiler-register.so* "$build_bin_path/" 2>/dev/null || echo "librocprofiler-register.so* not found"
cp -v /opt/rocm/lib/libamd_comgr.so* "$build_bin_path/" 2>/dev/null || echo "libamd_comgr.so* not found"
cp -v /opt/rocm/lib/libamd_comgr_loader.so* "$build_bin_path/" 2>/dev/null || echo "libamd_comgr_loader.so* not found"
cp -v /opt/rocm/lib/libhsa-runtime64.so* "$build_bin_path/" 2>/dev/null || echo "libhsa-runtime64.so* not found"
cp -v /opt/rocm/lib/rocm_sysdeps/lib/librocm_sysdeps_numa.so* "$build_bin_path/" 2>/dev/null || echo "librocm_sysdeps_numa.so* not found"
cp -v /opt/rocm/lib/librocroller.so* "$build_bin_path/" 2>/dev/null || echo "librocroller.so* not found"
cp -v /opt/rocm/lib/liborigami.so* "$build_bin_path/" 2>/dev/null || echo "liborigami.so* not found"
cp -v /opt/rocm/lib/librocm_kpack.so* "$build_bin_path/" 2>/dev/null || echo "librocm_kpack.so* not found"
cp -v /opt/rocm/lib/rocm_sysdeps/lib/librocm_sysdeps_z.so* "$build_bin_path/" 2>/dev/null || echo "librocm_sysdeps_z.so* not found"
cp -v /opt/rocm/lib/rocm_sysdeps/lib/librocm_sysdeps_zstd.so* "$build_bin_path/" 2>/dev/null || echo "librocm_sysdeps_zstd.so* not found"
cp -v /opt/rocm/lib/llvm/lib/libLLVM.so* "$build_bin_path/" 2>/dev/null || echo "libLLVM.so* not found"
cp -v /opt/rocm/lib/llvm/lib/libclang-cpp.so* "$build_bin_path/" 2>/dev/null || echo "libclang-cpp.so* not found"
cp -v /opt/rocm/lib/rocm_sysdeps/lib/librocm_sysdeps_elf.so* "$build_bin_path/" 2>/dev/null || echo "librocm_sysdeps_elf.so* not found"
cp -v /opt/rocm/lib/rocm_sysdeps/lib/librocm_sysdeps_drm.so* "$build_bin_path/" 2>/dev/null || echo "librocm_sysdeps_drm.so* not found"
cp -v /opt/rocm/lib/rocm_sysdeps/lib/librocm_sysdeps_drm_amdgpu.so* "$build_bin_path/" 2>/dev/null || echo "librocm_sysdeps_drm_amdgpu.so* not found"
cp -v /opt/rocm/lib/rocm_sysdeps/lib/librocm_sysdeps_bz2.so* "$build_bin_path/" 2>/dev/null || echo "librocm_sysdeps_bz2.so* not found"
echo "Finished copying required ROCm libraries"
- name: Set RPATH for portable distribution
run: |
cd ROCmFPX/build/bin
for file in *.so* llama-*; do
[ -f "$file" ] && [ ! -L "$file" ] && patchelf --set-rpath '$ORIGIN' "$file" 2>/dev/null || true
done
- name: List build artifacts (including ROCm files)
run: |
cd ROCmFPX/build/bin
echo "Final build artifacts:"
ls -la
- name: Upload build artifacts
id: upload-artifacts
uses: actions/upload-artifact@v4
with:
name: rocmfpx-ubuntu-rocm-${{ matrix.gfx_target }}-x64
path: ROCmFPX/build/bin/
retention-days: 30
- name: Set job outputs
id: set-outputs
run: |
echo "Setting job outputs..."
echo "Current target: ${{ matrix.gfx_target }}"
echo "DETECTED_ROCM_VERSION: ${DETECTED_ROCM_VERSION}"
echo "ROCM_VERSION: ${{ env.ROCM_VERSION }}"
echo "ROCMFPX_COMMIT_HASH: ${ROCMFPX_COMMIT_HASH}"
rocm_version="${DETECTED_ROCM_VERSION:-${{ env.ROCM_VERSION }}}"
echo "rocm_version=$rocm_version" >> $GITHUB_OUTPUT
echo "rocmfpx_commit_hash=${ROCMFPX_COMMIT_HASH}" >> $GITHUB_OUTPUT
echo "Final rocm_version: $rocm_version"
echo "Final rocmfpx_commit_hash: ${ROCMFPX_COMMIT_HASH}"
- name: Create release summary
run: |
cat > "build-summary-ubuntu-${{ matrix.gfx_target }}.md" << 'EOF'
# ROCmFPX + ROCm Build Summary (Ubuntu - ${{ matrix.gfx_target }})
## Build Configuration
- **GPU Target**: ${{ matrix.gfx_target }}
- **ROCm Version**: ${{ env.DETECTED_ROCM_VERSION || env.ROCM_VERSION }}
- **ROCmFPX Commit Hash**: ${{ env.ROCMFPX_COMMIT_HASH }}
- **Build Type**: Release
- **Platform**: Ubuntu
## Build Artifacts
The compiled binaries are available in the build artifacts.
EOF
- name: Upload build summary
id: upload-summary
uses: actions/upload-artifact@v4
with:
name: build-summary-ubuntu-${{ matrix.gfx_target }}
path: build-summary-ubuntu-${{ matrix.gfx_target }}.md
retention-days: 30
- name: Clean up build artifacts and temporary files
if: always()
run: |
echo "Starting cleanup process..."
if [ -f "rocm.tar.gz" ]; then
rm -f rocm.tar.gz
fi
if [ -d "/opt/rocm" ]; then
sudo rm -rf /opt/rocm
fi
if [ -d "ROCmFPX" ]; then
rm -rf ROCmFPX
fi
if [ -f "build-summary-ubuntu-${{ matrix.gfx_target }}.md" ]; then
rm -f "build-summary-ubuntu-${{ matrix.gfx_target }}.md"
fi
echo "Cleanup completed successfully"
test-stx-halo:
runs-on: ${{ matrix.runner }}
needs: [prepare-matrix, build-windows, build-ubuntu]
if: |
(needs.build-windows.result == 'success' || needs.build-ubuntu.result == 'success') &&
contains(github.event.inputs.gfx_target || 'gfx1151,gfx1150,gfx120X,gfx110X', 'gfx1151')
strategy:
matrix:
include:
- os: Windows
gfx_target: gfx1151
artifact_prefix: windows
runner: ["stx-halo", "Windows"]
- os: Linux
gfx_target: gfx1151
artifact_prefix: ubuntu
runner: ["stx-halo", "Linux"]
fail-fast: false
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Test ROCmFPX build
uses: ./.github/actions/test-rocmfpx-build
with:
os_type: ${{ matrix.os }}
gfx_target: ${{ matrix.gfx_target }}
artifact_name: rocmfpx-${{ matrix.artifact_prefix }}-rocm-${{ matrix.gfx_target }}-x64
test-stx:
runs-on: ${{ matrix.runner }}
needs: [prepare-matrix, build-windows, build-ubuntu]
if: |
(needs.build-windows.result == 'success' || needs.build-ubuntu.result == 'success') &&
contains(github.event.inputs.gfx_target || 'gfx1151,gfx1150,gfx120X,gfx110X', 'gfx1150')
strategy:
matrix:
include:
- os: Windows
gfx_target: gfx1150
artifact_prefix: windows
runner: ["stx", "Windows"]
fail-fast: false
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Test ROCmFPX build
uses: ./.github/actions/test-rocmfpx-build
with:
os_type: ${{ matrix.os }}
gfx_target: ${{ matrix.gfx_target }}
artifact_name: rocmfpx-${{ matrix.artifact_prefix }}-rocm-${{ matrix.gfx_target }}-x64
create-release:
needs: [prepare-matrix, build-windows, build-ubuntu, test-stx-halo, test-stx]
runs-on: ubuntu-22.04
permissions:
contents: write
pull-requests: write
if: |
always() &&
(needs.build-windows.result == 'success' || needs.build-windows.result == 'skipped') &&
(needs.build-ubuntu.result == 'success' || needs.build-ubuntu.result == 'skipped') &&
(needs.build-windows.result == 'success' || needs.build-ubuntu.result == 'success') &&
(needs.test-stx-halo.result == 'success' || needs.test-stx-halo.result == 'skipped') &&
(needs.test-stx.result == 'success' || needs.test-stx.result == 'skipped') &&
github.event_name != 'pull_request' &&
(github.event_name == 'workflow_dispatch' &&
(github.event.inputs.create_release == 'true' || github.event.inputs.create_release == null) ||
github.event_name == 'schedule')
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download all build artifacts
uses: actions/download-artifact@v4
with:
path: ./all-artifacts
- name: Generate release tag
id: generate-tag
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
existing_tags=$(gh release list --limit 1000 --json tagName --jq '.[].tagName' | grep -E '^b[0-9]{4}$' | sort -V || echo "")
if [ -z "$existing_tags" ]; then
next_number=1000
echo "No existing sequential release tags found, starting with b1000"
else
highest_tag=$(echo "$existing_tags" | tail -n 1)
highest_number=$(echo "$highest_tag" | sed 's/^b//')
next_number=$((highest_number + 1))
echo "Highest existing tag: $highest_tag (number: $highest_number)"
echo "Next number will be: $next_number"
fi
TAG=$(printf "b%04d" $next_number)
echo "tag=${TAG}" >> $GITHUB_OUTPUT
echo "Generated release tag: ${TAG}"
- name: Check if tag already exists
id: check-tag
run: |
TAG="${{ steps.generate-tag.outputs.tag }}"
if git ls-remote --tags origin "$TAG" | grep -q "$TAG"; then
echo "Tag $TAG already exists, skipping release creation"
echo "tag_exists=true" >> $GITHUB_OUTPUT
else
echo "Tag $TAG does not exist, proceeding with release creation"
echo "tag_exists=false" >> $GITHUB_OUTPUT
fi
- name: Create archives for all target artifacts
if: steps.check-tag.outputs.tag_exists == 'false'
run: |
targets="${{ env.GFX_TARGETS }}"
operating_systems="${{ env.OPERATING_SYSTEMS }}"
TAG="${{ steps.generate-tag.outputs.tag }}"
echo "Processing targets: $targets"
echo "Processing operating systems: $operating_systems"
echo "Using release tag: $TAG"
IFS=',' read -ra TARGET_ARRAY <<< "$targets"
IFS=',' read -ra OS_ARRAY <<< "$operating_systems"
for os in "${OS_ARRAY[@]}"; do
os=$(echo "$os" | xargs)
for target in "${TARGET_ARRAY[@]}"; do
target=$(echo "$target" | xargs)
echo "Processing OS: $os, target: $target"
artifact_name="rocmfpx-${os}-rocm-${target}-x64"
artifact_dir="./all-artifacts/${artifact_name}"
final_archive_name="rocmfpx-${TAG}-${os}-rocm-${target}-x64"
if [ -d "$artifact_dir" ]; then
echo "Creating archive: ${final_archive_name}.zip"
cd "$artifact_dir"
zip -r "../../${final_archive_name}.zip" *
cd ../../
else
echo "Warning: Artifact directory not found: $artifact_dir"
ls -la ./all-artifacts/
fi
done
done
echo "Created archives:"
ls -la *.zip
- name: Create Release
if: steps.check-tag.outputs.tag_exists == 'false'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
TAG="${{ steps.generate-tag.outputs.tag }}"
ROCM_VERSION="${{ needs.build-windows.outputs.rocm_version || needs.build-ubuntu.outputs.rocm_version }}"
ROCMFPX_COMMIT_HASH="${{ needs.build-windows.outputs.rocmfpx_commit_hash || needs.build-ubuntu.outputs.rocmfpx_commit_hash }}"
targets="${{ env.GFX_TARGETS }}"
operating_systems="${{ env.OPERATING_SYSTEMS }}"
echo "Creating release with tag: $TAG"
echo "GPU Targets: $targets"
echo "Operating Systems: $operating_systems"
echo "ROCm Version: $ROCM_VERSION"
echo "ROCmFPX Commit: $ROCMFPX_COMMIT_HASH"
upload_files=""
IFS=',' read -ra TARGET_ARRAY <<< "$targets"
IFS=',' read -ra OS_ARRAY <<< "$operating_systems"
for os in "${OS_ARRAY[@]}"; do
os=$(echo "$os" | xargs)
for target in "${TARGET_ARRAY[@]}"; do
target=$(echo "$target" | xargs)
final_archive_name="rocmfpx-${TAG}-${os}-rocm-${target}-x64"
if [ -f "${final_archive_name}.zip" ]; then
upload_files="${upload_files} ${final_archive_name}.zip"
fi
done
done
echo "Files to upload: $upload_files"
gh release create "$TAG" \
--title "ROCmFPX $TAG" \
--notes "**Build Number**: $TAG
**Operating System(s)**: $operating_systems
**GPU Target(s)**: $targets
**ROCm Version**: $ROCM_VERSION
**ROCmFPX Commit Hash**: $ROCMFPX_COMMIT_HASH
**Build Date**: $(date -u '+%Y-%m-%d %H:%M:%S UTC')
This release includes compiled ROCmFPX (Ciru) binaries with ROCm support for multiple GPU targets and operating systems, with all essential ROCm runtime libraries included. Supports ROCmFP2, ROCmFP3, ROCmFP4, ROCmFP6, ROCmFP7 (DualView), and ROCmFP8 formats." \
$upload_files
+322
View File
@@ -0,0 +1,322 @@
name: Test ROCmFPX + ROCm
on:
workflow_dispatch:
inputs:
operating_systems:
description: 'Operating systems to test on (comma-separated: windows,ubuntu)'
required: false
default: 'windows,ubuntu'
gfx_target:
description: 'AMD GPU targets (comma-separated)'
required: false
default: 'gfx1151'
release_tag:
description: 'Release tag to test (e.g., b1000) or "latest" for the most recent release'
required: false
default: 'latest'
env:
OPERATING_SYSTEMS: ${{ github.event.inputs.operating_systems || 'windows,ubuntu' }}
GFX_TARGETS: ${{ github.event.inputs.gfx_target || 'gfx1151' }}
RELEASE_TAG: ${{ github.event.inputs.release_tag || 'latest' }}
jobs:
prepare-matrix:
runs-on: ubuntu-22.04
outputs:
windows_matrix: ${{ steps.set-matrix.outputs.windows_matrix }}
ubuntu_matrix: ${{ steps.set-matrix.outputs.ubuntu_matrix }}
should_test_windows: ${{ steps.set-matrix.outputs.should_test_windows }}
should_test_ubuntu: ${{ steps.set-matrix.outputs.should_test_ubuntu }}
latest_release_tag: ${{ steps.get-release.outputs.latest_release_tag }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Get release tag
id: get-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
release_input="${{ env.RELEASE_TAG }}"
if [ "$release_input" = "latest" ]; then
release_tag=$(curl -s -H "Authorization: token $GITHUB_TOKEN" \
"https://api.github.com/repos/${{ github.repository }}/releases/latest" \
| jq -r '.tag_name')
echo "Using latest release: $release_tag"
else
release_tag="$release_input"
echo "Using specified release: $release_tag"
response_code=$(curl -s -o /dev/null -w "%{http_code}" \
-H "Authorization: token $GITHUB_TOKEN" \
"https://api.github.com/repos/${{ github.repository }}/releases/tags/$release_tag")
if [ "$response_code" != "200" ]; then
echo "Error: Release '$release_tag' does not exist (HTTP $response_code)"
exit 1
fi
fi
echo "latest_release_tag=$release_tag" >> $GITHUB_OUTPUT
echo "Final release tag: $release_tag"
- name: Set matrix
id: set-matrix
run: |
targets="${{ env.GFX_TARGETS }}"
operating_systems="${{ env.OPERATING_SYSTEMS }}"
echo "Input targets: $targets"
echo "Input operating systems: $operating_systems"
matrix_targets=$(echo "$targets" \
| tr ',' '\n' \
| sed 's/^ *//;s/ *$//' \
| sed 's/^"//;s/"$//' \
| jq -R . \
| jq -s '{gfx_target: .}' \
| jq -c)
should_test_windows="false"
should_test_ubuntu="false"
if [[ "$operating_systems" == *"windows"* ]]; then
should_test_windows="true"
echo "windows_matrix=$matrix_targets" >> $GITHUB_OUTPUT
fi
if [[ "$operating_systems" == *"ubuntu"* ]]; then
should_test_ubuntu="true"
echo "ubuntu_matrix=$matrix_targets" >> $GITHUB_OUTPUT
fi
echo "should_test_windows=$should_test_windows" >> $GITHUB_OUTPUT
echo "should_test_ubuntu=$should_test_ubuntu" >> $GITHUB_OUTPUT
echo "Windows test: $should_test_windows"
echo "Ubuntu test: $should_test_ubuntu"
echo "Generated matrix: $matrix_targets"
test-windows:
runs-on: [stx-halo, Windows]
needs: prepare-matrix
if: needs.prepare-matrix.outputs.should_test_windows == 'true'
strategy:
matrix: ${{fromJson(needs.prepare-matrix.outputs.windows_matrix)}}
fail-fast: false
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download release artifacts
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
$releaseTag = "${{ needs.prepare-matrix.outputs.latest_release_tag }}"
$target = "${{ matrix.gfx_target }}"
$assetName = "rocmfpx-${releaseTag}-windows-rocm-${target}-x64.zip"
$repo = "${{ github.repository }}"
Write-Host "Downloading release asset: $assetName"
Write-Host "From release: $releaseTag"
$headers = @{ "Authorization" = "token $env:GITHUB_TOKEN" }
$releaseUrl = "https://api.github.com/repos/$repo/releases/tags/$releaseTag"
try {
$release = Invoke-RestMethod -Uri $releaseUrl -Headers $headers
$asset = $release.assets | Where-Object { $_.name -eq $assetName }
if (-not $asset) {
Write-Error "Asset '$assetName' not found in release '$releaseTag'"
exit 1
}
Write-Host "Found asset: $($asset.name) (Size: $($asset.size) bytes)"
Invoke-WebRequest -Uri $asset.browser_download_url -OutFile $assetName -Headers $headers
Write-Host "Downloaded $assetName successfully"
}
catch {
Write-Error "Failed to download release asset: $_"
exit 1
}
Write-Host "Extracting $assetName..."
Expand-Archive -Path $assetName -DestinationPath "rocmfpx-binaries" -Force
Write-Host "Contents of rocmfpx-binaries:"
Get-ChildItem -Recurse "rocmfpx-binaries" | Format-Table Name, Length
- name: Download test model
run: |
$modelUrl = "https://huggingface.co/unsloth/Qwen3-0.6B-GGUF/resolve/main/Qwen3-0.6B-Q4_0.gguf?download=true"
$modelPath = "Qwen3-0.6B-Q4_0.gguf"
Write-Host "Downloading test model from: $modelUrl"
curl.exe -L -o $modelPath $modelUrl
if (Test-Path $modelPath) {
$fileSize = (Get-Item $modelPath).Length
Write-Host "Model downloaded successfully. Size: $fileSize bytes"
} else {
Write-Error "Failed to download model"
exit 1
}
- name: Run llama-cli test
run: |
$llamaCliPath = "rocmfpx-binaries\llama-cli.exe"
$modelPath = "Qwen3-0.6B-Q4_0.gguf"
if (-not (Test-Path $llamaCliPath)) {
Write-Error "llama-cli.exe not found at: $llamaCliPath"
Get-ChildItem -Recurse "rocmfpx-binaries"
exit 1
}
Write-Host "Running llama-cli test..."
try {
$process = Start-Process -FilePath $llamaCliPath -ArgumentList @("-m", "`"$modelPath`"", "-ngl", "99", "-p", "`"I believe the meaning of life is`"", "-st") -NoNewWindow -Wait -PassThru -RedirectStandardOutput "stdout.txt" -RedirectStandardError "stderr.txt"
$process.WaitForExit()
$stdout = Get-Content "stdout.txt" -Raw -ErrorAction SilentlyContinue
$stderr = Get-Content "stderr.txt" -Raw -ErrorAction SilentlyContinue
$output = $stdout + $stderr
Remove-Item "stdout.txt" -ErrorAction SilentlyContinue
Remove-Item "stderr.txt" -ErrorAction SilentlyContinue
}
catch {
Write-Error "Failed to run llama-cli: $_"
exit 1
}
Write-Host "=== LLAMA-CLI OUTPUT ==="
Write-Host $output
Write-Host "=== END OUTPUT ==="
if ($process.ExitCode -ne 0) {
Write-Host "❌ llama-cli exited with error code: $($process.ExitCode)"
exit 1
}
$foundGpuOffload = $output -match "offloaded 29/29 layers to GPU"
$foundThinkTag = $output -match "</think>"
Write-Host "=== TEST RESULTS ==="
Write-Host "Expected 'offloaded 29/29 layers to GPU': $(if ($foundGpuOffload) { 'FOUND' } else { 'NOT FOUND' })"
Write-Host "Expected '</think>' tag: $(if ($foundThinkTag) { 'FOUND' } else { 'NOT FOUND' })"
if ($foundGpuOffload -and $foundThinkTag) {
Write-Host "✅ Test PASSED"
} else {
Write-Host "❌ Test FAILED - Missing expected outputs"
exit 1
}
test-ubuntu:
runs-on: [stx-halo, Linux]
needs: prepare-matrix
if: needs.prepare-matrix.outputs.should_test_ubuntu == 'true'
strategy:
matrix: ${{fromJson(needs.prepare-matrix.outputs.ubuntu_matrix)}}
fail-fast: false
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install jq
run: |
if ! command -v jq &> /dev/null; then
echo "Installing jq..."
mkdir -p ~/bin
curl -L -o ~/bin/jq https://github.com/jqlang/jq/releases/download/jq-1.7.1/jq-linux-amd64
chmod +x ~/bin/jq
export PATH="$HOME/bin:$PATH"
echo "PATH=$HOME/bin:$PATH" >> $GITHUB_ENV
fi
- name: Download release artifacts
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
release_tag="${{ needs.prepare-matrix.outputs.latest_release_tag }}"
target="${{ matrix.gfx_target }}"
asset_name="rocmfpx-${release_tag}-ubuntu-rocm-${target}-x64.zip"
repo="${{ github.repository }}"
echo "Downloading release asset: $asset_name"
echo "From release: $release_tag"
release_url="https://api.github.com/repos/$repo/releases/tags/$release_tag"
release_data=$(curl -s -H "Authorization: token $GITHUB_TOKEN" "$release_url")
download_url=$(echo "$release_data" | jq -r ".assets[] | select(.name == \"$asset_name\") | .browser_download_url")
if [ "$download_url" = "null" ] || [ -z "$download_url" ]; then
echo "Error: Asset '$asset_name' not found in release '$release_tag'"
exit 1
fi
curl -L -H "Authorization: token $GITHUB_TOKEN" -o "$asset_name" "$download_url"
unzip -q "$asset_name" -d rocmfpx-binaries
echo "Contents of rocmfpx-binaries:"
find rocmfpx-binaries -type f -exec ls -la {} \;
- name: Download test model
run: |
model_url="https://huggingface.co/unsloth/Qwen3-0.6B-GGUF/resolve/main/Qwen3-0.6B-Q4_0.gguf?download=true"
model_path="Qwen3-0.6B-Q4_0.gguf"
curl -L -o "$model_path" "$model_url"
- name: Set up library path
run: |
echo "LD_LIBRARY_PATH=$(pwd)/rocmfpx-binaries:$LD_LIBRARY_PATH" >> $GITHUB_ENV
- name: Run llama-cli test
run: |
llama_cli_path="./rocmfpx-binaries/llama-cli"
model_path="Qwen3-0.6B-Q4_0.gguf"
chmod +x "$llama_cli_path"
if [ ! -f "$llama_cli_path" ]; then
echo "llama-cli not found at: $llama_cli_path"
exit 1
fi
echo "Running llama-cli test..."
output=$("$llama_cli_path" -m "$model_path" -ngl 99 -p "I believe the meaning of life is" -st 2>&1)
echo "=== LLAMA-CLI OUTPUT ==="
echo "$output"
echo "=== END OUTPUT ==="
if echo "$output" | grep -q "offloaded 29/29 layers to GPU"; then
found_gpu_offload=true
else
found_gpu_offload=false
fi
if echo "$output" | grep -q "</think>"; then
found_think_tag=true
else
found_think_tag=false
fi
echo "=== TEST RESULTS ==="
echo "Expected 'offloaded 29/29 layers to GPU': $(if [ "$found_gpu_offload" = true ]; then echo 'FOUND'; else echo 'NOT FOUND'; fi)"
echo "Expected '</think>' tag: $(if [ "$found_think_tag" = true ]; then echo 'FOUND'; else echo 'NOT FOUND'; fi)"
if [ "$found_gpu_offload" = true ] && [ "$found_think_tag" = true ]; then
echo "✅ Test PASSED"
else
echo "❌ Test FAILED - Missing expected outputs"
exit 1
fi
+39
View File
@@ -0,0 +1,39 @@
# Build directories and artifacts
build/
build-*/
*.zip
*.tar.gz
*.tar
rocm.tar.gz
all-artifacts/
rocmfpx-binaries/
llama-binaries/
llama.cpp/
ROCmFPX/
llamacpp-rocm/
# Model files and weights
*.gguf
*.bin
# Log files and temporary command outputs
*.log
stdout.txt
stderr.txt
vs_path.txt
build-summary-*.md
# Python
__pycache__/
*.py[cod]
*$py.class
.venv/
venv/
# Environment / database
mitm_mcp_traffic.db
.env
# OS-specific
.DS_Store
Thumbs.db
+21
View File
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2025-2026 Heretek AI
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
+135
View File
@@ -0,0 +1,135 @@
# ROCmFPX Automated Builds
<a href="https://github.com/Heretek-AI/ROCmFPX-BUILDER/releases/latest" title="Download the latest release">
<img src="https://img.shields.io/github/v/release/Heretek-AI/ROCmFPX-BUILDER?logo=github&logoColor=white" alt="GitHub release (latest by date)" />
</a>
<a href="https://github.com/Heretek-AI/ROCmFPX-BUILDER/releases/latest" title="View latest release date">
<img src="https://img.shields.io/github/release-date/Heretek-AI/ROCmFPX-BUILDER?logo=github&logoColor=white" alt="Latest release date" />
</a>
<a href="LICENSE" title="View license">
<img src="https://img.shields.io/github/license/Heretek-AI/ROCmFPX-BUILDER?logo=opensourceinitiative&logoColor=white&cacheBust=1" alt="License" />
</a>
<a href="https://github.com/ROCm/ROCm" title="Powered by ROCm 7.0">
<img src="https://img.shields.io/badge/ROCm-7.0-blue?logo=amd&logoColor=white" alt="ROCm 7.0" />
</a>
<a href="https://github.com/ciru-ai/ROCmFPX" title="Powered by ROCmFPX">
<img src="https://img.shields.io/badge/⚡Powered%20by-ROCmFPX-blue?logo=amd&logoColor=white" alt="Powered by ROCmFPX" />
</a>
<a href="#-supported-devices" title="Platform support">
<img src="https://img.shields.io/badge/OS-Windows%20%7C%20Ubuntu-0078D6?logo=windows&logoColor=white" alt="Platform: Windows | Ubuntu" />
</a>
<a href="#-supported-devices" title="GPU targets">
<img src="https://img.shields.io/badge/GPU-gfx1151%20%7C%20gfx1150%20%7C%20gfx120X%20%7C%20gfx110X%20%7C%20gfx103X%20%7C%20gfx90a%20%7C%20gfx908-00B04F?logo=amd&logoColor=white" alt="GPU Targets" />
</a>
---
We provide automated nightly and on-demand builds of [**ROCmFPX** (`ciru-ai/ROCmFPX`)](https://github.com/ciru-ai/ROCmFPX) with **AMD ROCm™ 7** acceleration based on [TheRock](https://github.com/ROCm/TheRock).
ROCmFPX is Ciru's inference framework featuring specialized low-bit quantization formats (**ROCmFP2**, **ROCmFP3**, **ROCmFP4**, **ROCmFP6**, **ROCmFP7 DualView**, **ROCmFP8**), specialized HIP kernels, PromptForge serving runtimes, and fast inference on AMD hardware.
> [!IMPORTANT]
> **All builds include ROCm™ 7 built-in** — complete runtime libraries and BLAS kernels are bundled directly into the archives. No separate ROCm™ driver/SDK installation is required on Windows or Linux!
---
## 🎯 Supported Devices
This build pipeline targets all major AMD GPU architectures:
- **gfx1151** (STX Halo APU) — Ryzen AI MAX+ Pro 395, Radeon 8060S
- **gfx1150** (STX Point APU) — Ryzen AI 300 Series
- **gfx120X** (RDNA4 GPUs) — AMD Radeon RX 9070 XT / 9070 / 9060 XT / 9060
- **gfx110X** (RDNA3 GPUs) — AMD Radeon dGPUs: PRO W7900/W7800/W7700/W7600, RX 7900 XTX/XT/GRE, RX 7800 XT, RX 7700 XT, RX 7600 XT; iGPUs: Radeon 780M/760M/740M
- **gfx103X** (RDNA2 GPUs) — AMD Radeon dGPUs: RX 6950 XT, 6900 XT, 6800 XT/6800, RX 6700 XT, RX 6600 XT, RX 6500 XT
- **gfx90a** (CDNA2 GPUs) — AMD Instinct MI210 / MI250
- **gfx908** (CDNA1 GPUs) — AMD Instinct MI100
---
## 🚀 Automated Builds
Our automated GitHub Actions workflow creates nightly builds for:
- **Windows** and **Ubuntu Linux**
- **7 GPU Target Families**: `gfx1151`, `gfx1150`, `gfx120X`, `gfx110X`, `gfx103X`, `gfx90a`, `gfx908`
- **ROCm™ 7 Built-in**: Full runtime libraries and BLAS support
| GPU Target | Target Architecture | Ubuntu (x64) | Windows (x64) |
|---|---|---|---|
| **gfx1151** | Strix Halo (Ryzen AI MAX+ 395) | [![Download Ubuntu gfx1151](https://img.shields.io/badge/Download-Ubuntu%20gfx1151-blue)](https://github.com/Heretek-AI/ROCmFPX-BUILDER/releases/latest) | [![Download Windows gfx1151](https://img.shields.io/badge/Download-Windows%20gfx1151-green)](https://github.com/Heretek-AI/ROCmFPX-BUILDER/releases/latest) |
| **gfx1150** | Strix Point (Ryzen AI 300) | [![Download Ubuntu gfx1150](https://img.shields.io/badge/Download-Ubuntu%20gfx1150-blue)](https://github.com/Heretek-AI/ROCmFPX-BUILDER/releases/latest) | [![Download Windows gfx1150](https://img.shields.io/badge/Download-Windows%20gfx1150-green)](https://github.com/Heretek-AI/ROCmFPX-BUILDER/releases/latest) |
| **gfx120X** | RDNA4 (RX 9070 XT / 9070) | [![Download Ubuntu gfx120X](https://img.shields.io/badge/Download-Ubuntu%20gfx120X-blue)](https://github.com/Heretek-AI/ROCmFPX-BUILDER/releases/latest) | [![Download Windows gfx120X](https://img.shields.io/badge/Download-Windows%20gfx120X-green)](https://github.com/Heretek-AI/ROCmFPX-BUILDER/releases/latest) |
| **gfx110X** | RDNA3 (RX 7900 XTX / 7800 XT / 780M) | [![Download Ubuntu gfx110X](https://img.shields.io/badge/Download-Ubuntu%20gfx110X-blue)](https://github.com/Heretek-AI/ROCmFPX-BUILDER/releases/latest) | [![Download Windows gfx110X](https://img.shields.io/badge/Download-Windows%20gfx110X-green)](https://github.com/Heretek-AI/ROCmFPX-BUILDER/releases/latest) |
| **gfx103X** | RDNA2 (RX 6800 XT / 6700 XT) | [![Download Ubuntu gfx103X](https://img.shields.io/badge/Download-Ubuntu%20gfx103X-blue)](https://github.com/Heretek-AI/ROCmFPX-BUILDER/releases/latest) | [![Download Windows gfx103X](https://img.shields.io/badge/Download-Windows%20gfx103X-green)](https://github.com/Heretek-AI/ROCmFPX-BUILDER/releases/latest) |
| **gfx90a** | CDNA2 (Instinct MI210 / MI250) | [![Download Ubuntu gfx90a](https://img.shields.io/badge/Download-Ubuntu%20gfx90a-blue)](https://github.com/Heretek-AI/ROCmFPX-BUILDER/releases/latest) | [![Download Windows gfx90a](https://img.shields.io/badge/Download-Windows%20gfx90a-green)](https://github.com/Heretek-AI/ROCmFPX-BUILDER/releases/latest) |
| **gfx908** | CDNA1 (Instinct MI100) | [![Download Ubuntu gfx908](https://img.shields.io/badge/Download-Ubuntu%20gfx908-blue)](https://github.com/Heretek-AI/ROCmFPX-BUILDER/releases/latest) | [![Download Windows gfx908](https://img.shields.io/badge/Download-Windows%20gfx908-green)](https://github.com/Heretek-AI/ROCmFPX-BUILDER/releases/latest) |
> **Linux (gfx1150/gfx1151 APU):** If you experience OOM despite free VRAM, add `ttm.pages_limit=12582912` (48 GB) to your kernel command line (e.g. GRUB), run `sudo update-grub`, then reboot.
---
## ⚡ ROCmFPX Format Family
ROCmFPX provides native support for ultra-low-bit formats:
| Format | Block BPW | Description |
|---|---:|---|
| **`Q2_0_ROCMFPX`** | 2.50 | S40 2.5-bpw format with frozen codebook and HIP MMQ/MMVQ paths |
| **`Q3_0_ROCMFPX`** | 3.50 | 3.5-bpw format with scale search and packed execution paths |
| **`Q4_0_ROCMFP4` / `FAST`** | 4.50 / 4.25 | Original ROCmFP4 formats with HIP regression coverage |
| **`Q6_0_ROCMFPX`** | 6.50 | Strix quality recipes and tuned GPU execution |
| **`Q7_0_ROCMFPX`** | 7.50 | Signed Q7 format and stored representation for DualView |
| **`Q8_0_ROCMFPX`** | 8.25 | Reference and cross-backend precision baseline |
Quantize any model using `llama-quantize`:
```bash
llama-quantize source-model-BF16.gguf output-model-FP7.gguf Q7_0_ROCMFPX
```
---
## 🧪 Quick Smoketest
1. **Download** the archive for your OS and GPU target from [Releases](https://github.com/Heretek-AI/ROCmFPX-BUILDER/releases/latest).
2. **Extract** the zip file to your preferred folder.
3. **Run `llama-server` or `llama-cli`**:
```bash
# General GGUF Model
llama-server -m YOUR_MODEL.gguf -ngl 99
```
### Running DualView Models (e.g. Ornith 35B):
```bash
export GGML_ROCM_GFX1151_Q7_Q8_VIEW=no-output
export GGML_HIP_ENABLE_UNIFIED_MEMORY=1
./llama-server \
-m Ornith1.0-35b-CIRU-DUALVIEW-FPX7+Q8-MTP.gguf \
--host 127.0.0.1 --port 8080 \
-dev ROCm0 -sm none -ngl 999 -fa on \
-n 16384 -c 131072 -b 2048 -ub 512 -t 16 -tb 16 \
-ctk f16 -ctv f16 --parallel 1 --metrics --mmap --no-repack
```
---
## 🏗️ Repository Structure
- **`.github/workflows/build-rocmfpx.yml`**: Matrix CI/CD pipeline for building, bundling, and releasing Windows & Ubuntu binaries.
- **`.github/workflows/test-rocmfpx.yml`**: CI/CD testing workflow for smoke testing release artifacts.
- **`.github/actions/test-rocmfpx-build/`**: Composite action for executing automated validation tests.
- **`utils/gather_required_libs.py`**: Dependency resolution utility to discover and copy missing shared libraries.
- **`docs/manual_instructions.md`**: Step-by-step instructions for building locally on Windows and Ubuntu.
---
## 📋 Manual Build Instructions
For building locally from source, see **[docs/manual_instructions.md](docs/manual_instructions.md)**.
---
## 📄 License
This builder repository is licensed under the [MIT License](LICENSE).
ROCmFPX is developed by Ciru ([ciru-ai/ROCmFPX](https://github.com/ciru-ai/ROCmFPX)) under the MIT License.
+216
View File
@@ -0,0 +1,216 @@
# 🔧 Manual Build Instructions for ROCmFPX + ROCm
> **⚠️ Important Notice**
>
> These manual build instructions are provided for reference purposes and local development.
>
> For the most reliable and automated build process, please refer to our [GitHub Actions build workflow](../.github/workflows/build-rocmfpx.yml).
---
## Operating Systems:
- [🪟 Windows Build Instructions](#windows-build-instructions)
- [🐧 Ubuntu Build Instructions](#ubuntu-build-instructions)
- [🎯 GPU Target Reference](#gpu-target-reference)
- [🧪 Testing & ROCmFPX Flags](#testing--rocmfpx-flags)
---
## 🪟 Windows Build Instructions
### Part 1: Install Required Software
Using Chocolatey (or install manually):
```powershell
choco install visualstudio2022buildtools -y --params "--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --add Microsoft.VisualStudio.Component.VC.CMake.Project --add Microsoft.VisualStudio.Component.VC.ATL --add Microsoft.VisualStudio.Component.Windows11SDK.22621"
choco install cmake --version=3.31.0 -y
choco install ninja -y
choco install strawberryperl -y
choco install git -y
```
### Part 2: Obtain ROCm Nightly (TheRock)
1. Check the multi-arch tarball index at [https://rocm.nightlies.amd.com/tarball-multi-arch/](https://rocm.nightlies.amd.com/tarball-multi-arch/)
2. Download the Windows tarball for your target architecture (e.g., `therock-dist-windows-gfx1151-<version>.tar.gz` or `therock-dist-windows-gfx110X-all-<version>.tar.gz`).
3. Extract the contents to `C:\opt\rocm`:
```powershell
New-Item -ItemType Directory -Force -Path "C:\opt\rocm"
tar -xzf <filename>.tar.gz -C C:\opt\rocm --strip-components=1
```
### Part 3: Clone ROCmFPX
```powershell
git clone --depth 1 https://github.com/ciru-ai/ROCmFPX.git
cd ROCmFPX
```
### Part 4: Configure and Build
Open `x64 Native Tools Command Prompt for VS 2022`:
```cmd
set HIP_PATH=C:\opt\rocm
set HIP_PLATFORM=amd
set PATH=%HIP_PATH%\lib\llvm\bin;%HIP_PATH%\bin;%PATH%
mkdir build
cd build
cmake .. -G Ninja ^
-DCMAKE_C_COMPILER="C:\opt\rocm\lib\llvm\bin\clang.exe" ^
-DCMAKE_CXX_COMPILER="C:\opt\rocm\lib\llvm\bin\clang++.exe" ^
-DCMAKE_CXX_FLAGS="-IC:\opt\rocm\include" ^
-DCMAKE_CROSSCOMPILING=ON ^
-DCMAKE_BUILD_TYPE=Release ^
-DGPU_TARGETS="gfx1151" ^
-DBUILD_SHARED_LIBS=ON ^
-DLLAMA_BUILD_TESTS=OFF ^
-DGGML_HIP=ON ^
-DGGML_HIP_FORCE_MMQ=ON ^
-DGGML_OPENMP=OFF ^
-DGGML_CUDA_FORCE_CUBLAS=OFF ^
-DGGML_RPC=ON ^
-DGGML_HIP_ROCWMMA_FATTN=OFF ^
-DLLAMA_BUILD_BORINGSSL=ON ^
-DGGML_NATIVE=OFF ^
-DGGML_STATIC=OFF ^
-DCMAKE_SYSTEM_NAME=Windows
cmake --build . -j %NUMBER_OF_PROCESSORS%
```
### Part 5: Copy ROCm Runtime DLLs
Copy the required DLLs and kernel library folders into `build\bin`:
```powershell
$bin = "bin"
$rocmBin = "C:\opt\rocm\bin"
Copy-Item "$rocmBin\amdhip64_*.dll" $bin
Copy-Item "$rocmBin\rocm_kpack.dll" $bin
Copy-Item "$rocmBin\amd_comgr*.dll" $bin
Copy-Item "$rocmBin\libhipblas.dll" $bin
Copy-Item "$rocmBin\rocblas.dll" $bin
Copy-Item "$rocmBin\rocsolver.dll" $bin
Copy-Item "$rocmBin\hipblaslt.dll" $bin
Copy-Item "$rocmBin\origami.dll" $bin
Copy-Item "$rocmBin\rocblas\library" "$bin\rocblas\library" -Recurse -Force
Copy-Item "$rocmBin\hipblaslt\library" "$bin\hipblaslt\library" -Recurse -Force
```
---
## 🐧 Ubuntu Build Instructions
### Part 1: Install Required Software
```bash
sudo apt update
sudo apt install -y build-essential cmake ninja-build git curl patchelf
```
### Part 2: Obtain ROCm Nightly (TheRock)
Download and extract ROCm directly to `/opt/rocm`:
```bash
# E.g. For Strix Halo (gfx1151) or RDNA3 (gfx110X-all)
sudo mkdir -p /opt/rocm
curl -sL "https://rocm.nightlies.amd.com/tarball-multi-arch/therock-dist-linux-gfx1151-latest.tar.gz" | sudo tar --use-compress-program=gzip -xf - -C /opt/rocm --strip-components=1
```
Set up ROCm environment variables:
```bash
export HIP_PATH=/opt/rocm
export ROCM_PATH=/opt/rocm
export HIP_PLATFORM=amd
export HIP_CLANG_PATH=/opt/rocm/llvm/bin
export HIP_INCLUDE_PATH=/opt/rocm/include
export HIP_LIB_PATH=/opt/rocm/lib
export PATH=/opt/rocm/bin:/opt/rocm/llvm/bin:$PATH
export LD_LIBRARY_PATH=/opt/rocm/lib:/opt/rocm/lib64:/opt/rocm/llvm/lib:${LD_LIBRARY_PATH:-}
```
### Part 3: Clone ROCmFPX
```bash
git clone --depth 1 https://github.com/ciru-ai/ROCmFPX.git
cd ROCmFPX
```
### Part 4: Configure and Build
```bash
mkdir build
cd build
cmake .. -G Ninja \
-DCMAKE_C_COMPILER=/opt/rocm/llvm/bin/clang \
-DCMAKE_CXX_COMPILER=/opt/rocm/llvm/bin/clang++ \
-DCMAKE_CXX_FLAGS="-I/opt/rocm/include" \
-DCMAKE_CROSSCOMPILING=ON \
-DCMAKE_BUILD_TYPE=Release \
-DGPU_TARGETS="gfx1151" \
-DBUILD_SHARED_LIBS=ON \
-DLLAMA_BUILD_TESTS=OFF \
-DGGML_HIP=ON \
-DGGML_HIP_FORCE_MMQ=ON \
-DGGML_OPENMP=OFF \
-DGGML_CUDA_FORCE_CUBLAS=OFF \
-DGGML_RPC=ON \
-DGGML_HIP_ROCWMMA_FATTN=OFF \
-DLLAMA_BUILD_BORINGSSL=ON \
-DGGML_NATIVE=OFF \
-DGGML_STATIC=OFF \
-DCMAKE_SYSTEM_NAME=Linux
cmake --build . -j $(nproc)
```
### Part 5: Copy ROCm Runtime Libraries & Patch RPATH
```bash
cd bin
# Copy BLAS kernel folders
mkdir -p rocblas hipblaslt
cp -r /opt/rocm/lib/rocblas/library rocblas/
cp -r /opt/rocm/lib/hipblaslt/library hipblaslt/
# Copy required runtime libraries
cp -v /opt/rocm/lib/lib*.so* . 2>/dev/null || true
cp -v /opt/rocm/lib/rocm_sysdeps/lib/lib*.so* . 2>/dev/null || true
cp -v /opt/rocm/lib/llvm/lib/lib*.so* . 2>/dev/null || true
# Set portable RPATH ($ORIGIN)
for file in *.so* llama-*; do
[ -f "$file" ] && [ ! -L "$file" ] && patchelf --set-rpath '$ORIGIN' "$file" 2>/dev/null || true
done
```
---
## 🎯 GPU Target Reference
Set `-DGPU_TARGETS` based on your hardware:
| Architecture Family | GPU Target Parameter | Target Devices |
|---|---|---|
| **Strix Halo (APU)** | `-DGPU_TARGETS="gfx1151"` | Ryzen AI MAX+ Pro 395, Radeon 8060S |
| **Strix Point (APU)** | `-DGPU_TARGETS="gfx1150"` | Ryzen AI 300 Series |
| **RDNA4** | `-DGPU_TARGETS="gfx1200;gfx1201"` | Radeon RX 9070 XT / 9070 / 9060 XT |
| **RDNA3** | `-DGPU_TARGETS="gfx1100;gfx1101;gfx1102;gfx1103"` | RX 7900 XTX/XT/GRE, 7800 XT, 7700 XT, 7600 XT, Radeon 780M |
| **RDNA2** | `-DGPU_TARGETS="gfx1030;gfx1031;gfx1032;gfx1034"` | RX 6950 XT, 6900 XT, 6800 XT, 6700 XT, 6600 XT |
| **CDNA2** | `-DGPU_TARGETS="gfx90a"` | AMD Instinct MI210 / MI250 |
| **CDNA1** | `-DGPU_TARGETS="gfx908"` | AMD Instinct MI100 |
---
## 🧪 Testing & ROCmFPX Flags
### Quantization with ROCmFPX formats:
```bash
./llama-quantize source-BF16.gguf output-FP2.gguf Q2_0_ROCMFPX
./llama-quantize source-BF16.gguf output-FP3.gguf Q3_0_ROCMFPX
./llama-quantize source-BF16.gguf output-FP4.gguf Q4_0_ROCMFP4
./llama-quantize source-BF16.gguf output-FP6.gguf Q6_0_ROCMFPX
./llama-quantize source-BF16.gguf output-FP7.gguf Q7_0_ROCMFPX
./llama-quantize source-BF16.gguf output-FP8.gguf Q8_0_ROCMFPX
```
### Running DualView Models:
```bash
export GGML_ROCM_GFX1151_Q7_Q8_VIEW=no-output
export GGML_HIP_ENABLE_UNIFIED_MEMORY=1
./llama-server -m Ornith1.0-35b-CIRU-DUALVIEW-FPX7+Q8-MTP.gguf -ngl 99
```
+64
View File
@@ -0,0 +1,64 @@
#!/usr/bin/env python3
import subprocess
import os
import shutil
import argparse
def find_lib_in_rocm(libname, rocm_dir):
# Simple linear search for libname inside rocm_dir
for root, _, files in os.walk(rocm_dir):
if libname in files:
return os.path.join(root, libname)
# Exit if the library is not found in rocm_dir
raise RuntimeError(f"Could not find {libname} in {rocm_dir}")
def main():
parser = argparse.ArgumentParser(
description="Gather required libraries for ROCmFPX binaries (llama-server, llama-cli, etc.)"
)
parser.add_argument(
"--rocm-dir",
default="/opt/rocm",
help="Path to ROCm installation directory (default: /opt/rocm)",
)
parser.add_argument(
"--dest-dir",
default=os.path.expanduser("~/ROCmFPX/build/bin"),
help="Destination directory for libraries and binaries (default: ~/ROCmFPX/build/bin)",
)
parser.add_argument(
"--binary",
default="llama-server",
help="Target binary name to check dependencies for (default: llama-server)",
)
args = parser.parse_args()
rocm_dir = args.rocm_dir
dest_dir = args.dest_dir
binary = os.path.join(dest_dir, args.binary)
if not os.path.exists(binary):
raise FileNotFoundError(f"Binary not found: {binary}")
# Create the destination directory and run the binary
os.makedirs(dest_dir, exist_ok=True)
result = subprocess.run([binary], capture_output=True, text=True)
print(f"Error Found: {result.stderr}")
# Copy the missing libraries to the destination directory
while "error while loading shared libraries" in result.stderr:
so_file = result.stderr.split("shared libraries: ")[1].split(": ")[0]
so_file_path = find_lib_in_rocm(so_file, rocm_dir)
shutil.copy2(so_file_path, dest_dir)
print(f"Copied {so_file_path} -> {dest_dir}")
result = subprocess.run([binary], capture_output=True, text=True)
print(f"Error Found: {result.stderr}")
if __name__ == "__main__":
main()