Commit Graph

15 Commits

Author SHA1 Message Date
Alpamys 0be8a03a8a v0.12.0: ORPO/SimPO/IPO trainers + DoRA/LoRA+/GaLore
v0.11.0 — Alignment methods:
- ORPO (task: orpo) — wraps trl.ORPOTrainer, no reference model needed
- SimPO (task: simpo) — wraps trl.CPOTrainer with loss_type='simpo'
- IPO (task: ipo) — wraps trl.DPOTrainer with loss_type='ipo'
- Templates: soup init --template orpo/simpo/ipo
- Init wizard, train routing, sweep shortcuts for all three

v0.12.0 — Advanced PEFT:
- DoRA (use_dora: true) — weight-decomposed LoRA in all 9 trainers
- LoRA+ (loraplus_lr_ratio) — different lr for A and B matrices
- GaLore (use_galore: true) — memory-efficient full-param training
- GaLore validation: incompatible with quantization and unsloth

Security:
- experiment_name path traversal validation (no / \ : null bytes)
- GaLore optim_args type enforcement before string interpolation

Tests: 877 passed (was 746), 42 test files, 56.98% coverage
2026-03-25 18:12:36 +05:00
Alpamys 7bee22052b v0.10.10: Security hardening — Web UI auth, CORS, SSRF, path traversal protection
Security fixes across all HTTP surfaces:
- Web UI: Bearer token auth on mutating endpoints, CORS restricted to served origin,
  path traversal protection on /api/data/inspect, config validated before training,
  removed user-controlled config_path from API
- Serve/vLLM: max_tokens capped at 16384, generic error messages (no stack traces)
- Generate: SSRF protection (--api-base blocks non-HTTPS for remote URLs),
  --api-key deprecated in favor of OPENAI_API_KEY env var
