Repository navigation
feat(ling3): add Ling-3.0-tiny DFlash recipe #67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
5a96c33
f608389
b18885d
a605809
6b8366c
41fb28a
5a782c6
2dfb2f6
c736066
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| { | ||
| "architectures": ["DFlashDraftModel"], | ||
| "model_type": "dflash", | ||
| "hidden_size": 1536, | ||
| "intermediate_size": 4608, | ||
| "num_hidden_layers": 5, | ||
| "num_attention_heads": 12, | ||
| "num_key_value_heads": 4, | ||
| "head_dim": 128, | ||
| "vocab_size": 157184, | ||
| "rms_norm_eps": 1e-6, | ||
| "max_position_embeddings": 131072, | ||
| "rope_theta": 6000000.0, | ||
| "num_target_layers": 5, | ||
| "target_hidden_size": 1536, | ||
| "target_num_hidden_layers": 24, | ||
| "target_layer_ids": [1, 6, 11, 16, 21], | ||
| "mask_token_id": 156894, | ||
| "tie_word_embeddings": false | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,104 @@ | ||
| # Release training starting point: three passes, held-out eval and checkpoints. | ||
| # Hyperparameters are not a convergence/quality claim; see docs/user-guide/recipes.md. | ||
| # Ling-3.0-tiny BF16 Target + five-layer dense DFlash Draft. | ||
| # Data must use Ling's checkpoint chat template; see the recipe document. | ||
| # Starting three-GPU allocation. Scale replicas from measured service rates. | ||
| model: | ||
| target_model_path: ${oc.env:ASPEC_TARGET_MODEL,inclusionAI/Ling-3.0-tiny} | ||
| native_context_length: 131072 | ||
| trust_remote_code: true | ||
| draft_model_config: aspec/config/dflash_ling3_tiny_draft_config.json | ||
| embedding_key: model.word_embeddings.weight | ||
| lm_head_key: lm_head.weight | ||
| norm_key: model.norm.weight | ||
|
|
||
| dataset: | ||
| eval_interval: 100 | ||
| eval_micro_batch_size: 1 | ||
| train_data_path: ${oc.env:ASPEC_TRAIN_DATA} | ||
| eval_data_path: ${oc.env:ASPEC_EVAL_DATA} | ||
| chat_template: ling3 | ||
|
sysuTobo marked this conversation as resolved.
Resolved
|
||
| prompt_key: conversations | ||
| min_loss_tokens: 32 | ||
| shuffle_dataset: true | ||
| dataset_seed: 42 | ||
|
|
||
| training: | ||
| attention_backend: flex_attention | ||
| draft_context_parallel_size: 1 | ||
| micro_batch_size: 1 | ||
| draft_accumulation_steps: 2 | ||
| learning_rate: 6e-4 | ||
| min_lr: 6e-5 | ||
| weight_decay: 0.0 | ||
| max_grad_norm: 1.0 | ||
| max_seq_length: 4096 | ||
| num_epochs: 3 | ||
| warmup_ratio: 0.04 | ||
| seed: 42 | ||
| continual_training: false | ||
| deterministic_anchor_sampling: false | ||
| training_num_gpus_per_node: 2 | ||
| training_num_nodes: 1 | ||
| placement_strategy: inference_first | ||
| fsdp_strategy: REPLICATE | ||
| fsdp_reduce_dtype: bfloat16 | ||
| compile_model: false | ||
| max_concurrent_batches: 1 | ||
| streaming_dispatch_with_training: true | ||
| pipeline_dispatch_with_training: true | ||
| prefetch_depth: 1 | ||
| save_interval: 100 | ||
| save_per_epoch: false | ||
| save_final_checkpoint: true | ||
| max_checkpoints: 2 | ||
| dflash_block_size: 7 | ||
| dflash_packing: false | ||
| dflash_num_target_layers: 5 | ||
| dflash_num_anchors: 512 | ||
| dflash_loss_objective: decay | ||
| dflash_ce_loss_alpha: 1.0 | ||
| dflash_l1_loss_alpha: 0.0 | ||
|
|
||
| inference: | ||
| inference_engine_type: sgl | ||
| # CE-only DFlash training does not consume the Target final hidden state. | ||
| store_last_hidden_states: false | ||
| # Native Ling runtime publishes GPU features through its forward-hook API. | ||
| # Normal Target attention state is retained; optimized direct prefill is disabled. | ||
| target_prefill_memory_optimized: false | ||
| inference_num_gpus: 1 | ||
| inference_num_gpus_per_engine: 1 | ||
| inference_num_gpus_per_node: 3 | ||
| inference_fetch_batch: 4 | ||
| inference_buffer_threshold: 4 | ||
| max_sample_pool_size: 8 | ||
| inference_batch_size: 2 | ||
| sglang: | ||
| tp_size: 1 | ||
| mem_fraction_static: 0.6 | ||
|
|
||
| mooncake: | ||
| data_plane: transfer_engine | ||
| protocol: nvlink_intra | ||
| require_nvlink: true | ||
| enable_gpu_direct: true | ||
| allow_host_fallback: false | ||
| enable_hard_pin: true | ||
| max_seq_len: 4096 | ||
| hidden_dim: 1536 | ||
| global_segment_size: 16GB | ||
| local_buffer_size: 4GB | ||
| host_buffer_size: 1GB | ||
| gpu_ring_slots: 32 | ||
| source_gpu_ring_slots: 32 | ||
| destination_gpu_ring_slots: 1 | ||
| kv_lease_ttl_s: 600 | ||
| get_retry_max_wait_seconds: 600 | ||
|
|
||
| logging: | ||
| report_to: none | ||
| debug: | ||
| enable_perf_metrics: true | ||
| output_dir: outputs/ling3-tiny-dflash | ||
| cache_dir: cache/ling3-tiny-dflash | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,6 +7,7 @@ tokens or feature-layer offsets. Model/dataset licenses are independent of ASpec | |
| | Target | YAML | Starting allocation | Draft | | ||
| | --- | --- | --- | --- | | ||
| | Ling-3.0-tiny | `configs/recipes/ling3_tiny_dspark.yaml` | 1 Target + 1 Draft GPU | Two-layer Dense DSpark | | ||
| | Ling-3.0-tiny DFlash | `configs/recipes/ling3_tiny_dflash.yaml` | 1 Target + 2 Draft GPUs | Five-layer Dense DFlash | | ||
| | Ling-3.0-flash BF16 | `configs/recipes/ling3_flash_dspark.yaml` | TP2 Target + 1 Draft GPU | Five-layer Dense DSpark | | ||
| | Ling-3.1-flash FP8 | `configs/recipes/ling31_flash_mla_moe_dspark.yaml` | TP4/EP4 Target + 4 Draft GPUs | Five-layer BF16 materialized MLA + Ling MoE | | ||
|
|
||
|
|
@@ -78,10 +79,16 @@ properly prepared compatible data supplied by the user. | |
| Use [exact recovery](training.md) with the same model/data/routing and LR horizon, a complete | ||
| checkpoint and a new output directory. Ling MoE router bias/control state is part of recovery. | ||
|
|
||
| Dense Ling DSpark uses faithful SGLang-format export with the correct embedding key. Qwen/Ling | ||
| MoE export declares the `dflash_moe_v1` loader requirement and the verified `moe_ep_size=1` boundary; | ||
| it is not an expert-parallel serving promise. MLA + MoE requires `--format aspec` and strict | ||
| native loading. Target hybrid KDA/MLA does not make every Draft structure or Target cache compatible. | ||
| Dense Ling DSpark and DFlash drafts share the faithful SGLang-format export boundary; supply the | ||
|
sysuTobo marked this conversation as resolved.
Resolved
|
||
| Target path and the Ling embedding key explicitly. Qwen/Ling MoE export declares the | ||
| `dflash_moe_v1` loader requirement and the verified `moe_ep_size=1` boundary; it is not an | ||
| expert-parallel serving promise. MLA + MoE requires `--format aspec` and strict native loading. | ||
| Target hybrid KDA/MLA does not make every Draft structure or Target cache compatible. | ||
| Speculative decode is a separate boundary: SGLang 0.5.21's `DFLASH` mode calls | ||
| `set_dflash_layers_to_capture`, while the Ling Target exposes only | ||
| `set_dspark_layers_to_capture`, so `aspec evaluate` stops during speculative engine | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for documenting where decode stops on the pinned runtime. One non-blocking follow-up for the shared evaluator: training now passes a raw row’s Could the evaluator forward
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done in 41fb28a — I also checked the decode limitation you flagged against the pinned runtime rather than taking it on trust. In SGLang |
||
| initialization. Training and strict native reload are unaffected; decoding a Ling DFlash Draft needs a | ||
| runtime that wires the Ling capture hook into the DFlash path. | ||
|
|
||
| Short train/resume/export checks establish functionality. They do not establish convergence, | ||
| acceptance or decode acceleration. See [support](../support.md) and [structure choices](structures.md). | ||
Uh oh!
There was an error while loading. Please reload this page.