Ex0bit/Kimi-K2.5-PRISM-REAP-530B-A32B

Model

Kimi-K2.5-PRISM-REAP-530B-A32B

21

26 commits

1 linked in READMEs

updated Feb 22, 2026

See the code

README

Kimi-K2.5-PRISM-REAP-530B-A32B

50% REAP expert-pruned version of moonshotai/Kimi-K2.5, built from the PRISM variant.

PropertyValue
ArchitectureKimiK25 (DeepSeekV3 backbone)
Total Parameters~530B (down from ~1T)
Active Parameters~32B (8 experts per token)
Experts per MoE Layer192 routed + 1 shared (down from 384 + 1)
MoE Layers60 (layers 1-60, layer 0 is dense)
QuantizationINT4 (group_size=32, symmetric) via compressed-tensors
Disk Size289 GB (down from 555 GB)
Pruning MethodREAP (Router-weighted Expert Activation Pruning)
Calibration512 samples from allenai/tulu-3-sft-mixture, max 2800 tokens

What is REAP?

REAP (Cerebras Research, 2025) is a one-shot expert pruning method for Mixture-of-Experts models. It computes saliency scores using the router-weighted expert output norms from real forward passes:

S_j = (1 / |X_j|) * SUM_{x in X_j} [ g_j(x) * ||f_j(x)||_2 ]

Where g_j(x) is the normalized gate weight and ||f_j(x)||_2 is the L2 norm of expert j's output for token x. Experts with the lowest saliency are pruned.

What is PRISM?

This model was first treated using our SOTA PRISM-LITE pipeline, softening over-refusal and bias behaviors while preserving model quality. The REAP pruning was then applied on top of the PRISM model.

Key Technical Details

  • Uniform 50% pruning: Every MoE layer pruned from 384 to 192 experts
  • Super expert preservation: Top 0.5th percentile experts (by activation norm) were guaranteed to survive
  • Zero-redundancy observer: Saliency computed from real forward pass hooks
  • torch.compile fused INT4 GEMM: Custom compiled kernel for fast INT4 decompression during calibration
  • Correct saliency ordering verified: In every layer, min_retained_saliency > max_pruned_saliency

Hardware Requirements

This model is 289 GB in INT4 format. You need:

SetupVRAMFits?
8x H200 141GB1,128 GBYes (used for calibration)
8x H100 80GB640 GBYes
8x A100 80GB640 GBYes

Usage

from transformers import AutoModelForCausalLM, AutoTokenizer
import torch

model = AutoModelForCausalLM.from_pretrained(
    "Ex0bit/Kimi-K2.5-PRISM-REAP-530B-A32B",
    trust_remote_code=True,
    dtype=torch.bfloat16,
    device_map="auto",
)
tokenizer = AutoTokenizer.from_pretrained(
    "Ex0bit/Kimi-K2.5-PRISM-REAP-530B-A32B",
    trust_remote_code=True,
)

messages = [{"role": "user", "content": "What is the capital of France?"}]
inputs = tokenizer.apply_chat_template(messages, return_tensors="pt", thinking=False)
inputs = inputs.to(model.device)

outputs = model.generate(inputs, max_new_tokens=512, temperature=0.6, do_sample=True)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))

Re-pruning at Different Ratios

The calibration saliency scores are included in the calibration/ directory. You can re-prune at a higher compression ratio without re-running the expensive calibration forward pass:

# Clone this repo's REAP source
git clone https://huggingface.co/Ex0bit/Kimi-K2.5-PRISM-REAP-530B-A32B
cd Kimi-K2.5-PRISM-REAP-530B-A32B

# Re-prune at 65% (384 -> 134 experts, ~208 GB)
python3 reap/src/kimi_reap.py \
  --model moonshotai/Kimi-K2.5 \
  --load_scores calibration/reap_scores_v9_512samples.pt \
  --compression_ratio 0.65 \
  --save_model \
  --output_dir ./Kimi-K2.5-PRISM-REAP-65pct

# Re-prune at 75% (384 -> 96 experts, ~155 GB)
python3 reap/src/kimi_reap.py \
  --model moonshotai/Kimi-K2.5 \
  --load_scores calibration/reap_scores_v9_512samples.pt \
  --compression_ratio 0.75 \
  --save_model \
  --output_dir ./Kimi-K2.5-PRISM-REAP-75pct

Calibration Details

ParameterValue
Datasetallenai/tulu-3-sft-mixture
Max sequence length2800 tokens
Seed42
Calibration time72.6 minutes (8x H200)
Pruning time7.3 seconds
Save time5.7 minutes

File Structure

