- Current Behavior:
KubernetesFFTWorkerManager.__init__reads and parses pod templates (/etc/open-rl/trainer/trainer-worker-pod.yaml) once at startup and stores them in memory (self.trainer_template). - Improvement: Read and parse the template file dynamically from disk on every
render_pod()invocation so live ConfigMap updates take effect immediately without requiring a rolling restart of the API server deployment (kubectl rollout restart deployment open-rl-api-server).
- Current Behavior: The trainer requests processor pops training request items immediately from Redis upon picking up a step.
- Improvement: Ensure that during a trainer worker crash or OOM kill, the queue item is dequeued / acknowledged only after the full completion of the training step (specifically, post saving the updated model checkpoint weights back to shared persistent storage). If interrupted earlier, the item should remain unacknowledged so another pod instance can safely retry the training step.
- Status: Implemented and verified in
src/training/fft_trainer_worker.py(FFTTrainingWorker.sleep()andwake_up()). Addedself._opt_shadowpersistent dictionary to store pinned host buffers for AdamW optimizer states across training steps. - Current Behavior:
FFTTrainingWorker.sleep()iterates serially over model parameters, gradients, and AdamW optimizer states usingparam.data.to("cpu", non_blocking=False).pin_memory()followed immediately byparam.data = torch.empty(0, ...). This synchronous loop blocks the CPU per-tensor and allocates OS page-locked memory on the fly, yielding ~1.34 GB/s on H100 PCIe Gen5 (~11.9s to offload ~16 GiB total). In contrast, reloading (wake_up()) from pinned memory over async PCIe DMA achieves ~14 GB/s (~1.15s). - Improvement: Eliminate the CPU offload bottleneck and prevent GPU memory corruption race conditions by restructuring
sleep()into three distinct phases:- Phase 1 (Launch Batched Async DMA): Keep persistent pinned host CPU buffers (
_param_shadow,_grad_shadow,_opt_shadow) alive across training steps so.pin_memory()is never called after Step 1. Launch 100% asynchronous DMA transfers usingcpu_buf.copy_(gpu_tensor, non_blocking=True)across all tensors without deleting or modifying GPU VRAM buffers. - Phase 2 (Single Barrier Synchronization): Execute a single barrier (
torch.cuda.synchronize()) at the end of the loop to wait once for all 16 GiB of concurrent DMA transfers to complete. - Phase 3 (Safe VRAM Deallocation): Only after
synchronize()returns and verifies that every byte is safely residing in host RAM, deallocate GPU tensors (param.data = torch.empty(0, ...)) and release CUDA allocator cache. This targets >14 GB/s and ~1-second CPU offloads without race conditions.
- Phase 1 (Launch Batched Async DMA): Keep persistent pinned host CPU buffers (
- Current Behavior:
KubernetesFFTWorkerManagerlaunches trainer and sampler workloads as bare KubernetesPodobjects (open-rl-trainer-...andopen-rl-sampler-...). When GCP Spot VM preemption reclaims an underlying GPU spot node, Kubernetes terminates the bare worker pod without respawning a replacement, causing the distributed E2E training job to hang indefinitely waiting for rollouts or gradient updates. - Improvement: Equip the worker provisioner with automated fault tolerance against spot preemption by either deploying worker workloads as lightweight Kubernetes
DeploymentorReplicaSetcontrollers (withreplicas: 1), or by implementing active pod lifecycle monitoring and automated recreation withinKubernetesFFTWorkerManager. Upon spot preemption, Kubernetes or the provisioner will automatically schedule a replacement worker pod onto a fresh spot node. When the replacement pod boots, it will automatically resume from the latest saved model checkpoint on shared persistent storage (/mnt/shared/open-rl/...), ensuring uninterrupted distributed fine-tuning.
- Current Behavior: Dynamically spawned
TrainerandSamplerworker containers run without authentication (user_id=public), causing strict HuggingFace Hub CDN throttling (403 Forbidden/ lengthy retry loops onxet_clientduring first-time model caching) and failing on gated models (e.g., Gemma 2, Gemma 4, Llama 3). - Improvement: Update
scheduler_worker_manager.py(render_template()) and static Kubernetes manifests to inject an optionalopen-rl-hf-secret(or ConfigMap via envFrom / set_env) into all worker containers, ensuring authenticated, high-bandwidth model downloads without rate-limiting across multi-pod cluster setups.
- Current Behavior:
src/server/Dockerfileandsrc/server/Dockerfile.api_servercopy theuvbinary fromghcr.io/astral-sh/uv:latest. Because the:latesttag is mutable and updated frequently upstream, any newuvrelease invalidates the Docker BuildKit cache at that layer, forcing a complete rebuild from scratch (e.g. re-downloading Python, dependency trees, and recompiling custom vLLM C++ extensions). - Improvement: Pin the
uvimage to a specific static version or SHA digest (e.g.ghcr.io/astral-sh/uv:0.2.27or via@sha256:...) across allDockerfiles to guarantee reproducible, blazing-fast cached builds unless dependency files (pyproject.toml,uv.lock) actually change.