Instructions to use brozonoyer/relay-fastdllm-v2-c40m60-relay-sg-step200 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use brozonoyer/relay-fastdllm-v2-c40m60-relay-sg-step200 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="brozonoyer/relay-fastdllm-v2-c40m60-relay-sg-step200", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("brozonoyer/relay-fastdllm-v2-c40m60-relay-sg-step200", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use brozonoyer/relay-fastdllm-v2-c40m60-relay-sg-step200 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "brozonoyer/relay-fastdllm-v2-c40m60-relay-sg-step200" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "brozonoyer/relay-fastdllm-v2-c40m60-relay-sg-step200", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/brozonoyer/relay-fastdllm-v2-c40m60-relay-sg-step200
- SGLang
How to use brozonoyer/relay-fastdllm-v2-c40m60-relay-sg-step200 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "brozonoyer/relay-fastdllm-v2-c40m60-relay-sg-step200" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "brozonoyer/relay-fastdllm-v2-c40m60-relay-sg-step200", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "brozonoyer/relay-fastdllm-v2-c40m60-relay-sg-step200" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "brozonoyer/relay-fastdllm-v2-c40m60-relay-sg-step200", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use brozonoyer/relay-fastdllm-v2-c40m60-relay-sg-step200 with Docker Model Runner:
docker model run hf.co/brozonoyer/relay-fastdllm-v2-c40m60-relay-sg-step200
RELAY (sg) adaptation of Fast-dLLM v2 1.5B (c40m60, step 200)
Released alongside the paper Learned Relay Representations for Forward-Thinking Discrete Diffusion Models. Reproduces the RELAY (sg) row of Table 2.
Quick start
from transformers import AutoModelForCausalLM, AutoTokenizer
repo = "brozonoyer/relay-fastdllm-v2-c40m60-relay-sg-step200"
tokenizer = AutoTokenizer.from_pretrained(repo, trust_remote_code=True)
model = 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).
Reproduce the Table 2 numbers with EvalPlus
From the public release of the training code (e.g. relay/fast-dllm-v2/v2/):
mkdir -p evalplus_results
# HumanEval+
python scripts/generate_evalplus_jsonl.py \
--model_path brozonoyer/relay-fastdllm-v2-c40m60-relay-sg-step200 \
--dataset humaneval --use_carry --threshold 0.85 \
--output_jsonl evalplus_results/relay-sg_humaneval.jsonl
evalplus.evaluate --dataset humaneval --samples evalplus_results/relay-sg_humaneval.jsonl
# MBPP+
python scripts/generate_evalplus_jsonl.py \
--model_path brozonoyer/relay-fastdllm-v2-c40m60-relay-sg-step200 \
--dataset mbpp --use_carry --threshold 0.85 \
--output_jsonl evalplus_results/relay-sg_mbpp.jsonl
evalplus.evaluate --dataset mbpp --samples evalplus_results/relay-sg_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.
Training
200 optimizer steps starting from
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 (sg)
variant uses
bptt_use_relay=1, bptt_stop_grad_h_s=1.
Full training command (from relay/fast-dllm-v2/v2/):
USE_RELAY=1 BPTT_STOP_GRAD_H_S=1 \
sbatch train_scripts/finetune_opencode_openmath_bptt.sbatch
See the public release of the training code for the full pipeline.
- Downloads last month
- 9
Model tree for brozonoyer/relay-fastdllm-v2-c40m60-relay-sg-step200
Base model
Qwen/Qwen2.5-1.5B