.
β”œβ”€β”€ model-00001-of-00031.safetensors  # Model shards (289 GB total)
β”œβ”€β”€ ...
β”œβ”€β”€ model-00031-of-00031.safetensors
β”œβ”€β”€ model.safetensors.index.json
β”œβ”€β”€ config.json                        # Updated: n_routed_experts=192
β”œβ”€β”€ tokenizer_config.json
β”œβ”€β”€ generation_config.json
β”œβ”€β”€ calibration/
β”‚   β”œβ”€β”€ reap_scores_v9_512samples.pt   # Saliency scores (reusable for re-pruning)
β”‚   β”œβ”€β”€ reap_accumulator_checkpoint.pt # Raw accumulators (for extending calibration)
β”‚   β”œβ”€β”€ reap_pruning_metadata.json     # Full pruning metadata per layer
└── reap/
    β”œβ”€β”€ src/
    β”‚   β”œβ”€β”€ kimi_reap.py               # Main entry point (with all compatibility shims)
    β”‚   β”œβ”€β”€ observer.py                # REAP saliency observer hooks
    β”‚   └── data.py                    # Calibration dataset loading
    └── scripts/
        β”œβ”€β”€ bench_int4.py              # INT4 GEMM benchmarks
        └── bench_int4_v2.py           # torch.compile benchmark

Compatibility Shims

Loading Kimi-K2.5 with compressed-tensors requires several monkey-patches (all included in reap/src/kimi_reap.py):

ShimPurpose
Shim 0_initialize_weights guard β€” prevents _init_weights from overwriting loaded weights
Shim 1is_torch_fx_available stub β€” removed in transformers 5.x
Shim 2acompress_model fast path β€” skip 69,120 meta modules (111 min to <1s)
Shim 2bQuantizer ignore list β€” language_model. prefix fix
Shim 2cregister_offload_parameter safety
Shim 2d+2e+2gFused compiled INT4 forward β€” torch.compile decompress+matmul

Citation

@article{reap2025,
  title={REAP the Experts: Why Pruning Prevails for One-Shot MoE Compression},
  author={Cerebras Research},
  journal={arXiv preprint arXiv:2510.13999},
  year={2025}
}

Acknowledgments

abliteration
compressed-tensors
conversational
custom_code
deepseek
expert-pruning
feature-extraction
int4
kimi
kimi_k25
prism
reap
safetensors
text-generation
transformers

Contributors

Ex0bit

26 commits

Ex0bit/Kimi-K2.5-PRISM-REAP-530B-A32B

Model

Kimi-K2.5-PRISM-REAP-530B-A32B

21

26 commits

1 linked in READMEs

updated Feb 22, 2026

See the code

README

Kimi-K2.5-PRISM-REAP-530B-A32B

50% REAP expert-pruned version of moonshotai/Kimi-K2.5, built from the PRISM variant.

PropertyValue
ArchitectureKimiK25 (DeepSeekV3 backbone)
Total Parameters~530B (down from ~1T)
Active Parameters~32B (8 experts per token)
Experts per MoE Layer192 routed + 1 shared (down from 384 + 1)
MoE Layers60 (layers 1-60, layer 0 is dense)
QuantizationINT4 (group_size=32, symmetric) via compressed-tensors
Disk Size289 GB (down from 555 GB)
Pruning MethodREAP (Router-weighted Expert Activation Pruning)
Calibration512 samples from allenai/tulu-3-sft-mixture, max 2800 tokens

What is REAP?

REAP (Cerebras Research, 2025) is a one-shot expert pruning method for Mixture-of-Experts models. It computes saliency scores using the router-weighted expert output norms from real forward passes:

S_j = (1 / |X_j|) * SUM_{x in X_j} [ g_j(x) * ||f_j(x)||_2 ]

Where g_j(x) is the normalized gate weight and ||f_j(x)||_2 is the L2 norm of expert j's output for token x. Experts with the lowest saliency are pruned.

What is PRISM?

This model was first treated using our SOTA PRISM-LITE pipeline, softening over-refusal and bias behaviors while preserving model quality. The REAP pruning was then applied on top of the PRISM model.

Key Technical Details

  • Uniform 50% pruning: Every MoE layer pruned from 384 to 192 experts
  • Super expert preservation: Top 0.5th percentile experts (by activation norm) were guaranteed to survive
  • Zero-redundancy observer: Saliency computed from real forward pass hooks
  • torch.compile fused INT4 GEMM: Custom compiled kernel for fast INT4 decompression during calibration
  • Correct saliency ordering verified: In every layer, min_retained_saliency > max_pruned_saliency

Hardware Requirements

This model is 289 GB in INT4 format. You need:

SetupVRAMFits?
8x H200 141GB1,128 GBYes (used for calibration)
8x H100 80GB640 GBYes
8x A100 80GB640 GBYes

