From 6dda8c4c233ce49e9d0d1be18c513ef103e60737 Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Sat, 14 Mar 2026 06:33:15 +0000 Subject: [PATCH] studio: revert combined targets, keep separate builds Restore separate cmake --build calls for llama-server and llama-quantize on both setup.sh and setup.ps1. The combined approach made llama-quantize failure fatal, but it was originally best-effort (|| true on Linux, [WARN] on Windows). The timing savings from combining was only ~2.7s, not worth the semantic change. The Ninja + arch detection speedups are preserved (55s vs 1m 37s). --- studio/setup.ps1 | 18 ++++++++++++++---- studio/setup.sh | 8 ++++++-- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/studio/setup.ps1 b/studio/setup.ps1 index 7a15a893af..bf0ba754f0 100644 --- a/studio/setup.ps1 +++ b/studio/setup.ps1 @@ -898,20 +898,30 @@ if (Test-Path $LlamaServerBin) { } } - # -- Step C: Build llama-server + llama-quantize -- + # -- Step C: Build llama-server -- $NumCpu = [Environment]::ProcessorCount if ($NumCpu -lt 1) { $NumCpu = 4 } if ($BuildOk) { Write-Host "" - Write-Host "--- cmake build (llama-server + llama-quantize) ---" -ForegroundColor Cyan + Write-Host "--- cmake build (llama-server) ---" -ForegroundColor Cyan Write-Host " Parallel jobs: $NumCpu" -ForegroundColor Gray Write-Host "" - cmake --build $BuildDir --config Release --target llama-server llama-quantize -j $NumCpu + cmake --build $BuildDir --config Release --target llama-server -j $NumCpu if ($LASTEXITCODE -ne 0) { $BuildOk = $false - $FailedStep = "cmake build (llama-server + llama-quantize)" + $FailedStep = "cmake build (llama-server)" + } + } + + # -- Step D: Build llama-quantize (optional, best-effort) -- + if ($BuildOk) { + Write-Host "" + Write-Host "--- cmake build (llama-quantize) ---" -ForegroundColor Cyan + cmake --build $BuildDir --config Release --target llama-quantize -j $NumCpu + if ($LASTEXITCODE -ne 0) { + Write-Host " [WARN] llama-quantize build failed (GGUF export may be unavailable)" -ForegroundColor Yellow } } diff --git a/studio/setup.sh b/studio/setup.sh index 88576776c2..5cabb461c8 100755 --- a/studio/setup.sh +++ b/studio/setup.sh @@ -331,8 +331,12 @@ rm -rf "$LLAMA_CPP_DIR" fi if [ "$BUILD_OK" = true ]; then - # Build both targets in one invocation for better parallelism - run_quiet "build llama-server + llama-quantize" cmake --build "$LLAMA_CPP_DIR/build" --config Release --target llama-server llama-quantize -j"$NCPU" || BUILD_OK=false + run_quiet "build llama-server" cmake --build "$LLAMA_CPP_DIR/build" --config Release --target llama-server -j"$NCPU" || BUILD_OK=false + fi + + # Also build llama-quantize (needed by unsloth-zoo's GGUF export pipeline) + if [ "$BUILD_OK" = true ]; then + run_quiet "build llama-quantize" cmake --build "$LLAMA_CPP_DIR/build" --config Release --target llama-quantize -j"$NCPU" || true # Symlink to llama.cpp root — check_llama_cpp() looks for the binary there QUANTIZE_BIN="$LLAMA_CPP_DIR/build/bin/llama-quantize" if [ -f "$QUANTIZE_BIN" ]; then