evalstate
commited on
Commit
Β·
e8aa09f
1
Parent(s):
7093da7
trackio guide updates
Browse files
trl/references/trackio_guide.md
CHANGED
|
@@ -1,11 +1,12 @@
|
|
| 1 |
# Trackio Integration for TRL Training
|
| 2 |
|
| 3 |
-
**Trackio** is
|
| 4 |
|
| 5 |
-
β οΈ **IMPORTANT**:
|
| 6 |
-
-
|
| 7 |
-
-
|
| 8 |
-
- Without a Space, metrics are
|
|
|
|
| 9 |
|
| 10 |
## Setting Up Trackio for Jobs
|
| 11 |
|
|
@@ -35,7 +36,7 @@ import trackio
|
|
| 35 |
|
| 36 |
trackio.init(
|
| 37 |
project="my-training",
|
| 38 |
-
space_id="username/
|
| 39 |
config={
|
| 40 |
"model": "Qwen/Qwen2.5-0.5B",
|
| 41 |
"dataset": "trl-lib/Capybara",
|
|
@@ -78,23 +79,11 @@ Trackio automatically logs:
|
|
| 78 |
## Viewing the Dashboard
|
| 79 |
|
| 80 |
After starting training:
|
| 81 |
-
1. Navigate to the Space: `https://huggingface.co/spaces/username/
|
| 82 |
2. The Gradio dashboard shows all tracked experiments
|
| 83 |
3. Filter by project, compare runs, view charts with smoothing
|
| 84 |
|
| 85 |
-
## Alternative: TensorBoard (Simpler for Jobs)
|
| 86 |
-
|
| 87 |
-
For simpler setup without needing a Space:
|
| 88 |
-
```python
|
| 89 |
-
SFTConfig(
|
| 90 |
-
report_to="tensorboard", # Logs saved with model to Hub
|
| 91 |
-
)
|
| 92 |
-
```
|
| 93 |
-
|
| 94 |
-
TensorBoard logs are automatically saved with the model and viewable via TensorBoard locally after downloading.
|
| 95 |
-
|
| 96 |
## Recommendation
|
| 97 |
|
| 98 |
- **Trackio**: Best for real-time monitoring during long training runs
|
| 99 |
-
- **TensorBoard**: Best for post-training analysis, simpler setup
|
| 100 |
- **Weights & Biases**: Best for team collaboration, requires account
|
|
|
|
| 1 |
# Trackio Integration for TRL Training
|
| 2 |
|
| 3 |
+
**Trackio** is an experiment tracking library that provides real-time metrics visualization for remote training on Hugging Face Jobs infrastructure.
|
| 4 |
|
| 5 |
+
β οΈ **IMPORTANT**: For Jobs training (remote cloud GPUs):
|
| 6 |
+
- Training happens on ephemeral cloud runners (not your local machine)
|
| 7 |
+
- Trackio syncs metrics to a Hugging Face Space for real-time monitoring
|
| 8 |
+
- Without a Space, metrics are lost when the job completes
|
| 9 |
+
- The Space dashboard persists your training metrics permanently
|
| 10 |
|
| 11 |
## Setting Up Trackio for Jobs
|
| 12 |
|
|
|
|
| 36 |
|
| 37 |
trackio.init(
|
| 38 |
project="my-training",
|
| 39 |
+
space_id="username/trackio", # CRITICAL for Jobs! Replace 'username' with your HF username
|
| 40 |
config={
|
| 41 |
"model": "Qwen/Qwen2.5-0.5B",
|
| 42 |
"dataset": "trl-lib/Capybara",
|
|
|
|
| 79 |
## Viewing the Dashboard
|
| 80 |
|
| 81 |
After starting training:
|
| 82 |
+
1. Navigate to the Space: `https://huggingface.co/spaces/username/trackio`
|
| 83 |
2. The Gradio dashboard shows all tracked experiments
|
| 84 |
3. Filter by project, compare runs, view charts with smoothing
|
| 85 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 86 |
## Recommendation
|
| 87 |
|
| 88 |
- **Trackio**: Best for real-time monitoring during long training runs
|
|
|
|
| 89 |
- **Weights & Biases**: Best for team collaboration, requires account
|
trl/references/training_patterns.md
CHANGED
|
@@ -39,7 +39,7 @@ from datasets import load_dataset
|
|
| 39 |
from trl import DPOTrainer, DPOConfig
|
| 40 |
import trackio
|
| 41 |
|
| 42 |
-
trackio.init(project="dpo-training", space_id="username/
|
| 43 |
|
| 44 |
dataset = load_dataset("trl-lib/ultrafeedback_binarized", split="train")
|
| 45 |
|
|
|
|
| 39 |
from trl import DPOTrainer, DPOConfig
|
| 40 |
import trackio
|
| 41 |
|
| 42 |
+
trackio.init(project="dpo-training", space_id="username/trackio")
|
| 43 |
|
| 44 |
dataset = load_dataset("trl-lib/ultrafeedback_binarized", split="train")
|
| 45 |
|
trl/scripts/train_dpo_example.py
CHANGED
|
@@ -32,7 +32,7 @@ from trl import DPOTrainer, DPOConfig
|
|
| 32 |
# Initialize Trackio for real-time monitoring
|
| 33 |
trackio.init(
|
| 34 |
project="qwen-dpo-alignment",
|
| 35 |
-
space_id="username/
|
| 36 |
config={
|
| 37 |
"model": "Qwen/Qwen2.5-0.5B-Instruct",
|
| 38 |
"dataset": "trl-lib/ultrafeedback_binarized",
|
|
@@ -110,4 +110,4 @@ trainer.push_to_hub()
|
|
| 110 |
trackio.finish()
|
| 111 |
|
| 112 |
print("β
Complete! Model at: https://huggingface.co/username/qwen-dpo-aligned")
|
| 113 |
-
print("π View metrics at: https://huggingface.co/spaces/username/
|
|
|
|
| 32 |
# Initialize Trackio for real-time monitoring
|
| 33 |
trackio.init(
|
| 34 |
project="qwen-dpo-alignment",
|
| 35 |
+
space_id="username/trackio",
|
| 36 |
config={
|
| 37 |
"model": "Qwen/Qwen2.5-0.5B-Instruct",
|
| 38 |
"dataset": "trl-lib/ultrafeedback_binarized",
|
|
|
|
| 110 |
trackio.finish()
|
| 111 |
|
| 112 |
print("β
Complete! Model at: https://huggingface.co/username/qwen-dpo-aligned")
|
| 113 |
+
print("π View metrics at: https://huggingface.co/spaces/username/trackio")
|
trl/scripts/train_grpo_example.py
CHANGED
|
@@ -36,7 +36,7 @@ from trl import GRPOTrainer, GRPOConfig
|
|
| 36 |
# Initialize Trackio for real-time monitoring
|
| 37 |
trackio.init(
|
| 38 |
project="qwen-grpo-math",
|
| 39 |
-
space_id="username/
|
| 40 |
config={
|
| 41 |
"model": "Qwen/Qwen2.5-0.5B-Instruct",
|
| 42 |
"dataset": "trl-lib/math_shepherd",
|
|
@@ -94,4 +94,4 @@ trainer.push_to_hub()
|
|
| 94 |
trackio.finish()
|
| 95 |
|
| 96 |
print("β
Complete! Model at: https://huggingface.co/username/qwen-grpo-math")
|
| 97 |
-
print("π View metrics at: https://huggingface.co/spaces/username/
|
|
|
|
| 36 |
# Initialize Trackio for real-time monitoring
|
| 37 |
trackio.init(
|
| 38 |
project="qwen-grpo-math",
|
| 39 |
+
space_id="username/trackio",
|
| 40 |
config={
|
| 41 |
"model": "Qwen/Qwen2.5-0.5B-Instruct",
|
| 42 |
"dataset": "trl-lib/math_shepherd",
|
|
|
|
| 94 |
trackio.finish()
|
| 95 |
|
| 96 |
print("β
Complete! Model at: https://huggingface.co/username/qwen-grpo-math")
|
| 97 |
+
print("π View metrics at: https://huggingface.co/spaces/username/trackio")
|
trl/scripts/train_sft_example.py
CHANGED
|
@@ -39,7 +39,7 @@ from trl import SFTTrainer, SFTConfig
|
|
| 39 |
# Initialize Trackio for real-time monitoring
|
| 40 |
trackio.init(
|
| 41 |
project="qwen-capybara-sft",
|
| 42 |
-
space_id="username/
|
| 43 |
config={
|
| 44 |
"model": "Qwen/Qwen2.5-0.5B",
|
| 45 |
"dataset": "trl-lib/Capybara",
|
|
@@ -124,4 +124,4 @@ trainer.push_to_hub()
|
|
| 124 |
trackio.finish()
|
| 125 |
|
| 126 |
print("β
Complete! Model at: https://huggingface.co/username/qwen-capybara-sft")
|
| 127 |
-
print("π View metrics at: https://huggingface.co/spaces/username/
|
|
|
|
| 39 |
# Initialize Trackio for real-time monitoring
|
| 40 |
trackio.init(
|
| 41 |
project="qwen-capybara-sft",
|
| 42 |
+
space_id="username/trackio", # Creates Space if it doesn't exist
|
| 43 |
config={
|
| 44 |
"model": "Qwen/Qwen2.5-0.5B",
|
| 45 |
"dataset": "trl-lib/Capybara",
|
|
|
|
| 124 |
trackio.finish()
|
| 125 |
|
| 126 |
print("β
Complete! Model at: https://huggingface.co/username/qwen-capybara-sft")
|
| 127 |
+
print("π View metrics at: https://huggingface.co/spaces/username/trackio")
|