Skip to content

Operator task guide

How to fix FlashAttention build, DataLoader worker, and DeepSpeed crashes

Three environment failures kill training pipelines before or mid-epoch: FlashAttention C++/CUDA ABI mismatches (error compiling objects for extension or undefined symbol), DataLoader worker crashes (exited unexpectedly from /dev/shm Bus error or host RAM OOM), and DeepSpeed nvcc/ZeRO-3 initialization errors.

Check exact PyTorch C++11 ABI and CUDA toolkit versions before building wheels, size container /dev/shm cleanly using our DataLoader SHM calculator, and separate host cgroup OOM kills from CUDA VRAM exhaustion when running ZeRO-3 CPU offload.

Reviewed . Reference guidance is not a diagnosis of your workload.

Step-by-step method

  1. 1

    Diagnose FlashAttention compile and undefined symbol errors

    Verify nvcc version matches torch.version.cuda and check PyTorch _GLIBCXX_USE_CXX11_ABI before installing or compiling flash-attn, limiting MAX_JOBS so parallel nvcc processes do not OOM-kill host RAM.

    python3 -c "import torch; print('torch:', torch.__version__, 'cuda:', torch.version.cuda, 'abi:', torch._C._GLIBCXX_USE_CXX11_ABI)"
    nvcc --version
    MAX_JOBS=4 pip install flash-attn --no-build-isolation
  2. 2

    Debug DataLoader worker exited unexpectedly (Bus error vs OOM)

    Check dmesg and /dev/shm inside the container. Signal 7 (SIGBUS) means /dev/shm filled up passing worker batches; Signal 9 (SIGKILL) means host RAM or container cgroup memory ran out.

    df -h /dev/shm
    dmesg -T | grep -iE 'Killed process|Out of memory|memory cgroup' | tail -n 20
  3. 3

    Debug DeepSpeed install errors and ZeRO-3 initialization OOMs

    Run python3 -m deepspeed.env_report to check CUDA_HOME and ninja/nvcc availability. For ZeRO-3 OOM during model load, ensure the model is constructed inside deepspeed.zero.Init().

    python3 -m deepspeed.env_report
    which nvcc ninja
  4. 4

    Verify a full epoch boundary with clean worker shutdown

    Re-run with matched DataLoader num_workers and persistent_workers settings, confirming zero worker restarts and steady host RSS across at least one checkpoint boundary.

Environment & pipeline crash triage

Signals, meanings and actions for how to fix flashattention build, dataloader worker, and deepspeed crashes.
SignalWhat it meansNext action
flash-attn undefined symbol (_ZN3c10...)Wheel built with mismatched PyTorch version or CXX11 ABI.Match prebuilt wheel to exact torch + CUDA + cxx11abi tag or compile with MAX_JOBS=4.
error compiling objects for extension / g++ killedHost RAM exhausted by parallel nvcc jobs or wrong nvcc version.Cap MAX_JOBS=2 or 4 and verify nvcc matches torch.version.cuda.
DataLoader worker pid N exited unexpectedly (Bus error)Container /dev/shm (often 64 MB default) is exhausted.Increase Docker --shm-size or K8s emptyDir memory size, or lower num_workers.
DataLoader worker exited with SIGKILL / no tracebackPython dataset caching or worker duplication exhausted host RAM.Check sacct MaxRSS / dmesg OOM, avoid duplicating huge arrays per worker, lower num_workers.

Evidence checklist

  • torch.__version__, torch.version.cuda, and _GLIBCXX_USE_CXX11_ABI
  • nvcc --version and MAX_JOBS build setting
  • df -h /dev/shm and DataLoader num_workers + prefetch_factor
  • Host dmesg OOM-killer output and container memory limits
  • python3 -m deepspeed.env_report output for DeepSpeed builds

Common mistakes

Running pip install flash-attn without MAX_JOBS on a multi-core box

Ninja spawns dozens of parallel nvcc/cicc processes that eat 100+ GB of RAM and fail mid-compile.

Lowering GPU batch size to fix DataLoader worker crashes

DataLoader workers live in host RAM and /dev/shm, not GPU VRAM.

Ignoring ABI tags when grabbing prebuilt flash-attn wheels

cxx11abiTRUE vs cxx11abiFALSE mismatches compile/install cleanly and crash at import with undefined symbol.

Frequently asked questions

Why does pip install flash-attn fail with error compiling objects for extension?

Usually either nvcc does not match torch.version.cuda, CUDA_HOME is unset, or unrestricted parallel compilation exhausted host RAM (fix by setting MAX_JOBS=4).

How do I fix flash_attn undefined symbol on import?

The installed flash-attn wheel was compiled against a different PyTorch version or _GLIBCXX_USE_CXX11_ABI setting. Print torch._C._GLIBCXX_USE_CXX11_ABI and install the matching wheel.

Why do PyTorch DataLoader workers exit unexpectedly?

Most crashes are either SIGBUS from a tiny 64 MB container /dev/shm or SIGKILL from host RAM OOM when each worker duplicates large dataset metadata or images.

How do I fix DeepSpeed ZeRO-3 OOM during model loading?

Wrap model construction inside with deepspeed.zero.Init(): (or initialize HfDeepSpeedConfig before from_pretrained) so weights partition as they load instead of materializing full-size on every GPU.

Live diagnosis, no signup

Upload your GPU log. Find what happened first.

Get the likely cause, supporting evidence, and next safe steps with the same cloud reasoning used by paid plans. A crash the engine recognizes is answered in seconds, then checked by an independent AI review that updates this page when it finishes. A crash it does not recognize waits for the AI's own answer, which can take a few minutes. No account, card, or installation. Logs are masked at Denpex API ingress and are not saved to account history.

Before uploading, review cloud data handling and local options.

training_logs.txt
No log to hand? Try one:

Upload your log file. Large files are processed in your browser. Only selected evidence is submitted when you run diagnosis.

3 free cloud diagnoses per day

Try Denpex for 30 days. FREE.

No credit card. No automatic subscription. See whether Denpex helps with an incident you already understand.

Start your free 30-day Team evaluation

Up to 50 diagnoses a day for 30 days. Verify your work email to activate an eligible company evaluation, then replay a resolved incident and compare the evidence and next steps with your team's confirmed cause.

Use your company email, for example alex@yourcompany.com.

Who qualifies?

Company email domains activate the free 30-day Team evaluation (up to 50 diagnoses a day) after an email and domain check, whatever mail provider you use. If we cannot verify your domain automatically, support reviews it: write to support@denpex.com. Free local diagnosis in the editor extension needs no account.

Using a personal email (Gmail, Outlook, Naver, QQ) or solo cluster? Create a free $0 account (no work email required) to save 7-day history and unlock AI fallback, or send a cluster crash log for a live walkthrough.

Apply the method to your incident

Use the three free diagnoses to review your error and relevant evidence. Keep reference guidance separate from the cause and recovery status of your own workload.

Diagnose your incident