DeepSeekV4 Full-para train: Resource temporarily unavailable。
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 42/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Domain
- machine-learning
Research direction
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.
Written by the indexing model from the issue text.
Description
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 / 补充信息
- Dominant language
- Python
- Stars
- 16.2k
- Forks
- 1.8k
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 68
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from modelscope/ms-swift
-
get_multimodal_target_regex(..., exclude_router=True) does not exclude shared_expert_gatePossibly taken @KonnyakuMatcha claimed this 1 day ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
modelscope/ms-swift#10696 ·
Maintainers usually reply within 1 day
-
[BUG] GRPO REAL loss crashes with beta>0 and kl_in_reward=True (NoneType * Tensor)Possibly taken @newcloud123 claimed this 1 day ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
modelscope/ms-swift#10690 ·
Maintainers usually reply within 1 day
-
[BUG] GRPO REAL loss divides by all groups instead of valid groups, silently scaling gradientsPossibly taken @newcloud123 claimed this 1 day ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
modelscope/ms-swift#10688 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 Half a day Newbie friendliness 62/100
modelscope/ms-swift#10621 ·
Maintainers usually reply within 1 day
-
[Bug] `get_seed` consumes a draw from the shared RandomState even when decision augmentation is disabled, changing the train/val split and dataset shufflePossibly taken @ryznren claimed this 38 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
modelscope/ms-swift#10466 · 1 comment ·
Maintainers usually reply within 1 day
All issues in modelscope/ms-swift
Similar issues
-
Test: to_hijri() accepts datetime.datetime and uses only the date partPossibly taken A pull request linked to this issue is open or already merged. Opengood first issue
Difficulty 1/5 Under an hour Newbie friendliness 95/100
omarelshamy25x/shamy-hijri#63 · 3 comments ·
Maintainers usually reply within 1 day
-
polish
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
521xueweihan/HelloGitHub#4729 ·
-
[Bug]: Score parser reads parts of scientific notation as valid scoresPossibly taken @AshutoshSingh840 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
UKGovernmentBEIS/control-arena#992 ·
Maintainers usually reply within 3 days
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
mvalentsev/awesome-free-ai-coding#70 ·
Maintainers usually reply within 1 day