Troubleshooting guide#
This guide is the primary reference for diagnosing and resolving common failures when running Primus on AMD GPUs (ROCm, RCCL, Docker). It complements the CLI reference, Preflight, Micro-benchmarking, and Configuration system documentation.
1. Diagnostic tools#
Use these tools before scaling a job or when a failure is hard to localize.
Tool |
Purpose |
|---|---|
|
Enables verbose logging in |
|
Prints the commands Primus would run without executing them—useful to verify wrappers, paths, and MPI/launcher wiring. |
|
Parsed by the training config parser, but not written by the current default |
|
Surfaces detailed RCCL/NCCL connection and collective logs (set in the job environment). |
|
Fast host, GPU, and network validation. See Preflight. |
|
Disables Primus patches to the selected backend to isolate whether a failure is Primus-specific or upstream. |
Examples
# Verbose CLI + dry run (no training executed)
primus-cli --debug --dry-run direct -- train pretrain --config path/to/config.yaml
# Preflight: environment validation only
primus-cli direct -- preflight --host --gpu --network
# RCCL/NCCL verbose logs in the training process environment
export NCCL_DEBUG=INFO
# Isolate backend vs. Primus patch layer
export PRIMUS_PATCHES=none
For end-to-end checks including optional performance probes, see Preflight (preflight --perf-test).
2. Out of memory (OOM) errors#
Symptoms: HIP/CUDA OOM messages, worker processes killed by the OOM killer, or abrupt exits during forward/backward.
Primary levers and mitigations
Approach |
What to change |
|---|---|
Reduce per-device activation memory |
Lower |
Shard weights/activations across devices |
Increase tensor parallelism ( |
Trade compute for memory |
Activation recomputation: |
Shard optimizer state |
|
FSDP / sharded data parallel |
Megatron: |
CPU offload |
|
Sequence length |
Reduce maximum sequence length if the workload allows. |
MoE / scratch memory |
Set |
Plan before you run |
|
Related references: Parallelism strategies, Performance tuning, Megatron parameters, TorchTitan parameters.
3. Distributed communication failures#
Symptoms: Hangs at initialization, NCCL/RCCL timeouts, connection errors, or inconsistent ranks.
Cause |
What to verify / fix |
|---|---|
Wrong network interface |
Set |
|
From every node, resolve DNS/IP consistently; verify firewalls and routing. |
Port already in use |
Change |
InfiniBand not used or missing |
Confirm |
Timeout too aggressive |
Megatron: increase |
Mismatched world size |
Align |
Debugging
export NCCL_DEBUG=INFO
Validation
primus-cli direct -- preflight --network
primus-cli direct -- benchmark rccl --op all_reduce
Collective behavior and RCCL roles are summarized in Collective operations.
4. Container issues#
Symptoms: Permission denied on devices, GPUs not visible inside the container, immediate exit, or RCCL failures only under Docker.
Symptom |
Typical cause |
Mitigation |
|---|---|---|
GPU not visible |
Devices not passed through |
Ensure |
Permission denied on GPU |
Group membership / permissions |
Add |
InfiniBand missing in container |
Device not mounted |
Add |
Debugger/profiler failures |
Missing capabilities |
|
Driver/library mismatch |
Image vs. host ROCm |
Match container image ROCm to host ROCm driver version. |
Data or code not found |
Bind mounts |
Use |
Env vars missing in container |
Forwarding |
Check |
Installation and container-oriented setup are covered in Installation.
5. Configuration errors#
Symptoms: YAML parse failures, “unknown key” or type errors, silent wrong behavior after edits.
Issue |
Resolution |
|---|---|
Unset |
|
Broken |
Confirm every referenced file exists and paths resolve relative to the expected directory. |
Wrong parameter name |
Cross-check backend docs: Megatron, TorchTitan, MaxText, Megatron Bridge. |
Override not applied |
Review merge order: CLI > experiment overrides > module preset with model preset additions; duplicate top-level module keys win over model preset keys. See Configuration system. |
Effective config unknown |
Use |
6. Backend-specific issues#
Megatron#
Issue |
Mitigation |
|---|---|
Suspected Primus patch interaction |
|
Custom kernel compile failures |
|
Wrong third-party path |
Set |
TorchTitan#
Issue |
Mitigation |
|---|---|
Submodule drift |
|
|
|
MaxText (JAX)#
Issue |
Mitigation |
|---|---|
JAX / jaxlib vs ROCm |
Verify JAX and jaxlib builds match your ROCm stack. |
XLA memory pressure |
Tune |
7. Performance issues#
Symptoms: Low tokens/sec, long iteration time, or poor scaling versus expectations.
Diagnosis
Step |
Command / action |
|---|---|
Compute sanity |
|
Interconnect |
|
Broader probe |
|
Common fixes
Area |
Action |
|---|---|
GEMM / kernels |
Enable hipBLASLt tuning (multi-stage workflow—see Performance tuning). |
Primus stack |
Enable |
Communication overlap |
|
MoE / scratch |
Confirm |
FP8 |
Enable FP8 when hardware and backend support it. |
8. Data issues#
Symptom |
Checks |
|---|---|
Mock data works; real data fails |
|
Tokenizer errors |
|
Hugging Face download failures |
Set |
9. Known limitations#
Area |
Note |
|---|---|
MaxText |
Parameter completeness depends on upstream MaxText |
Megatron Bridge |
Recipe parameters may be loaded dynamically; not every key appears in static reference tables. |
HummingbirdXT |
Less mature than other backends; expect sharper edges in configs and tooling. |
Primus-Turbo |
Requires a separate installation step; not always present by default. |
For terminology, see the Glossary. For checkpoint-related failures, see Checkpoint management.