Initial ForgeLM import

This commit is contained in:
Evandro Fonseca Junior committed 2026-03-29 19:10:57 -03:00
commit a392b9dc60
4296 files changed
+1212675

No files matched your search

+27
View File
@@ -0,0 +1,27 @@
# scripts/build-dev.ps1
# Development build of llama.cpp for Windows (Debug, CUDA RTX 3070).
$ErrorActionPreference = "Stop"
$root = Split-Path $PSScriptRoot -Parent
$vendor = Join-Path $root "vendor\llama.cpp"
$buildDir = Join-Path $vendor "build-dev"
if (-not (Test-Path (Join-Path $vendor "CMakeLists.txt"))) {
Write-Error "vendor/llama.cpp not initialised. Run: git submodule update --init --recursive"
exit 1
}
Write-Host "[INFO] Configuring llama.cpp (dev, CUDA enabled)..."
cmake -S $vendor -B $buildDir `
-DCMAKE_BUILD_TYPE=Debug `
-DBUILD_SHARED_LIBS=ON `
-DGGML_CUDA=ON `
"-DCMAKE_CUDA_ARCHITECTURES=86" `
-DLLAMA_BUILD_TESTS=OFF `
-DLLAMA_BUILD_EXAMPLES=OFF
Write-Host "[INFO] Building..."
cmake --build $buildDir --parallel
Write-Host "[OK] Dev build complete: $buildDir"
+31
View File
@@ -0,0 +1,31 @@
#!/usr/bin/env bash
# scripts/build-dev.sh
# Development build of llama.cpp (Debug, no optimization).
# Run once after `git submodule update --init --recursive`.
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
ROOT="$SCRIPT_DIR/.."
VENDOR="$ROOT/vendor/llama.cpp"
BUILD_DIR="$VENDOR/build-dev"
if [ ! -f "$VENDOR/CMakeLists.txt" ]; then
echo "[ERROR] vendor/llama.cpp not initialised."
echo " Run: git submodule update --init --recursive"
exit 1
fi
echo "[INFO] Configuring llama.cpp (dev, CUDA enabled)..."
cmake -S "$VENDOR" -B "$BUILD_DIR" \
-DCMAKE_BUILD_TYPE=Debug \
-DBUILD_SHARED_LIBS=ON \
-DGGML_CUDA=ON \
-DCMAKE_CUDA_ARCHITECTURES=86 \
-DLLAMA_BUILD_TESTS=OFF \
-DLLAMA_BUILD_EXAMPLES=OFF
echo "[INFO] Building (dev)..."
cmake --build "$BUILD_DIR" --parallel "$(nproc 2>/dev/null || echo 4)"
echo "[OK] Dev build complete: $BUILD_DIR"
+27
View File
@@ -0,0 +1,27 @@
# scripts/build-prod.ps1
# Production build of llama.cpp for Windows (Release, CUDA RTX 3070 cc86).
$ErrorActionPreference = "Stop"
$root = Split-Path $PSScriptRoot -Parent
$vendor = Join-Path $root "vendor\llama.cpp"
$buildDir = Join-Path $vendor "build-prod"
if (-not (Test-Path (Join-Path $vendor "CMakeLists.txt"))) {
Write-Error "vendor/llama.cpp not initialised. Run: git submodule update --init --recursive"
exit 1
}
Write-Host "[INFO] Configuring llama.cpp (prod, CUDA cc86)..."
cmake -S $vendor -B $buildDir `
-DCMAKE_BUILD_TYPE=Release `
-DBUILD_SHARED_LIBS=ON `
-DGGML_CUDA=ON `
"-DCMAKE_CUDA_ARCHITECTURES=86" `
-DLLAMA_BUILD_TESTS=OFF `
-DLLAMA_BUILD_EXAMPLES=OFF
Write-Host "[INFO] Building (Release)..."
cmake --build $buildDir --config Release --parallel
Write-Host "[OK] Prod build complete: $buildDir"
+33
View File
@@ -0,0 +1,33 @@
#!/usr/bin/env bash
# scripts/build-prod.sh
# Production build of llama.cpp (Release + LTO, RTX 3070 target).
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
ROOT="$SCRIPT_DIR/.."
VENDOR="$ROOT/vendor/llama.cpp"
BUILD_DIR="$VENDOR/build-prod"
if [ ! -f "$VENDOR/CMakeLists.txt" ]; then
echo "[ERROR] vendor/llama.cpp not initialised."
echo " Run: git submodule update --init --recursive"
exit 1
fi
echo "[INFO] Configuring llama.cpp (prod, CUDA cc86)..."
cmake -S "$VENDOR" -B "$BUILD_DIR" \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=ON \
-DGGML_CUDA=ON \
-DCMAKE_CUDA_ARCHITECTURES=86 \
-DLLAMA_BUILD_TESTS=OFF \
-DLLAMA_BUILD_EXAMPLES=OFF \
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON
echo "[INFO] Building (prod)..."
cmake --build "$BUILD_DIR" \
--parallel "$(nproc 2>/dev/null || echo 4)" \
--config Release
echo "[OK] Prod build complete: $BUILD_DIR"