Vchaudhari17 commited on
Commit
54a8f86
·
verified ·
1 Parent(s): caf3009

Upload DOCKER_GUIDE.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. DOCKER_GUIDE.md +666 -0
DOCKER_GUIDE.md ADDED
@@ -0,0 +1,666 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # LatentRoute Docker Setup Guide
2
+
3
+ Complete guide for dockerizing and deploying LatentRoute on distributed servers for training on 50k+ data.
4
+
5
+ ## Table of Contents
6
+
7
+ - [Prerequisites](#prerequisites)
8
+ - [Quick Start](#quick-start)
9
+ - [Building the Image](#building-the-image)
10
+ - [Running Training](#running-training)
11
+ - [Docker Compose](#docker-compose)
12
+ - [Distributed Training](#distributed-training)
13
+ - [Registry Deployment](#registry-deployment)
14
+ - [Troubleshooting](#troubleshooting)
15
+
16
+ ---
17
+
18
+ ## Prerequisites
19
+
20
+ ### Local Development Machine
21
+
22
+ 1. **Docker** (≥ 20.10)
23
+ ```bash
24
+ # Ubuntu/Debian
25
+ sudo apt-get install docker.io
26
+ sudo usermod -aG docker $USER
27
+ newgrp docker
28
+
29
+ # macOS
30
+ brew install docker
31
+ # Then start Docker Desktop
32
+ ```
33
+
34
+ 2. **NVIDIA Docker Runtime** (for GPU support)
35
+ ```bash
36
+ # Ubuntu/Debian
37
+ distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
38
+ curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add -
39
+ curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | \
40
+ sudo tee /etc/apt/sources.list.d/nvidia-docker.list
41
+
42
+ sudo apt-get update && sudo apt-get install -y nvidia-docker2
43
+ sudo systemctl restart docker
44
+ ```
45
+
46
+ 3. **Docker Compose** (≥ 1.29)
47
+ ```bash
48
+ sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" \
49
+ -o /usr/local/bin/docker-compose
50
+ sudo chmod +x /usr/local/bin/docker-compose
51
+ ```
52
+
53
+ 4. **Disk Space**: At least **100 GB** for:
54
+ - Docker image: ~8 GB
55
+ - Training data cache: ~50 GB
56
+ - Model checkpoints: ~10-20 GB
57
+
58
+ ### Target Server (for distributed training)
59
+
60
+ Same as above, plus:
61
+ - NVIDIA GPU (ideally V100, A100, or H100)
62
+ - Docker, nvidia-docker, docker-compose
63
+ - Network access to pull from registry
64
+
65
+ ---
66
+
67
+ ## Quick Start
68
+
69
+ ### 1. Build Docker Image
70
+
71
+ ```bash
72
+ cd /path/to/LatentRoute
73
+ chmod +x docker-build.sh
74
+ ./docker-build.sh
75
+ ```
76
+
77
+ Expected output:
78
+ ```
79
+ ✅ Docker image built successfully!
80
+ Image: latentroute:latest
81
+ ```
82
+
83
+ ### 2. Run Training
84
+
85
+ ```bash
86
+ chmod +x docker-run-train.sh
87
+ ./docker-run-train.sh -s 1000 -b 4
88
+ ```
89
+
90
+ This starts training with:
91
+ - 1000 total steps
92
+ - Batch size 4
93
+ - 1 GPU
94
+ - Outputs saved to `./models/`
95
+
96
+ ### 3. View Logs
97
+
98
+ ```bash
99
+ docker logs -f latentroute-train
100
+ ```
101
+
102
+ ### 4. Stop Training
103
+
104
+ ```bash
105
+ docker stop latentroute-train
106
+ docker rm latentroute-train
107
+ ```
108
+
109
+ ---
110
+
111
+ ## Building the Image
112
+
113
+ ### Simple Build
114
+
115
+ ```bash
116
+ ./docker-build.sh
117
+ ```
118
+
119
+ ### Advanced Build Options
120
+
121
+ ```bash
122
+ # Build without cache (rebuild all layers)
123
+ ./docker-build.sh --no-cache
124
+
125
+ # Build and push to registry
126
+ ./docker-build.sh --push --registry docker.io --image-name myusername/latentroute
127
+
128
+ # Specific tag
129
+ ./docker-build.sh --image-tag v1.0
130
+ ```
131
+
132
+ ### Dockerfile Structure
133
+
134
+ The provided `Dockerfile` uses a **multi-stage build** approach:
135
+
136
+ - **Stage 1 (Builder)**: Installs all dependencies in nvidia/cuda:13.0-cudnn9-devel
137
+ - **Stage 2 (Runtime)**: Uses lighter nvidia/cuda:13.0-cudnn9-runtime
138
+
139
+ Benefits:
140
+ - Final image: ~8 GB (instead of ~15 GB)
141
+ - Faster downloads to servers
142
+ - Reduced storage on target machines
143
+
144
+ ### Image Size Breakdown
145
+
146
+ ```
147
+ Layer Size
148
+ ─────────────────────────────────────────
149
+ CUDA base (runtime) 4.5 GB
150
+ Python 3.12 + system libs 1.2 GB
151
+ PyTorch + dependencies 2.0 GB
152
+ LatentRoute source code <50 MB
153
+ ─────────────────────────────────────────
154
+ Total ~8 GB
155
+ ```
156
+
157
+ ---
158
+
159
+ ## Running Training
160
+
161
+ ### Using Shell Script (Recommended)
162
+
163
+ ```bash
164
+ ./docker-run-train.sh [COMMAND] [OPTIONS]
165
+ ```
166
+
167
+ #### Commands
168
+
169
+ | Command | Purpose | GPU Required |
170
+ |---------|---------|------------|
171
+ | `train` | Full model training (default) | ✅ Yes |
172
+ | `tokenizer` | Train BPE tokenizer | ❌ No |
173
+ | `prepare-data` | Download Wikipedia data | ❌ No |
174
+ | `test` | Run smoke tests | ❌ No |
175
+ | `inference` | Test model inference | ✅ Optional |
176
+
177
+ #### Options
178
+
179
+ | Option | Description | Default |
180
+ |--------|-------------|---------|
181
+ | `-g, --gpus NUM` | Number of GPUs | 1 |
182
+ | `-b, --batch-size NUM` | Batch size | 4 |
183
+ | `-s, --steps NUM` | Total training steps | 1000 |
184
+ | `-l, --learning-rate LR` | Learning rate | 0.0001 |
185
+ | `-i, --interactive` | Interactive bash | false |
186
+ | `-d, --detach` | Run in background | false |
187
+ | `-n, --name NAME` | Container name | latentroute-train |
188
+
189
+ #### Examples
190
+
191
+ ```bash
192
+ # Train with defaults (1 GPU, batch_size=4, 1000 steps)
193
+ ./docker-run-train.sh
194
+
195
+ # Train with 2 GPUs and 5000 steps
196
+ ./docker-run-train.sh train -g 2 -s 5000
197
+
198
+ # Larger batch size, more steps
199
+ ./docker-run-train.sh -b 8 -s 50000 -l 5e-5
200
+
201
+ # Interactive shell (for debugging)
202
+ ./docker-run-train.sh --interactive
203
+
204
+ # Run in background
205
+ ./docker-run-train.sh --detach
206
+ docker logs -f latentroute-train
207
+
208
+ # Train tokenizer first
209
+ ./docker-run-train.sh tokenizer --num_articles 5000 --vocab_size 50000
210
+
211
+ # Run smoke tests
212
+ ./docker-run-train.sh test
213
+
214
+ # Test inference
215
+ ./docker-run-train.sh inference --prompt "Hello world"
216
+ ```
217
+
218
+ ### Direct Docker Run
219
+
220
+ ```bash
221
+ # Single GPU training
222
+ docker run --gpus 1 -it \
223
+ -v $(pwd)/models:/models \
224
+ -v $(pwd)/data:/data \
225
+ -e PYTHONUNBUFFERED=1 \
226
+ latentroute:latest train --total_steps 5000 --batch_size 4
227
+
228
+ # Multi-GPU training
229
+ docker run --gpus all -it \
230
+ -v $(pwd)/models:/models \
231
+ -v $(pwd)/data:/data \
232
+ -e PYTHONUNBUFFERED=1 \
233
+ latentroute:latest train --total_steps 50000 --batch_size 8 --num_workers 4
234
+ ```
235
+
236
+ ### Environment Variables
237
+
238
+ Set in `.env.docker` or pass via `-e`:
239
+
240
+ ```bash
241
+ # Training
242
+ TOTAL_STEPS=1000 # Training steps
243
+ BATCH_SIZE=4 # Batch size
244
+ LEARNING_RATE=0.0001 # Learning rate
245
+ WARMUP_STEPS=100 # LR warmup steps
246
+
247
+ # Model config
248
+ D_MODEL=512 # Model dimension
249
+ N_LAYERS=6 # Number of layers
250
+ N_HEADS=8 # Attention heads
251
+ N_EXPERTS=8 # MoE experts
252
+ VOCAB_SIZE=50000 # Vocabulary size
253
+ MAX_SEQ_LEN=256 # Max sequence length
254
+
255
+ # Caching
256
+ TORCH_HOME=/cache/torch
257
+ HF_HOME=/cache/huggingface
258
+
259
+ # GPU
260
+ CUDA_VISIBLE_DEVICES=0 # GPU IDs (comma-separated)
261
+ ```
262
+
263
+ ---
264
+
265
+ ## Docker Compose
266
+
267
+ ### Quick Start with Compose
268
+
269
+ ```bash
270
+ chmod +x docker-compose-runner.sh
271
+
272
+ # Build
273
+ ./docker-compose-runner.sh build
274
+
275
+ # Start training
276
+ ./docker-compose-runner.sh up
277
+
278
+ # View logs
279
+ ./docker-compose-runner.sh logs
280
+
281
+ # Stop
282
+ ./docker-compose-runner.sh down
283
+ ```
284
+
285
+ ### Direct docker-compose Commands
286
+
287
+ ```bash
288
+ # Build image
289
+ docker-compose build
290
+
291
+ # Start training service
292
+ docker-compose up -d latentroute-train
293
+
294
+ # View logs
295
+ docker-compose logs -f latentroute-train
296
+
297
+ # Enter container shell
298
+ docker-compose exec latentroute-train /bin/bash
299
+
300
+ # Stop all services
301
+ docker-compose down
302
+
303
+ # Clean up volumes
304
+ docker-compose down -v
305
+ ```
306
+
307
+ ### Compose File Structure
308
+
309
+ ```yaml
310
+ services:
311
+ latentroute-train:
312
+ image: latentroute:latest
313
+ runtime: nvidia # Enable GPU
314
+ gpus:
315
+ count: 1 # Number of GPUs
316
+ capabilities: [gpu]
317
+ volumes:
318
+ - ./models:/models # Checkpoint output
319
+ - ./data:/data # Input data
320
+ - cache-huggingface:/cache/huggingface
321
+ ports:
322
+ - "8265:8265" # Ray Tune dashboard
323
+ environment:
324
+ - CUDA_VISIBLE_DEVICES=0
325
+ - PYTHONUNBUFFERED=1
326
+ ```
327
+
328
+ ---
329
+
330
+ ## Distributed Training
331
+
332
+ ### Multi-GPU on Single Server
333
+
334
+ For training on 50k+ samples efficiently:
335
+
336
+ ```bash
337
+ # 4 GPUs, larger batches
338
+ ./docker-run-train.sh \
339
+ -g 4 \
340
+ -b 16 \
341
+ -s 100000
342
+
343
+ # Or with environment variables
344
+ docker run --gpus all -it \
345
+ -e CUDA_VISIBLE_DEVICES=0,1,2,3 \
346
+ latentroute:latest train \
347
+ --total_steps 100000 \
348
+ --batch_size 16 \
349
+ --num_workers 4
350
+ ```
351
+
352
+ ### Multi-Server with Ray Tune
353
+
354
+ For truly distributed training across multiple servers:
355
+
356
+ #### 1. Start Ray Head Node (on server 1)
357
+
358
+ ```bash
359
+ docker run --gpus all -it \
360
+ -p 8265:8265 \
361
+ -p 6379:6379 \
362
+ -e PYTHONUNBUFFERED=1 \
363
+ latentroute:latest \
364
+ python -c "import ray; ray.init(address='auto', ignore_reinit_error=True)" && \
365
+ python scripts/train_on_wiki.py \
366
+ --total_steps 100000 \
367
+ --batch_size 8 \
368
+ --num_workers 4
369
+ ```
370
+
371
+ #### 2. Join Worker Nodes (on servers 2, 3, ...)
372
+
373
+ ```bash
374
+ export RAY_HEAD_IP=<server1_ip>
375
+
376
+ docker run --gpus all -it \
377
+ -e PYTHONUNBUFFERED=1 \
378
+ -e RAY_HEAD_IP=$RAY_HEAD_IP \
379
+ latentroute:latest \
380
+ python -c "import ray; ray.init(address=f'ray://{os.getenv(\"RAY_HEAD_IP\")}:6379')"
381
+ ```
382
+
383
+ #### 3. Monitor Training
384
+
385
+ ```bash
386
+ # Access Ray Tune dashboard on server 1
387
+ http://<server1_ip>:8265
388
+ ```
389
+
390
+ ---
391
+
392
+ ## Registry Deployment
393
+
394
+ ### Push to Docker Hub
395
+
396
+ ```bash
397
+ chmod +x docker-push-registry.sh
398
+
399
+ # Login (one time)
400
+ ./docker-push-registry.sh --login-only --docker-hub -u your_username
401
+
402
+ # Push image
403
+ ./docker-push-registry.sh --docker-hub -u your_username
404
+
405
+ # Output: your_username/latentroute:latest
406
+ ```
407
+
408
+ ### Push to AWS ECR
409
+
410
+ ```bash
411
+ # Configure AWS credentials first
412
+ aws configure
413
+
414
+ # Create ECR repository
415
+ aws ecr create-repository --repository-name latentroute
416
+
417
+ # Get registry URI
418
+ REGISTRY_URI=$(aws ecr describe-repositories \
419
+ --repository-names latentroute \
420
+ --query 'repositories[0].repositoryUri' \
421
+ --output text)
422
+
423
+ # Push
424
+ ./docker-push-registry.sh --aws-ecr $REGISTRY_URI
425
+ ```
426
+
427
+ ### Push to GCP GCR
428
+
429
+ ```bash
430
+ # Configure GCP credentials
431
+ gcloud auth login
432
+ gcloud config set project YOUR_PROJECT_ID
433
+
434
+ # Push
435
+ ./docker-push-registry.sh --gcp-gcr YOUR_PROJECT_ID
436
+
437
+ # Output: gcr.io/YOUR_PROJECT_ID/latentroute:latest
438
+ ```
439
+
440
+ ### Push to Azure ACR
441
+
442
+ ```bash
443
+ # Create ACR (if needed)
444
+ az acr create --resource-group myRG --name myregistry --sku Basic
445
+
446
+ # Push
447
+ ./docker-push-registry.sh --azure myregistry
448
+
449
+ # Output: myregistry.azurecr.io/latentroute:latest
450
+ ```
451
+
452
+ ### Pull on Target Server
453
+
454
+ Once pushed to registry:
455
+
456
+ ```bash
457
+ # Pull from Docker Hub
458
+ docker pull your_username/latentroute:latest
459
+
460
+ # Pull from AWS ECR
461
+ docker pull $REGISTRY_URI
462
+
463
+ # Pull from GCP GCR
464
+ docker pull gcr.io/YOUR_PROJECT_ID/latentroute:latest
465
+
466
+ # Run training
467
+ ./docker-run-train.sh --image gcr.io/YOUR_PROJECT_ID/latentroute:latest \
468
+ -s 50000 -b 8
469
+ ```
470
+
471
+ ---
472
+
473
+ ## Troubleshooting
474
+
475
+ ### GPU Not Detected
476
+
477
+ **Symptom**: `CUDA Available: False`
478
+
479
+ ```bash
480
+ # Check nvidia-docker installation
481
+ nvidia-docker --version
482
+
483
+ # Test GPU access
484
+ nvidia-docker run --rm nvidia/cuda:13.0-runtime nvidia-smi
485
+
486
+ # Restart Docker daemon
487
+ sudo systemctl restart docker
488
+
489
+ # Run with explicit GPU
490
+ docker run --gpus all ...
491
+ ```
492
+
493
+ ### Out of Memory (OOM)
494
+
495
+ **Symptom**: `RuntimeError: CUDA out of memory`
496
+
497
+ ```bash
498
+ # Reduce batch size
499
+ ./docker-run-train.sh -b 2 # Down from 4
500
+
501
+ # Reduce model size in .env.docker
502
+ D_MODEL=256 # Down from 512
503
+ N_LAYERS=4 # Down from 6
504
+ N_EXPERTS=4 # Down from 8
505
+
506
+ # Enable gradient checkpointing
507
+ -e GRADIENT_CHECKPOINTING=true
508
+ ```
509
+
510
+ ### Slow Data Loading
511
+
512
+ **Symptom**: GPU utilization low, CPU high
513
+
514
+ ```bash
515
+ # Increase number of workers
516
+ docker run ... train --num_workers 8
517
+
518
+ # Pre-download Wikipedia data
519
+ docker run ... prepare-data --num_articles 100000
520
+
521
+ # Use SSD instead of HDD for /cache/huggingface
522
+ ```
523
+
524
+ ### Network Issues (HF Dataset Download)
525
+
526
+ **Symptom**: `ConnectionError` or timeouts
527
+
528
+ ```bash
529
+ # Pre-download data on machine with good internet
530
+ ./docker-run-train.sh prepare-data --num_articles 50000
531
+
532
+ # Copy ./data/wiki_corpus.jsonl to target server
533
+
534
+ # Use local data
535
+ docker run -v /path/to/wiki_corpus.jsonl:/data/wiki_corpus.jsonl ...
536
+ ```
537
+
538
+ ### Image Build Failures
539
+
540
+ **Symptom**: Build fails at PyTorch install
541
+
542
+ ```bash
543
+ # Build without cache
544
+ ./docker-build.sh --no-cache
545
+
546
+ # Check disk space
547
+ df -h
548
+
549
+ # Increase Docker resources
550
+ # Docker Desktop → Preferences → Resources → Disk Image Size
551
+ ```
552
+
553
+ ### Container Exits Immediately
554
+
555
+ **Symptom**: Container starts then stops
556
+
557
+ ```bash
558
+ # Check logs
559
+ docker logs <container_id>
560
+
561
+ # Run interactively to see errors
562
+ ./docker-run-train.sh --interactive
563
+
564
+ # Verify Python/dependencies
565
+ docker run -it latentroute:latest python -c "import torch; print(torch.__version__)"
566
+ ```
567
+
568
+ ---
569
+
570
+ ## Performance Tips
571
+
572
+ ### For 50k+ Training Data
573
+
574
+ 1. **Use Multiple GPUs**
575
+ ```bash
576
+ ./docker-run-train.sh -g 4 -b 32 -s 100000
577
+ ```
578
+
579
+ 2. **Pre-download Data**
580
+ ```bash
581
+ ./docker-run-train.sh prepare-data --num_articles 50000
582
+ ```
583
+
584
+ 3. **Use Fast Storage**
585
+ - SSD for `/cache/huggingface` and `/models`
586
+ - NVMe for best performance
587
+
588
+ 4. **Enable Gradient Checkpointing** (saves memory, slight slowdown)
589
+ ```bash
590
+ -e GRADIENT_CHECKPOINTING=true
591
+ ```
592
+
593
+ 5. **Monitor with Ray Dashboard**
594
+ ```bash
595
+ http://localhost:8265
596
+ ```
597
+
598
+ 6. **Use Larger Model for Training**
599
+ ```bash
600
+ -e D_MODEL=1024 -e N_LAYERS=12 -e N_EXPERTS=16
601
+ ```
602
+
603
+ ---
604
+
605
+ ## Example: Complete Workflow
606
+
607
+ ### Local Training (Quick Test)
608
+
609
+ ```bash
610
+ # 1. Build
611
+ ./docker-build.sh
612
+
613
+ # 2. Prepare data (if not streaming)
614
+ ./docker-run-train.sh prepare-data --num_articles 1000
615
+
616
+ # 3. Train tokenizer
617
+ ./docker-run-train.sh tokenizer --num_articles 1000
618
+
619
+ # 4. Quick test with 100 steps
620
+ ./docker-run-train.sh -b 4 -s 100
621
+
622
+ # 5. Check results
623
+ ls -lh models/
624
+ ```
625
+
626
+ ### Server Deployment (50k+ Data)
627
+
628
+ ```bash
629
+ # 1. On build server:
630
+ ./docker-build.sh
631
+ ./docker-push-registry.sh --docker-hub -u myusername
632
+ # Output: myusername/latentroute:latest
633
+
634
+ # 2. On target server:
635
+ docker pull myusername/latentroute:latest
636
+
637
+ # 3. Run 50k training
638
+ docker run --gpus all -it \
639
+ -v /mnt/ssd/models:/models \
640
+ -v /mnt/ssd/cache:/cache \
641
+ -e PYTHONUNBUFFERED=1 \
642
+ myusername/latentroute:latest train \
643
+ --total_steps 50000 \
644
+ --batch_size 16 \
645
+ --lr 1e-4
646
+
647
+ # 4. Monitor
648
+ docker logs -f <container_id>
649
+
650
+ # 5. Collect results
651
+ scp -r /mnt/ssd/models/* local_machine:/results/
652
+ ```
653
+
654
+ ---
655
+
656
+ ## Additional Resources
657
+
658
+ - [NVIDIA Docker Documentation](https://github.com/NVIDIA/nvidia-docker)
659
+ - [Docker Documentation](https://docs.docker.com/)
660
+ - [Docker Compose Documentation](https://docs.docker.com/compose/)
661
+ - [Ray Documentation](https://docs.ray.io/)
662
+
663
+ ---
664
+
665
+ **Last Updated**: May 2026
666
+ **LatentRoute Version**: 0.1.0