- Export: llama.cpp pinned to tag b5270 (supply-chain safety)
- Push: --token deprecated in favor of HF_TOKEN env var
- Rewards: warning before executing custom .py reward files
- Tests: all 40 UI tests updated with auth headers, 666 tests pass

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 12:14:10 +05:00
Alpamys 4eedfe140b v0.10.3: Fix PPO trl >=0.28 API compat, improve GRPO CPU error message
- PPO: detect trl API via inspect — args= (>=0.28) vs config= (<0.28)
- PPO: split train into _train_builtin (trl >=0.28) and _train_manual
- GRPO: update error message to mention GRPO/PPO CPU limitation
- 2 new tests for PPO API detection (639 total, all passing)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 14:27:39 +05:00
Alpamys a86b809a04 v0.10.3: Fix PPO/GRPO CPU support from manual test report
- PPO: add use_cpu=True to PPOConfig when running on CPU
- GRPO: add CPU warning + use_cpu flag via inspect (trl bug workaround)
- Add use_cpu error pattern to friendly error map
- 7 new tests for CPU fixes (637 total, all passing)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 14:17:31 +05:00
Alpamys 4fca7a9664 v0.10.2: Fix remaining Windows/CPU issues from re-test
- ASCII progress bar in display.py (replace Unicode blocks with #/-)
- Catch UnicodeEncodeError from plotext in data stats (Windows fallback)
- Auto-disable 4bit/8bit quantization on CPU (bitsandbytes doesn't support it)
- Friendly error messages for CPU tensor/dtype/bf16/torchvision issues
- Fix diff.py: torch_dtype= -> dtype= (deprecation warning)
- Add torchvision version compatibility check to soup doctor

7 new tests (631 total), ruff clean.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 13:20:27 +05:00
Alpamys 428c0f09a4 v0.10.1: Fix 6 bugs from manual testing report
- BUG-001: Replace Unicode arrows/dashes with ASCII in all console output
  to fix UnicodeEncodeError on Windows cp1252 (~10 commands affected)
- BUG-002: PPO trainer uses inspect.signature to detect trl parameter names
  (ppo_epochs vs num_ppo_epochs) for trl 0.28.0 compatibility
- BUG-003: Add get_compute_dtype() - uses float32 on CPU, bfloat16/float16
  on CUDA. Fixes dtype mismatch in reward model and all trainers
- BUG-004: Add warning when using quantization on CPU
- BUG-005: Fix dtype -> torch_dtype in diff.py model loading
- BUG-006: Pin wandb<0.18.0 to avoid trl import conflict, add runtime guard

13 new tests (624 total), ruff clean.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 12:31:37 +05:00
Alpamys f1d039f223 Fix CI: use Optional[] instead of str|None for Python 3.9 compat
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 21:35:00 +05:00
Alpamys 14f619cc00 Add vLLM backend for soup serve (Phase 9) — v0.8.0
- Add --backend vllm flag to soup serve for 2-4x better inference throughput
- Add --tensor-parallel and --gpu-memory flags for vLLM tuning
- Auto-detect vLLM and show hint when installed but not enabled
- New utils/vllm.py with engine creation, app factory, LoRA support
- Native token-by-token streaming via vLLM AsyncLLMEngine
- Add serve-fast extra: pip install 'soup-cli[serve-fast]'
- Add vllm detection to version --full
- 30 new tests (560 total), ruff clean

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 21:30:08 +05:00
Alpamys 5f77bc57da Add Quantization-Aware Training support (Phase 7) — v0.6.0
- Add `quantization_aware: true` config option (TrainingConfig)
- New `utils/qat.py` module: torchao Int8WeightOnlyConfig integration
  with `prepare_model_for_qat()`, `validate_qat_config()`, `is_qat_available()`
- QAT support in all trainers: SFT, DPO, GRPO (+ vision modality)
- Train command shows `+ QAT` in setup panel, validates QAT config
  (rejects unsloth backend, warns on 8bit)
- `pip install 'soup-cli[qat]'` optional dependency (torchao>=0.4.0)
- `torchao` added to `soup doctor` dependency checks
- 35 new tests (test_qat.py): config, validation, trainer integration,
  export compatibility, sweep, doctor
- Total: 490 tests across 37 files

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 20:35:35 +05:00
Alpamys 6de66fb28c Add Unsloth backend for 2-5x faster training (Phase 5) — v0.4.3
- Add `backend: unsloth` config option (default: transformers)
- Create utils/unsloth.py with FastLanguageModel integration
- Update SFT/DPO/GRPO trainers with _setup_unsloth() path
- Auto-detect unsloth and suggest enabling in `soup train`
- Add `fast` extra: pip install 'soup-cli[fast]'
- Add unsloth to `soup doctor` dependency check
- Add `backend` sweep shortcut
- 33 new tests (404 total), ruff clean

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 16:55:44 +05:00
Alpamys df21329a52 Add Phase 3.1: friendly errors, soup doctor, soup quickstart, UX polish (v0.3.1)
- Friendly error messages: wrap all commands in try/except, map known errors
  (CUDA OOM, missing deps, connection errors) to 2-3 line messages with fix hints
- Global --verbose flag for full tracebacks
- soup doctor: check system info, GPU, all dependency versions with fix suggestions
- soup quickstart: one-command demo (creates data + config + trains TinyLlama)
- Confirmation prompts before train/sweep (skip with --yes)
- 40 new tests (321 total), all passing

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 19:10:36 +05:00
Alpamys 87fd760847 Add Phase 3: serve, data generate, sweep, diff, DeepSpeed (v0.3.0)
- soup serve: FastAPI inference server with OpenAI-compatible API, SSE streaming
- soup data generate: synthetic data generation via OpenAI API or local models
- soup sweep: grid/random hyperparameter search with experiment tracker integration
- soup diff: side-by-side model comparison with metrics
- Multi-GPU/DeepSpeed: ZeRO Stage 2/3 configs, --deepspeed flag in train command
- 95 new tests (281 total), all passing
- Removed TESTING_GUIDE.md

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 17:14:08 +05:00
Alpamys 4010798e2b Fix PyTorch 2.7 compatibility: total_mem → total_memory (v0.2.1)
PyTorch 2.7+ renamed `get_device_properties().total_mem` to
`total_memory`. Fixed in gpu.py and callback.py.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 00:37:07 +05:00
Alpamys 7433029d19 Fix all ruff lint errors and failing test
- Fix 23 ruff errors: line too long, unused imports, ambiguous vars
- Fix validator: empty string is valid data, only count None as empty
- Remove unused imports in display.py and validator.py
- Rename ambiguous `l` vars to `part`, `entry`, `length`
- Break long lines in callback.py, display.py, sft.py, constants.py

All 20 tests passing, ruff clean.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 16:25:46 +05:00
Alpamys d6e932a1d3 Initial project setup: CLI skeleton + config + trainer + data pipeline
- Typer CLI: soup init, soup train, soup data inspect/validate
- Pydantic config schema with YAML loader and validation
- Data pipeline: JSONL/JSON/CSV/Parquet + HuggingFace datasets
- Format detection: Alpaca, ShareGPT, ChatML (auto-detect)
- SFT trainer wrapper over transformers + peft + trl
- QLoRA/LoRA support with auto batch size estimation
- GPU detection (CUDA/MPS/CPU) and memory calculation
- Rich live terminal dashboard for training monitoring
- Config templates: chat, code, medical
- Tests (pytest) + GitHub Actions CI
- MIT license

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 16:14:56 +05:00