-
Notifications
You must be signed in to change notification settings - Fork 370
Expand file tree
/
Copy path__init__.py
More file actions
42 lines (35 loc) · 1.19 KB
/
Copy path__init__.py
File metadata and controls
42 lines (35 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
"""
GRPO (Group Relative Policy Optimization) Trainer
A training framework for fine-tuning language models with reinforcement learning,
designed to work with the Atropos environment system.
Supports three training modes:
- Legacy: Checkpoint-based training with vLLM restarts
- Shared vLLM: Single-copy mode with CUDA IPC (no model duplication!)
- LoRA: Adapter-only training with hot-swap capability
- LoRA restart: Adapter training with periodic fast vLLM restarts
Usage:
# As CLI
python -m example_trainer.grpo --model-name Qwen/Qwen2.5-3B-Instruct --training-steps 100
# As library
from example_trainer import (
TrainingConfig,
train_legacy,
train_shared_vllm,
train_lora,
train_lora_restart,
)
config = TrainingConfig(model_name="Qwen/Qwen2.5-3B-Instruct", training_steps=100)
train_legacy(config)
"""
from .cli import config_from_args, parse_args
from .config import TrainingConfig
from .trainers import train_legacy, train_lora, train_lora_restart, train_shared_vllm
__all__ = [
"TrainingConfig",
"train_legacy",
"train_shared_vllm",
"train_lora",
"train_lora_restart",
"parse_args",
"config_from_args",
]