Instructions to use Flink-ddd/MoE-Pilot-Align-2.7B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Flink-ddd/MoE-Pilot-Align-2.7B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Flink-ddd/MoE-Pilot-Align-2.7B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Flink-ddd/MoE-Pilot-Align-2.7B") model = AutoModelForCausalLM.from_pretrained("Flink-ddd/MoE-Pilot-Align-2.7B", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Flink-ddd/MoE-Pilot-Align-2.7B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Flink-ddd/MoE-Pilot-Align-2.7B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Flink-ddd/MoE-Pilot-Align-2.7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Flink-ddd/MoE-Pilot-Align-2.7B
- SGLang
How to use Flink-ddd/MoE-Pilot-Align-2.7B 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 "Flink-ddd/MoE-Pilot-Align-2.7B" \ --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": "Flink-ddd/MoE-Pilot-Align-2.7B", "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 "Flink-ddd/MoE-Pilot-Align-2.7B" \ --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": "Flink-ddd/MoE-Pilot-Align-2.7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Flink-ddd/MoE-Pilot-Align-2.7B with Docker Model Runner:
docker model run hf.co/Flink-ddd/MoE-Pilot-Align-2.7B
MoE-Pilot-Align-2.7B
Overview
MoE-Pilot-Align-2.7B is a high-performance Sparse Mixture-of-Experts (MoE) model (14.3B total / 2.7B active), meticulously adapted and fine-tuned on a standard 8-GPU SXM node.
This project is not a conventional fine-tuning exercise; it is an Infrastructure-Level Alignment showcase. It validates a production-ready pipeline for scaling MoE architectures by resolving critical bottlenecks in distributed initialization, heterogeneous memory management, and collective communication.
The Engine: RL-Kernel
To achieve maximum throughput and memory efficiency during the alignment phase, this model is powered by RL-Kernel, an extreme post-training infrastructure optimized for NVIDIA and AMD GPUs.
- Breaking the Memory Wall: Optimized for GRPO (Group Relative Policy Optimization), enabling a Group Size of G=256 on a single A100 by keeping additional VRAM usage constant (~0.5GB).
- Extreme Sampling Latency: Integrated with FlashInfer and custom fused kernels, achieving up to 399x speedup in the rollout phase compared to native PyTorch.
- Universal Backend: Native support for AMD (ROCm/AITER) and NVIDIA (CUDA), ensuring seamless cross-platform performance.
Engineering & Infrastructure Innovations
1. Zero-Deadlock AOT Kernel Orchestration
In high-density 8-GPU environments, simultaneous JIT (Just-in-Time) compilation of MoE fused kernels often triggers distributed deadlocks due to I/O race conditions during the NCCL handshake.
- Innovation: Implemented an Ahead-of-Time compilation orchestrator. By decoupling CUDA/ROCm kernel building from the training lifecycle, we achieved zero-latency "Cold Starts" and eliminated synchronization timeouts.
2. Reflection-Based Parameter Metadata Injection
Standard DeepSpeed-ZeRO engines require precise expert-group tagging to avoid AssertionError during state partitioning. Hard-coded tagging is fragile and lacks portability.
- Solution: Developed a Reflection-based Metadata Injector. At the optimizer setup stage, the system dynamically scans tensors for
allreduceattributes and naming patterns to injectmoe: Truetags. - Impact: Ensured seamless compatibility between the MoE expert layers and the ZeRO-1/2 optimizer state sharding, maximizing VRAM efficiency on the 80GB A100 footprint.
3. Topology-Aware Parallelism (EP8)
- Parallelism Strategy: Optimized for a Single-Node 8-GPU Full-Mesh topology using Expert Parallelism (EP=8).
- Communication Tuning: Refactored the
All-to-Allcollective primitives to match the NVLink 3.0 bi-directional bandwidth. By balancing the load across 32 total experts (4 experts per GPU), we maintained a stable throughput of 185+ TFLOPs per device.
Model Specifications
| Feature | Configuration |
|---|---|
| Architecture | Sparse MoE (Decoder-only) |
| Total Parameters | 14.3 Billion |
| Active Parameters | 2.7 Billion |
| Experts Count | 32 (Total) |
| Routing Strategy | Top-2 Gating with Load Balancing |
| Precision | Mixed Precision (BF16-O2) |
Hardware & Software Environment
- Compute: 1 x Node | 8 x NVIDIA A100 80GB SXM
- Interconnect: NVLink 3.0 (600 GB/s Full-Mesh)
- Framework: Custom Fork of Megatron-DeepSpeed
- CUDA/ROCm Compatibility: Validated on CUDA 12.4; Architectural design supports seamless porting to AMD MI300X/ROCm environments via RCCL optimization.
Community Quantizations
Special thanks to @mradermacher for providing GGUF weights: - GGUF Weights (Q2_K to Q8_0)
This repository serves as a technical benchmark for implementing production-scale MoE alignment protocols on next-generation heterogeneous compute clusters.
- Downloads last month
- 58