DeepSeekV4 Full-para train: Resource temporarily unavailable。

Aperta
#10,432 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
1-2 giorni
Idoneità per principianti
42/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
python, pytorch

Direzione di ricerca

The report provides a Megatron SFT launch script and says each rank starts many pthreads until LLVM reports pthread_create failed. Start by reproducing with the supplied environment variables and parallelism settings, then inspect the training startup and thread creation paths involved. Done means identifying why threads multiply across ranks and confirming training can start without the resource error; the payload names no source files or tests.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug
Checklist / 检查清单
  • I have searched existing issues, and this is a new bug report. / 我已经搜索过现有的 issues,确认这是一个新的 bug report。
Bug Description / Bug 描述

进行deepseek v4的训练时发现,每个rank都会启动特别多的pthread,最后会导致LLVM ERROR: pthread_create failed: Resource temporarily unavailable。

How to Reproduce / 如何复现

训练的脚本:
if [ -z "$NODE_RANK" ]; then
echo "ERROR: NODE_RANK is not set"
exit 1
fi

CACHE=/mnt/storage/zhq/dsv4/cache/rank_${NODE_RANK}
mkdir -p "$CACHE"/{modelscope,hf,tmp}

OMP_NUM_THREADS=1
MKL_NUM_THREADS=1
OPENBLAS_NUM_THREADS=1
NUMEXPR_NUM_THREADS=1
TOKENIZERS_PARALLELISM=false
MAX_JOBS=1
TORCHINDUCTOR_COMPILE_THREADS=1
PYTORCH_CUDA_ALLOC_CONF='expandable_segments:True'
NPROC_PER_NODE=8
CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7
MODELSCOPE_CACHE="$CACHE/modelscope"
HF_HOME="$CACHE/hf"
HF_DATASETS_CACHE="$CACHE/hf/datasets"
TMPDIR="$CACHE/tmp"
megatron sft
--model /mnt/storage/models/deepseek-ai/DeepSeek-V4-Flash-Base
--save_safetensors true
--dataset /mnt/storage/zhq/dsv4/scripts/merged.jsonl
--model_author swift
--model_name swift-robot
--load_from_cache_file true
--add_non_thinking_prefix true
--split_dataset_ratio 0.001
--tensor_model_parallel_size 1
--expert_model_parallel_size 8
--pipeline_model_parallel_size 12
--pipeline_model_parallel_layout 'Et3|t3|t4|t4|t4|t4|t4|t4|t4|t4|t4|t1mL'
--fp8_recipe blockwise
--fp8_format e4m3
--fp8_param_gather true
--micro_batch_size 1
--global_batch_size 128
--recompute_granularity full
--recompute_method uniform
--recompute_num_layers 1
--save_total_limit 3
--moe_permute_fusion true
--moe_grouped_gemm true
--moe_shared_expert_overlap true
--moe_aux_loss_coeff 1e-3
--num_train_epochs 1
--finetune true
--cross_entropy_loss_fusion true
--lr 3e-5
--lr_warmup_fraction 0.05
--min_lr 1e-7
--output_dir /mnt/storage/zhq/dsv4/model/megatron_output/DeepSeek-V4-Flash/0924
--eval_steps 3000
--save_steps 1000
--max_length 16384
--dataloader_num_workers 2
--dataset_num_proc 8
--no_save_optim false
--no_save_rng false
--sequence_parallel true
--mtp_num_layers 1
--attention_backend flash
--use_chat_template false
--context_parallel_size 8
--cp_partition_mode contiguous
--sequence_packing_scheduler dp_balanced
--loss_scale all
--packing true

Additional Information / 补充信息
Image
Lingua principale
Python
Stelle
16.2k
Fork
1.8k
Merge medio
1g 14h
PR unite (30g)
68

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di modelscope/ms-swift

Tutte le issue di modelscope/ms-swift

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.