Mixed-precision W4A16-MoE (Marlin) quantization of soketlabs/EKA-1 (26.3B total / 3.6B active RASLNet hybrid Mamba-2 + Latent MoE + MLA), engineered to run at full 65,536 context on a single 24 GB GPU (RTX 3090 / 4090, L4, A10G) while keeping 100% of sensitive layers in lossless BF16/FP32.
soketlabs/EKA-1 by Soket AI Labs (Project EKA / IndiaAI Mission, Apache-2.0)48.23 GiB → 18.27 GiB loaded, 17.85 GB on disk): Fits comfortably on a single 24 GB GPU with full 65,536 context (64K hybrid cache is only 263.8 MB batch=1: 23.8 MB fixed Mamba-2 state + 240 MB MLA cache).6.05 GB untouched BF16/FP32): All 23 Mamba-2 layers, all 6 MLA layers, all 23 shared experts, latent projections/norms, FP32 routers, and the 256K Indic embed_tokens + lm_head stay completely unquantized. Only the 23 × 128 routed Latent MoE experts (87.18% of parameters) are quantized to symmetric INT4 (group_size=64) using data-free per-group MSE-optimal clipping (zero English calibration bias across EKA-1's 22 Indian languages).3.20× batch speedup): Native EKA-1 expert dims (moe_latent_size=1344 = 21×64, moe_intermediate_size=1856 = 29×64) fail vLLM Marlin's min_thread_k=128 shape check and silently fall back to TritonWNA16Experts. Zero-padding routed expert weights to (1408, 1920) — with activation padding after fc1_latent_norm and slicing before fc2_latent_norm (included in this repo's vllm_patch/eka_v1.py) — is mathematically lossless and unlocks vLLM's fused MarlinExperts CUDA kernel:69.82 → 223.64 tok/s (3.20× faster on the same 24 GB A10G)68.44 → 67.84 tok/s (14.61–14.74 ms ITL — flat across 60K tokens!)98.6 ms @ 4K, 100.1 ms @ 16K, 192.2 ms @ 32K, 289.5 ms @ 61.4Kmax_tokens=4096, greedy): 83/100 (71/72 = 98.6% on finished traces) vs. BF16 82/100 (75/75)hi/bn/ta/te/kn): 5/5 (100% parity)1.4936 vs. BF16 1.4936 (+0.0000 exact match)All 24 GB runs were measured on a single NVIDIA A10G (24 GB) at max_model_len=65536 (--gpu-memory-utilization 0.91 --max-num-batched-tokens 1024 --max-num-seqs 16, PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True).
| Metric | Official BF16 (A100-80GB) |
Unpadded W4A16 Triton (1× 24 GB A10G) |
W4A16 Marlin (1× 24 GB A10G, this repo) |
|---|---|---|---|
| Loaded Weight VRAM | 48.23 GiB |
17.23 GiB |
18.27 GiB |
| MoE Kernel Backend | Unquantized Triton | TritonWNA16Experts |
MarlinExperts (Fused CUDA) |
| Max Context (1 GPU) | 65,536 (needs 80 GB) |
65,536 |
65,536 |
| Overall PPL (En/Hi/Hinglish/Code) | 7.9426 |
8.0256 (+1.04%) |
8.0855 (+1.80%) |
Hindi PPL (hi_prose) |
4.8386 |
4.8571 (+0.38%) |
4.9120 (+1.52%) |
Python PPL (python_code) |
1.4936 |
1.4816 (-0.012) |
1.4936 (+0.0000) |
Hinglish PPL (hinglish_dialog) |
17.4036 |
17.9623 (+3.21%) |
17.8647 (+2.65%) |
GSM8K (100-q, t=4096, temp=0.0) |
82 / 100 (75/75 fin) |
79 / 100 (68/70 fin) |
83 / 100 (71/72 = 98.6% fin) |
Indic Math (hi/bn/ta/te/kn) |
5 / 5 |
5 / 5 |
5 / 5 |
| 12-Prompt Batch Throughput | 420.78 tok/s |
69.82 tok/s |
223.64 tok/s (3.20× vs Triton) |
| Single-Stream Decode (1K → 61.4K) | — | 51.65 → 51.63 tok/s |
68.44 → 67.84 tok/s (+32.5%) |
Note on GSM8K: Evaluated with deterministic temperature=0.0 for strict BF16 vs. W4A16 parity; ~25–28% of samples on both BF16 and W4A16 hit the 4096-token cap due to greedy <think> repetition loops (Soket recommends temperature=0.6–0.7 for sampling).
| Context | Cold TTFT | Warm TTFT (Prefix Cached) | Decode ITL | Decode Speed |
|---|---|---|---|---|
1,024 |
165.3 ms |
161.3 ms |
14.61 ms |
68.44 tok/s |
4,096 |
655.2 ms |
98.6 ms |
14.67 ms |
68.18 tok/s |
16,384 |
2,882.9 ms |
100.1 ms |
14.77 ms |
67.70 tok/s |
32,768 |
6,693.4 ms |
192.2 ms |
14.78 ms |
67.66 tok/s |
61,440 |
15,657.7 ms |
289.5 ms |
14.74 ms |
67.84 tok/s |
This repository bundles the patched vllm_patch/eka_v1.py (which preserves bit-exact BF16 when quant_config is None while unlocking quantized FusedMoE + lossless (1408, 1920) Marlin padding).
# 1. Install the EKA-1 vLLM 0.31.0 wheel (same stack as soketlabs/EKA-1)
pip install "vllm @ https://github.com/vllm-project/vllm/releases/download/v0.31.0/vllm-0.31.0%2Bcu129-cp38-abi3-manylinux_2_28_x86_64.whl" \
--extra-index-url https://download.pytorch.org/whl/cu129
# 2. Download this repo (or just vllm_patch/) and apply the hotpatch
huggingface-cli download skhmn/EKA-1-W4A16-Marlin-24GB --local-dir ./EKA-1-W4A16-Marlin-24GB
python -u ./EKA-1-W4A16-Marlin-24GB/vllm_patch/hotpatch_vllm.py --skip-install
python ./EKA-1-W4A16-Marlin-24GB/vllm_patch/test_hotpatch.py check
# 3. Serve at full 65,536 context on a single 24 GB GPU!
PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True \
vllm serve ./EKA-1-W4A16-Marlin-24GB \
--trust-remote-code \
--dtype bfloat16 \
--max-model-len 65536 \
--gpu-memory-utilization 0.91 \
--max-num-batched-tokens 1024 \
--max-num-seqs 16 \
--host 0.0.0.0 --port 8000
Why
--max-num-seqs 16and--max-num-batched-tokens 1024on 24 GB?
- vLLM V1 reserves one Mamba-2 state block per concurrent sequence in CUDA graphs; with ~1.5 GiB cache pool (~182 blocks), the default
max_num_seqs=256exceeds available blocks.- During 61K-token prefill, FlashAttention MLA pads
Vfrom128 → 192(~420–720 MB temporary workspace). Keepinggpu-memory-utilization=0.91+max-num-batched-tokens=1024+expandable_segments:Truekeeps 64K prefill rock-solid on 24 GB VRAM.
compressed-tensors (pack-quantized), symmetric INT4 ([-8, 7]), group_size=6421-step vectorized grid search over $\alpha \in [0.80, 1.00]$), avg_rel_rmse = 0.09498 across all 8,832 routed expert tensors(1344, 1856) → (1408, 1920) (moe_marlin_pad_latent_size: 1408, moe_marlin_pad_intermediate_size: 1920)6.05 GB): embed_tokens, lm_head, all 23 MambaMixer2 layers, all 6 MLA layers, all 23 shared experts, fc1_latent_proj, fc2_latent_proj, fc1_latent_norm, fc2_latent_norm, and FP32 routers (gate + e_score_correction_bias)mtp.* (not used by vLLM's eka_v1.py, saving ~1.9 GB)Licensed under Apache-2.0, inheriting the license of soketlabs/EKA-1. All credit for the EKA-1 architecture (RASLNet), pretraining, SFT, and tokenizer belongs to Soket AI Labs and the IndiaAI Mission.
model-00003-of-00005.safetensors 4.0 GiBmodel-00002-of-00005.safetensors 4.0 GiBmodel-00001-of-00005.safetensors 4.0 GiBmodel-00004-of-00005.safetensors 3.3 GiBmodel-00005-of-00005.safetensors 2.6 GiBsoketlabs/EKA-1