Minimal runnable VERL reinforcement learning workflow (Ascend/NPU friendly).
Hard constraints
- Image version
IMAGE_TAG:- User/Ops has specified: its value must be used
- Unspecified default:
- 910B:
verl-8.5.0-910b-ubuntu22.04-py3.11-v0.7.1 - A3:
verl-8.5.0-a3-ubuntu22.04-py3.11-v0.7.1
- 910B:
- You can also choose your own from Quay tags:
https://quay.io/repository/ascend/verl?tab=tags&tag=latest
- Modify or create
examples/**/run_*.shafterwards, unless the user explicitly says "write only, do not run", you must run a smoke test once (at leasttrainer.total_epochs=1 trainer.test_freq=1), and return the absolute log path andtail -fcommand. - When using Megatron training backend,
use_flash_attn=Truemust be enabled as a default parameter (at least on the actor side; if the ref side does not inherit it, explicitly add it).
Minimal input variables
IMAGE_REPO=quay.io/ascend/verlIMAGE_TAG(per the rules above)ASCEND_HW(optional:a3|910b, used to select the default tag)TRAIN_BACKEND(optional:fsdp|megatron,defaultfsdp; choose based on the user's requirements)WORKSPACE=$(pwd)、EXAMPLES_DIR=$WORKSPACE/examplesDATA_DIR=$HOME/data/gsm8kMODEL_PATH=<绝对路径,且末级目录为具体模型名>NGPUS=1、NNODES=1、LOG=verl_run.logSCRIPT_QUERY(optional),HF_ENDPOINT(optional)
Execution steps
- Preflight: check whether any process is occupying the NPU (release it first if necessary)
# 列出占用 NPU 的进程(PID/进程名/显存)
/usr/local/sbin/npu-smi info
# 如果看到有进程占卡,先确认是否为你自己的训练/推理任务;
# 建议先“优雅退出”,不行再 kill:
kill <PID>
sleep 3
/usr/local/sbin/npu-smi info
# 仍未退出再强杀(谨慎使用)
kill -9 <PID>
- Step 0: Environment/Image
Referencereferences/docker-ascend.md - Step 1: Data processing (generate parquet)
Referencereferences/data-preprocess.md - Step 2: Model preparation (ModelScope + path conventions)
Referencereferences/model-download.md - Step 3A:
main_ppotraining (choose by backend)- Default FSDP: suitable for most scenarios, refer to
references/main-ppo-quickstart.mdFSDP example - Megatron: choose when the user explicitly requests it or when large models/parallel strategies require it, refer to the Megatron example in the same file
- Default append:
+actor_rollout_ref.actor.megatron.override_transformer_config.use_flash_attn=True - If the ref side does not inherit this configuration, then append:
++actor_rollout_ref.ref.megatron.override_transformer_config.use_flash_attn=True(when this key already exists, do not use a single+)。
- Default append:
- Default FSDP: suitable for most scenarios, refer to
- Step 3B: examples script training and smoke test
Referencereferences/examples-scripts.md - Step 4: checkpoint merging
Referencereferences/checkpoint-merge.md - FAQ / Troubleshooting
Referencereferences/faq.md