Usage

from transformers import AutoModelForCausalLM, AutoTokenizer
import torch

model = AutoModelForCausalLM.from_pretrained(
    "Ex0bit/Kimi-K2.5-PRISM-REAP-530B-A32B",
    trust_remote_code=True,
    dtype=torch.bfloat16,
    device_map="auto",
)
tokenizer = AutoTokenizer.from_pretrained(
    "Ex0bit/Kimi-K2.5-PRISM-REAP-530B-A32B",
    trust_remote_code=True,
)

messages = [{"role": "user", "content": "What is the capital of France?"}]
inputs = tokenizer.apply_chat_template(messages, return_tensors="pt", thinking=False)
inputs = inputs.to(model.device)

outputs = model.generate(inputs, max_new_tokens=512, temperature=0.6, do_sample=True)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))

Re-pruning at Different Ratios

The calibration saliency scores are included in the calibration/ directory. You can re-prune at a higher compression ratio without re-running the expensive calibration forward pass:

# Clone this repo's REAP source
git clone https://huggingface.co/Ex0bit/Kimi-K2.5-PRISM-REAP-530B-A32B
cd Kimi-K2.5-PRISM-REAP-530B-A32B

# Re-prune at 65% (384 -> 134 experts, ~208 GB)
python3 reap/src/kimi_reap.py \
  --model moonshotai/Kimi-K2.5 \
  --load_scores calibration/reap_scores_v9_512samples.pt \
  --compression_ratio 0.65 \
  --save_model \
  --output_dir ./Kimi-K2.5-PRISM-REAP-65pct

# Re-prune at 75% (384 -> 96 experts, ~155 GB)
python3 reap/src/kimi_reap.py \
  --model moonshotai/Kimi-K2.5 \
  --load_scores calibration/reap_scores_v9_512samples.pt \
  --compression_ratio 0.75 \
  --save_model \
  --output_dir ./Kimi-K2.5-PRISM-REAP-75pct

Calibration Details

ParameterValue
Datasetallenai/tulu-3-sft-mixture
Max sequence length2800 tokens
Seed42
Calibration time72.6 minutes (8x H200)
Pruning time7.3 seconds
Save time5.7 minutes

File Structure

.
β”œβ”€β”€ model-00001-of-00031.safetensors  # Model shards (289 GB total)
β”œβ”€β”€ ...
β”œβ”€β”€ model-00031-of-00031.safetensors
β”œβ”€β”€ model.safetensors.index.json
β”œβ”€β”€ config.json                        # Updated: n_routed_experts=192
β”œβ”€β”€ tokenizer_config.json
β”œβ”€β”€ generation_config.json
β”œβ”€β”€ calibration/
β”‚   β”œβ”€β”€ reap_scores_v9_512samples.pt   # Saliency scores (reusable for re-pruning)
β”‚   β”œβ”€β”€ reap_accumulator_checkpoint.pt # Raw accumulators (for extending calibration)
β”‚   β”œβ”€β”€ reap_pruning_metadata.json     # Full pruning metadata per layer
└── reap/
    β”œβ”€β”€ src/
    β”‚   β”œβ”€β”€ kimi_reap.py               # Main entry point (with all compatibility shims)
    β”‚   β”œβ”€β”€ observer.py                # REAP saliency observer hooks
    β”‚   └── data.py                    # Calibration dataset loading
    └── scripts/
        β”œβ”€β”€ bench_int4.py              # INT4 GEMM benchmarks
        └── bench_int4_v2.py           # torch.compile benchmark

Compatibility Shims

Loading Kimi-K2.5 with compressed-tensors requires several monkey-patches (all included in reap/src/kimi_reap.py):

ShimPurpose
Shim 0_initialize_weights guard β€” prevents _init_weights from overwriting loaded weights
Shim 1is_torch_fx_available stub β€” removed in transformers 5.x
Shim 2acompress_model fast path β€” skip 69,120 meta modules (111 min to <1s)
Shim 2bQuantizer ignore list β€” language_model. prefix fix
Shim 2cregister_offload_parameter safety
Shim 2d+2e+2gFused compiled INT4 forward β€” torch.compile decompress+matmul

Citation

@article{reap2025,
  title={REAP the Experts: Why Pruning Prevails for One-Shot MoE Compression},
  author={Cerebras Research},
  journal={arXiv preprint arXiv:2510.13999},
  year={2025}
}

Acknowledgments

abliteration
compressed-tensors
conversational
custom_code
deepseek
expert-pruning
feature-extraction
int4
kimi
kimi_k25
prism
reap
safetensors
text-generation
transformers

Contributors

Ex0bit

26 commits