Instructions to use EvanOLeary/laguna-xs2-densify-smoke with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use EvanOLeary/laguna-xs2-densify-smoke with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="EvanOLeary/laguna-xs2-densify-smoke")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("EvanOLeary/laguna-xs2-densify-smoke", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use EvanOLeary/laguna-xs2-densify-smoke with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "EvanOLeary/laguna-xs2-densify-smoke" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "EvanOLeary/laguna-xs2-densify-smoke", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/EvanOLeary/laguna-xs2-densify-smoke
- SGLang
How to use EvanOLeary/laguna-xs2-densify-smoke 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 "EvanOLeary/laguna-xs2-densify-smoke" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "EvanOLeary/laguna-xs2-densify-smoke", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "EvanOLeary/laguna-xs2-densify-smoke" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "EvanOLeary/laguna-xs2-densify-smoke", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use EvanOLeary/laguna-xs2-densify-smoke with Docker Model Runner:
docker model run hf.co/EvanOLeary/laguna-xs2-densify-smoke
Laguna-XS.2 β Dense β Smoke-Test Report (reconstruction pretraining)
This repository contains an artifact from the research paper Pruning and Distilling Mixture-of-Experts into Dense Language Models. The official code for this framework can be found at krafton-ai/moe-to-dense.
First end-to-end validation of the dense reconstruction-pretraining loop for densifying
poolside/Laguna-XS.2 (33B/3B-active MoE) into a ~3.3B dense student
(cm2435-new/laguna-xs2-dense-k8-copied-shell). Teacher-forced, per-layer MSE+cosine,
routed_dense-only trainable. Hardware: 1Γ H100 80 GB.
Config (smoke)
| Layers trained | 8 (subset β H100 memory; full 39 runs on GB300 / via Adafactor) |
| Steps | 20 Β· seq 1024 Β· batch 1 |
| Optimizer | AdamW @ 2e-4 |
| Loss | mean_l( MSE + 0.05Β·(1βcos) ), attention-masked |
| Data | nvidia/OpenCodeInstruct (streamed) |
Result
| metric | step 1 | step 20 | Ξ |
|---|---|---|---|
| total loss | 0.0486 | 0.0332 | β32 % |
| cosine-loss (1βcos) | 0.949 | 0.575 (low 0.575) | β33 % |
| mean MSE | ~9e-4 | ~1.4e-3 | noisy (batch 1) |
TOTAL LOSS (MSE + 0.05Β·cos) COSINE-LOSS (1 β cos to teacher)
0.0486 β 0.949 β
0.0451 β 0.874 β
0.0404 β 0.775 β
0.0369 ββ 0.725 βββ
0.0335 ββ β 0.655 ββ β
0.0311 β β β 0.575 β
step 1 βββββββββββΊ 20 step 1 βββββββββββΊ 20
Read
- The loop works end-to-end on real teacher+student weights: teacher forward + hooks
capture each MoE block's
(x_l, y_l), studentrouted_dense_l(x_l)predicts, masked MSE+cosine backprops intorouted_denseonly. - Cosine-loss 0.95 β 0.58 is the signal: random
routed_denserotates toward the teacher's output direction within 20 steps. - Cosine starting at ~0.95 confirms random init is near-orthogonal to the teacher β motivates DO-ACP warm-start (concatenate selected experts) as the next lever.
- MSE is noisy/non-monotone at batch 1; deeper layers carry larger magnitudes (seen at scale).
Status
- β Smoke validated β scaled run launched: all 39 layers, Adafactor (fits 80 GB at 77 GB), eff-batch 2, 2000 steps (~8.2M tokens), checkpoints every 250.
- Artifacts:
loss_curve.png,metrics.jsonl(this repo). Full report + recipe comparison in companion gists.
Recipe: RADLADS step-1 (arXiv:2505.03005) / KRAFTON MoEβDense feature-reconstruction (arXiv:2605.28207).
