Text Generation
Transformers
Safetensors
Kernels
English
laguna_dense
moe-to-dense
densification
laguna
cuda
sft
code
conversational
custom_code
Instructions to use EvanOLeary/laguna-xs2-dense-k8-cuda-sft with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use EvanOLeary/laguna-xs2-dense-k8-cuda-sft with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="EvanOLeary/laguna-xs2-dense-k8-cuda-sft", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("EvanOLeary/laguna-xs2-dense-k8-cuda-sft", trust_remote_code=True, device_map="auto") - Kernels
How to use EvanOLeary/laguna-xs2-dense-k8-cuda-sft with Kernels:
# !pip install kernels from kernels import get_kernel # a version (or an explicit revision) is required; see the "Files and versions" tab for the available ones kernel = get_kernel("EvanOLeary/laguna-xs2-dense-k8-cuda-sft", version=1) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use EvanOLeary/laguna-xs2-dense-k8-cuda-sft with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "EvanOLeary/laguna-xs2-dense-k8-cuda-sft" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "EvanOLeary/laguna-xs2-dense-k8-cuda-sft", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/EvanOLeary/laguna-xs2-dense-k8-cuda-sft
- SGLang
How to use EvanOLeary/laguna-xs2-dense-k8-cuda-sft 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-dense-k8-cuda-sft" \ --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": "EvanOLeary/laguna-xs2-dense-k8-cuda-sft", "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 "EvanOLeary/laguna-xs2-dense-k8-cuda-sft" \ --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": "EvanOLeary/laguna-xs2-dense-k8-cuda-sft", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use EvanOLeary/laguna-xs2-dense-k8-cuda-sft with Docker Model Runner:
docker model run hf.co/EvanOLeary/laguna-xs2-dense-k8-cuda-sft
Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -78,10 +78,20 @@ KernelBook (Triton) 40% · OpenCodeInstruct (Python) 30% · **SakanaAI CUDA-C++
|
|
| 78 |
### SFT curve (CUDA, 400 steps, CE 0.68→0.32)
|
| 79 |

|
| 80 |
|
| 81 |
-
## KernelBench-Lite
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 85 |
|
| 86 |
---
|
| 87 |
## Stage 3 — RFT (reserved — running now)
|
|
|
|
| 78 |
### SFT curve (CUDA, 400 steps, CE 0.68→0.32)
|
| 79 |

|
| 80 |
|
| 81 |
+
## Results — KernelBench-Lite (subprocess-isolated, cross-validated) — VALID
|
| 82 |
+
Reliable on simple elementwise ops; consistent across **three independent harnesses**:
|
| 83 |
+
|
| 84 |
+
| Op | pass@4 (best-of-4) | pass@3 (isolated) | speedup vs eager |
|
| 85 |
+
|---|---|---|---|
|
| 86 |
+
| **ReLU** | **3/4 correct** | 2/3 correct | **0.93×** |
|
| 87 |
+
| **Tanh** | **3/4 correct** | 2/3 correct | — |
|
| 88 |
+
| Sigmoid | 0/4 | 0/3 | fails |
|
| 89 |
+
|
| 90 |
+
ReLU & Tanh ~70–75% at pass@k (three runs agree). Harder ops fail on **float4-cast bugs**
|
| 91 |
+
(`float4* v = float4* x;` vs `reinterpret_cast<float4*>(x)`) → the RFT compile-reward target.
|
| 92 |
+
**vs teacher:** 11× smaller, 12× less VRAM, **+26% faster decode (32.1 vs 25.4 tok/s)**; neither beats
|
| 93 |
+
PyTorch eager on single elementwise ops (bandwidth-bound — needs fusion). Eval must be process-isolated
|
| 94 |
+
(a bad kernel corrupts the CUDA context). Code/results: [github.com/Tyronita/laguna-dense-cuda-kernels](https://github.com/Tyronita/laguna-dense-cuda-kernels).
|
| 95 |
|
| 96 |
---
|
| 97 |
## Stage 3 — RFT (reserved — running now)
|