chore: import upstream snapshot with attribution
Lint test / lint (push) Has been cancelled

This commit is contained in:
wehub-resource-sync
2026-07-13 13:34:58 +08:00
commit a203934033
1368 changed files with 175001 additions and 0 deletions
@@ -0,0 +1,24 @@
# Env: 8 * A100
# Max Length: 65536
# GPU Memory: 8 * 40GiB, Training Speed 26s/it
NPROC_PER_NODE=8 \
CELOSS_PARALLEL_SIZE=2048 \
swift sft \
--model Qwen/Qwen2.5-3B-Instruct \
--dataset 'AI-ModelScope/LongAlpaca-12k' \
--load_from_cache_file true \
--tuner_type lora \
--torch_dtype bfloat16 \
--per_device_train_batch_size 4 \
--target_modules all-linear \
--gradient_accumulation_steps 8 \
--save_total_limit 2 \
--save_only_model true \
--save_steps 50 \
--max_length 65536 \
--warmup_ratio 0.05 \
--attn_impl flash_attn \
--sequence_parallel_size 8 \
--logging_steps 1 \
--use_logits_to_keep false \
--padding_free true \
@@ -0,0 +1,32 @@
# Env: 8 * A100
# Max Length: 512000
# GPU Memory: 8 * 80GiB, Training Speed 150s/it
NPROC_PER_NODE=8 \
CELOSS_PARALLEL_SIZE=2048 \
swift sft \
--model Qwen/QwQ-32B \
--tuner_type lora \
--dataset 'AI-ModelScope/LongAlpaca-12k' \
--load_from_cache_file true \
--split_dataset_ratio 0.01 \
--torch_dtype bfloat16 \
--per_device_train_batch_size 1 \
--per_device_eval_batch_size 1 \
--learning_rate 1e-5 \
--gradient_accumulation_steps 2 \
--packing true \
--rope_scaling yarn \
--max_length 512000 \
--max_model_len 512000 \
--eval_steps 200 \
--save_steps 200 \
--logging_steps 5 \
--warmup_ratio 0.05 \
--dataloader_num_workers 8 \
--dataset_num_proc 8 \
--save_total_limit 2 \
--use_liger_kernel true \
--save_only_model true \
--deepspeed zero3_offload \
--attn_impl flash_attn \
--sequence_parallel_size 8
@@ -0,0 +1,30 @@
# Env: 4 * A100
# GPU Memory: 4 * 25GiB, Training Speed 14s/it
NPROC_PER_NODE=4 \
CUDA_VISIBLE_DEVICES=0,1,2,3 \
swift rlhf \
--rlhf_type dpo \
--model Qwen/Qwen2.5-VL-3B-Instruct \
--tuner_type full \
--dataset swift/RLAIF-V-Dataset \
--load_from_cache_file true \
--split_dataset_ratio 0.01 \
--torch_dtype bfloat16 \
--per_device_train_batch_size 1 \
--per_device_eval_batch_size 1 \
--learning_rate 1e-5 \
--gradient_accumulation_steps 8 \
--eval_steps 200 \
--save_steps 200 \
--logging_steps 5 \
--warmup_ratio 0.05 \
--dataloader_num_workers 8 \
--dataset_num_proc 8 \
--save_total_limit 2 \
--save_only_model true \
--output_dir output/Qwen2.5-VL-3B-Instruct \
--deepspeed zero3 \
--attn_impl flash_attn \
--use_liger_kernel true \
--rpo_alpha 0.1 \
--sequence_parallel_size 4
@@ -0,0 +1,28 @@
CUDA_VISIBLE_DEVICES=0,1,2,3 \
INFONCE_TEMPERATURE=0.1 \
INFONCE_MASK_FAKE_NEGATIVE=true \
INFONCE_INCLUDE_QQ=true \
INFONCE_INCLUDE_DD=false \
NPROC_PER_NODE=4 \
swift sft \
--model Qwen/Qwen3-Embedding-0.6B \
--task_type embedding \
--model_type qwen3_emb \
--tuner_type full \
--dataset sentence-transformers/stsb \
--load_from_cache_file true \
--split_dataset_ratio 0.05 \
--eval_strategy steps \
--output_dir output \
--save_steps 50 \
--eval_steps 50 \
--num_train_epochs 5 \
--per_device_train_batch_size 256 \
--per_device_eval_batch_size 256 \
--gradient_accumulation_steps 1 \
--learning_rate 6e-6 \
--loss_type infonce \
--dataloader_drop_last true \
--sequence_parallel_size 4 \
--padding_free true \
--attn_impl flash_attn
@@ -0,0 +1,44 @@
NPROC_PER_NODE=8 \
PYTORCH_CUDA_ALLOC_CONF='' \
swift rlhf \
--rlhf_type grpo \
--model Qwen/Qwen2.5-7B \
--tuner_type full \
--use_vllm true \
--vllm_mode colocate \
--vllm_gpu_memory_utilization 0.5 \
--vllm_max_model_len 2048 \
--vllm_tensor_parallel_size 4 \
--dataset AI-MO/NuminaMath-TIR#5000 \
--load_from_cache_file true \
--torch_dtype bfloat16 \
--num_train_epochs 1 \
--max_length 2048 \
--per_device_train_batch_size 4 \
--per_device_eval_batch_size 4 \
--gradient_accumulation_steps 8 \
--eval_steps 1000 \
--save_steps 1000 \
--learning_rate 1e-6 \
--save_total_limit 2 \
--logging_steps 5 \
--output_dir output \
--warmup_ratio 0.05 \
--dataloader_num_workers 4 \
--max_completion_length 1024 \
--reward_funcs accuracy format \
--num_generations 32 \
--system examples/train/grpo/prompt.txt \
--deepspeed zero3 \
--temperature 1.0 \
--top_p 1.0 \
--top_k 80 \
--attn_impl flash_attn \
--log_completions true \
--async_generate false \
--offload_optimizer true \
--offload_model true \
--padding_free true \
--sequence_parallel_size 4 \
--dataloader_drop_last true \
--sleep_level 1
@@ -0,0 +1,35 @@
# Env: 8 * H800
# Max Length: 65536
# GPU Memory: 8 * 80GiB, Training Speed 18.97s/it
NPROC_PER_NODE=8 \
CELOSS_PARALLEL_SIZE=2048 \
swift sft \
--model Qwen/Qwen3.5-4B \
--dataset 'AI-ModelScope/LongAlpaca-12k' \
--load_from_cache_file true \
--tuner_type lora \
--torch_dtype bfloat16 \
--per_device_train_batch_size 2 \
--target_modules all-linear \
--gradient_accumulation_steps 8 \
--save_total_limit 2 \
--save_only_model true \
--save_steps 50 \
--max_length 65535 \
--warmup_ratio 0.05 \
--attn_impl flash_attn \
--logging_steps 1 \
--use_logits_to_keep false \
--sequence_parallel_size 4 \
--padding_free true
# Train: 1%| | 1/189 [02:41<8:25:06, 161.21s/it]
# {'loss': '1.461', 'grad_norm': '1.705', 'learning_rate': '1e-05', 'token_acc': '0.6399', 'epoch': '0.016', 'global_step/max_steps': '1/189', 'elapsed_time': '2m 41s', 'remaining_time': '8h 25m 20s', 'memory(GiB)': '67.95', 'train_speed(s/it)': '161.3'}
# {'loss': '1.484', 'grad_norm': '1.666', 'learning_rate': '2e-05', 'token_acc': '0.6324', 'epoch': '0.032', 'global_step/max_steps': '2/189', 'elapsed_time': '3m 55s', 'remaining_time': '6h 6m 35s', 'memory(GiB)': '68.05', 'train_speed(s/it)': '117.6'}
# {'loss': '1.477', 'grad_norm': '1.767', 'learning_rate': '3e-05', 'token_acc': '0.6311', 'epoch': '0.048', 'global_step/max_steps': '3/189', 'elapsed_time': '4m 48s', 'remaining_time': '4h 57m 21s', 'memory(GiB)': '68.05', 'train_speed(s/it)': '95.92'}
# {'loss': '1.498', 'grad_norm': '1.683', 'learning_rate': '4e-05', 'token_acc': '0.6355', 'epoch': '0.064', 'global_step/max_steps': '4/189', 'elapsed_time': '5m 36s', 'remaining_time': '4h 18m 56s', 'memory(GiB)': '68.05', 'train_speed(s/it)': '83.98'}
# {'loss': '1.422', 'grad_norm': '1.528', 'learning_rate': '5e-05', 'token_acc': '0.6329', 'epoch': '0.08', 'global_step/max_steps': '5/189', 'elapsed_time': '6m 17s', 'remaining_time': '3h 51m 17s', 'memory(GiB)': '68.05', 'train_speed(s/it)': '75.42'}
# {'loss': '1.322', 'grad_norm': '1.203', 'learning_rate': '6e-05', 'token_acc': '0.6457', 'epoch': '0.096', 'global_step/max_steps': '6/189', 'elapsed_time': '6m 53s', 'remaining_time': '3h 30m 1s', 'memory(GiB)': '68.05', 'train_speed(s/it)': '68.86'}
# ...
# Train: 24%|██▍ | 46/189 [17:53<45:13, 18.97s/it]
# {'loss': '1.049', 'grad_norm': '0.6095', 'learning_rate': '9.035e-05', 'token_acc': '0.7018', 'epoch': '0.736', 'global_step/max_steps': '46/189', 'elapsed_time': '17m 54s', 'remaining_time': '55m 38s', 'memory(GiB)': '68.06', 'train_speed(s/it)': '23.34'}
@@ -0,0 +1,25 @@
CUDA_VISIBLE_DEVICES=0,1,2,3 \
NPROC_PER_NODE=4 \
swift sft \
--model Qwen/Qwen3-Reranker-0.6B \
--task_type generative_reranker \
--loss_type pointwise_reranker \
--tuner_type full \
--dataset MTEB/scidocs-reranking \
--load_from_cache_file true \
--split_dataset_ratio 0.05 \
--eval_strategy steps \
--output_dir output \
--eval_steps 100 \
--num_train_epochs 1 \
--save_steps 200 \
--per_device_train_batch_size 2 \
--per_device_eval_batch_size 2 \
--gradient_accumulation_steps 8 \
--dataset_num_proc 8 \
--learning_rate 6e-6 \
--label_names labels \
--dataloader_drop_last true \
--sequence_parallel_size 4 \
--padding_free true \
--attn_impl flash_attn
@@ -0,0 +1,31 @@
CUDA_VISIBLE_DEVICES=0,1 \
NPROC_PER_NODE=2 \
swift sft \
--model Qwen/Qwen2.5-0.5B \
--tuner_type lora \
--dataset 'DAMO_NLP/jd:cls#2000' \
--load_from_cache_file true \
--split_dataset_ratio 0.01 \
--torch_dtype bfloat16 \
--num_train_epochs 1 \
--per_device_train_batch_size 1 \
--per_device_eval_batch_size 1 \
--learning_rate 1e-4 \
--lora_rank 8 \
--lora_alpha 32 \
--target_modules all-linear \
--gradient_accumulation_steps 16 \
--eval_steps 50 \
--save_steps 50 \
--save_total_limit 2 \
--logging_steps 5 \
--max_length 2048 \
--output_dir output \
--warmup_ratio 0.05 \
--dataloader_num_workers 4 \
--num_labels 2 \
--task_type seq_cls \
--use_chat_template false \
--sequence_parallel_size 2 \
--padding_free true \
--attn_impl flash_attn