DeepSeek V4 Flash#
This guide describes GRPO training of DeepSeek V4 Flash and Flash Base with the AutoModel training backend and vLLM generation.
Important
Status: Functionally Ready. The reference recipe has been validated with an end-to-end colocated run on 16 H100 nodes. Its five-step smoke test is registered in the recurring nightly suite. This is not a long-run convergence claim; see Known Limitations for precision alignment and hardware coverage.
Support Status#
Model |
Training backend |
Validated training parallelism |
Generation backend |
Status |
|---|---|---|---|---|
|
AutoModel |
TP1 + CP8 + EP128 |
vLLM with TP8 + EP1 |
Functionally Ready |
|
AutoModel |
TP1 + CP8 + EP128 |
vLLM with TP8 + EP1 |
Functionally Ready |
Validated Scope#
Models:
deepseek-ai/DeepSeek-V4-Flash-0731anddeepseek-ai/DeepSeek-V4-Flash-Base.Algorithm: GRPO with
DAPOMath17Kfor training andDAPOMathAIME2024for validation.Training backend: AutoModel with BF16 training, activation checkpointing, TileLang attention, and the DeepEP expert dispatcher.
Training parallelism: TP1, CP8, and EP128 on 128 GPUs. CP and EP are model-owned parallel dimensions that coexist on the same device mesh; they are not multiplicative.
Generation backend: vLLM with TP8, EP1, blockwise FP8 weights, and the
fp8_ds_mlaKV cache.Sequence length: 1,024 prompt tokens plus up to 2,048 response tokens, for a maximum total sequence length of 3,072.
Reference allocation: 16 nodes with 8 H100 GPUs per node.
Deployment: Colocated training and generation on the same GPUs. Only this deployment on H100 has been tested.
MTP: Disabled by setting
num_nextn_predict_layers: 0.
Recipe YAML files under examples/configs/recipes/ are the source of truth for
resource, parallelism, dataset, and checkpointing settings.
How to Run#
1. Prepare the Environment#
Use the dependency lock and AutoModel submodule recorded by the NeMo RL revision that contains this guide. From the repository root, run:
git submodule update --init --recursive
uv sync --locked
For a large multi-node run, use a container built from the same checkout so its backend-specific worker environments match the lockfile. See the installation guide and Dependency Management for container and development setup details.
The recipe downloads the following model and datasets from Hugging Face:
deepseek-ai/DeepSeek-V4-Flash-0731ordeepseek-ai/DeepSeek-V4-Flash-BaseBytedTsinghua-SIA/DAPO-Math-17kBytedTsinghua-SIA/AIME-2024
Set HF_HOME to a cache visible from every node:
export HF_HOME=<path-to-shared-huggingface-cache>
export WANDB_API_KEY=<your-wandb-api-key>
The reference recipe enables W&B logging. If W&B is not configured, pass
logger.wandb_enabled=false when launching.
2. Choose the Reference Recipe#
Model |
Algorithm |
Backend |
Scale |
Recipe |
|---|---|---|---|---|
DeepSeek-V4-Flash-0731 |
GRPO |
AutoModel |
16n8g |
The associated
grpo-deepseek-v4-flash-0731-16n8g-automodel-cp8ep128.sh
test runs five training steps and is registered as a recurring nightly
functional test in nightly.txt.
3. Launch#
From a 16-node allocation with 8 H100 GPUs per node, launch the standard GRPO entry point:
uv run examples/run_grpo.py \
--config examples/configs/recipes/llm/grpo-deepseek-v4-flash-0731-16n8g-automodel-cp8ep128.yaml
The recipe defaults to DeepSeek-V4-Flash-0731. To run Flash Base with the
same configuration, override the model and tokenizer:
uv run examples/run_grpo.py \
--config examples/configs/recipes/llm/grpo-deepseek-v4-flash-0731-16n8g-automodel-cp8ep128.yaml \
policy.model_name=deepseek-ai/DeepSeek-V4-Flash-Base \
policy.tokenizer.name=deepseek-ai/DeepSeek-V4-Flash-Base
See the GRPO guide for algorithm and common configuration
details and Cluster Setup for multi-node launch setup.
Before changing the node count, review the training and generation parallel
dimensions instead of changing cluster.num_nodes alone.
Important Recipe Settings#
policy.dequantize_base_checkpoint: trueloads either checkpoint as BF16 weights for training. Flash-0731 stores its expert weights in FP4, while Flash Base stores them in FP8. Training-side FP8 fake quantization is not enabled.policy.hf_config_overrides.expert_dtype: fp8selects the FP8 expert layout used for generation. Keep the checkpoint’s ownquantization_configintact so AutoModel can dequantize the training weights correctly.Generation uses DeepGEMM with UE8M0 power-of-two scales. Keep
VLLM_USE_DEEP_GEMM_E8M0=1,use_deep_gemm: true, andpow2_weight_scaling_factors: truealigned.policy.generation.vllm_kwargs.attention_config.backend: FLASHMLA_SPARSE_DSV4pins the validated FlashMLA sparse attention backend.The policy tokenizer uses
chat_template: deepseek_v4, while vLLM usestokenizer_mode: deepseek_v4. The reference recipe disables thinking mode.Eager execution (
enforce_eager: true) remains part of the validated configuration.
Reference Training Curves#
The following curves were produced with DeepSeek-V4-Flash-0731 on the
16-node H100 configuration described above. They show the raw, unsmoothed
training and validation metrics through training step 50.

Known Limitations#
The checked-in support is limited to
DeepSeek-V4-Flash-0731andDeepSeek-V4-Flash-Basewith the AutoModel training backend and vLLM generation. DeepSeek V4 Pro, Megatron training, and SGLang generation are not covered by this guide.Hardware and deployment coverage: Only colocated training and generation on H100 GPUs have been tested. Non-colocated deployments and Blackwell GPUs have not been validated. On Blackwell, DeepGEMM with E8M0 scales has a potential refit issue: changes to the FP8 scale layout can leave the MoE kernel referencing stale scales.
Training uses dequantized BF16 weights, while generation uses refitted FP8 weights. This numerical precision mismatch causes significant train/inference inconsistency. The current recipe does not include training-side quantization-aware training (QAT) to reduce this mismatch.
MTP is disabled in the reference configuration.
Long-run convergence has not been documented for this recipe.
The separate
deepseek-v4-support development branch
includes QAT through training-side FP8 fake quantization. It reduces the
train/inference mismatch and has enabled stable training beyond 100 steps.
See the development branch guide
for its recipes and validation results.
These results apply to that development branch, not the current recipe. The
branch uses an older NeMo-RL codebase and a customized AutoModel dependency,
so its changes cannot be merged directly into main. We plan to upstream the
relevant changes incrementally into NeMo-RL main and the upstream dependency
frameworks, including AutoModel.