Technical Overview
Using device_map="auto" when launching training on multi-GPU nodes with accelerate launch causes Hugging Face's pipeline to automatically slice model parameters across all visible GPUs. This contradicts Distributed Data Parallel (DDP) fundamentals, where each GPU must host a complete, isolated copy of the model parameters. This conflict results in severe communication stalls, process hangs, and device deadlocks.
Affected Modules
- File:
src/train.py (Line 32-56)
- Target Classes:
WhisperForConditionalGeneration.from_pretrained()
Detailed Traceback / Context
Distributed training processes freeze indefinitely at trainer.train() on step 1 without logging errors or utilizing system resources.
Acceptance Criteria
- Isolated GPU Contexts: Each subprocess allocates itself strictly to one dedicated GPU handled by the system's local rank.
- Successful Multi-GPU Scaling: Effective training step latency drops proportionally when scaling from a single T4 to dual-T4 GPUs.
- No Process Deadlocks: Zero synchronization stalls or hanging processes on DDP initialization.
Proposed Implementation Approach
Enforce localized rank allocations by disabling automatic mapping and hardcoding the local rank ID from process environment variables:
local_rank = int(os.environ.get("LOCAL_RANK", 0))
device = f"cuda:{local_rank}"
model = WhisperForConditionalGeneration.from_pretrained(
args.model_name,
load_in_8bit=True,
device_map={"": device} # Pin explicitly to the active process GPU rank
)
Severity & Priority
- Severity: High (Blocks distributed dual-GPU scaling)
- Priority: P1
Technical Overview
Using
device_map="auto"when launching training on multi-GPU nodes withaccelerate launchcauses Hugging Face's pipeline to automatically slice model parameters across all visible GPUs. This contradicts Distributed Data Parallel (DDP) fundamentals, where each GPU must host a complete, isolated copy of the model parameters. This conflict results in severe communication stalls, process hangs, and device deadlocks.Affected Modules
src/train.py(Line 32-56)WhisperForConditionalGeneration.from_pretrained()Detailed Traceback / Context
Distributed training processes freeze indefinitely at
trainer.train()on step 1 without logging errors or utilizing system resources.Acceptance Criteria
Proposed Implementation Approach
Enforce localized rank allocations by disabling automatic mapping and hardcoding the local rank ID from process environment variables:
Severity & Priority