Views
No views yet
1from transformers import AutoModelForCausalLM, AutoTokenizer
2
3repo = "brozonoyer/relay-fastdllm-v2-c40m60-relay-step200"
4tokenizer = AutoTokenizer.from_pretrained(repo, trust_remote_code=True)
5model = AutoModelForCausalLM.from_pretrained(repo, trust_remote_code=True)config.json ships with use_relay=True and relay_layer=-1; the
safetensors shard contains a model.relay_layer_norm.{weight,bias} tensor
that the bundled modeling.py instantiates and consumes inside the
2-step relay forward (paper Algorithm 1).relay/fast-dllm-v2/v2/):1mkdir -p evalplus_results
2
3# HumanEval+
4python scripts/generate_evalplus_jsonl.py \
5 --model_path brozonoyer/relay-fastdllm-v2-c40m60-relay-step200 \
6 --dataset humaneval --use_carry --threshold 0.85 \
7 --output_jsonl evalplus_results/relay_humaneval.jsonl
8evalplus.evaluate --dataset humaneval --samples evalplus_results/relay_humaneval.jsonl
9
10# MBPP+
11python scripts/generate_evalplus_jsonl.py \
12 --model_path brozonoyer/relay-fastdllm-v2-c40m60-relay-step200 \
13 --dataset mbpp --use_carry --threshold 0.85 \
14 --output_jsonl evalplus_results/relay_mbpp.jsonl
15evalplus.evaluate --dataset mbpp --samples evalplus_results/relay_mbpp.jsonl--use_carry enables the 2-step relay-state carry at inference; both
checkpoints were trained with relay on, so it is required at eval to match
the reported numbers.Efficient-Large-Model/Fast_dLLM_v2_1.5B
on the 60k OpenCodeInstruct + OpenMathInstruct-2 c40m60 mixture
(24 000 code + 36 000 math rows). Effective batch size 32, learning rate
5e-6, BD block 32 / sub-block 8, threshold 0.85. The RELAY
variant uses
bptt_use_relay=1, bptt_stop_grad_h_s=0.relay/fast-dllm-v2/v2/):1USE_RELAY=1 BPTT_STOP_GRAD_H_S=0 \
2 sbatch train_scripts/finetune_opencode_openmath_bptt.sbatch