Files
ely-eye/scripts/run-prd-finetune.sh
ZacharyZhang-NY 922d01202f Run the same checks on Linux that the Windows scripts run
The product could only reach a GPU through one hard-coded route: `wsl.exe -d
Ubuntu`, a device named "RTX 4090", and launch scripts that existed only as
PowerShell. On this machine `WSL_DISTRO_NAME` is already set, so the local
shell is Linux and the wsl.exe hop was unnecessary; on any other Linux host
it is impossible. Every SGLang, vLLM and KTransformers profile was reported
"missing" here even with a working 4090.

profiles.py now asks the host what it is instead of assuming: `uses_wsl()`
is false inside WSL and only true when wsl.exe is actually on PATH,
`host_shell()` runs `bash -lc` directly or through `wsl.exe -d
settings.wsl_distro`, `gpu_available()` replaced `wsl_gpu_available()`, and
`launch_script()` picks the .sh twin on a Linux host and the .ps1 on a
Windows one. The schema field `wsl_gpu` became `gpu_available` because the
old name lied on Linux.

Training no longer fails on a card name. `cuda_bf16_training()` gates on
cuda_available plus bf16_supported, which the training environment already
records, so an RTX 5090 or a 4080 passes and a non-BF16 4090 still fails.

Fourteen .sh twins cover the six launch profiles plus install, verify,
serve, download and finetune; the six WSL-hopping .ps1 files read
ELY_EYE_WSL_DISTRO instead of Ubuntu. PowerShell parsing is not verified
here because no pwsh exists on this host.

ci.yml runs pytest, ruff, go build/vet/test/gofmt, the Vite build and a
docker build-plus-curl on every push. To make that lint gate mean anything,
the 17 pre-existing ruff findings across backend/src are cleared: 14
mechanical fixes plus three probe handlers that now name the failure
families they absorb (OSError, SubprocessError, ValueError) instead of
catching Exception.

Verification: pytest 239 passed; ruff check backend/src bench clean (17 at
HEAD); mypy on the 12 touched files 14 errors, identical at HEAD; pyright on
the same files 8 errors, identical at HEAD; bash -n clean on all 15 .sh.
2026-10-08 02:12:29 -04:00

36 lines
881 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
cd "$(dirname "$0")/.."
max_steps="${MAX_STEPS:-37}"
rank="${RANK:-16}"
alpha="${ALPHA:-32}"
max_length="${MAX_LENGTH:-8192}"
gradient_accumulation_steps="${GRADIENT_ACCUMULATION_STEPS:-4}"
cartridge_id="${CARTRIDGE_ID:-}"
dataset=.ely_eye/training/hme_prd_sft.jsonl
adapter=.ely_eye/adapters/hme_core_lora_qwen35_9b
.venv/bin/ely-eye build-prd-training-data \
--prd-path ./PRD.md \
--output-path "$dataset" \
--max-sections 48
args=(train-lora "$dataset" "$adapter"
--max-steps "$max_steps"
--kind hme_core_lora
--rank "$rank"
--alpha "$alpha"
--max-length "$max_length"
--gradient-accumulation-steps "$gradient_accumulation_steps")
if [ -n "$cartridge_id" ]; then
args+=(--cartridge-id "$cartridge_id")
fi
.venv/bin/ely-eye "${args[@]}"
echo "Adapter ready: $adapter"
echo "Use with: ELY_EYE_ADAPTER_DIR=$adapter"