selensu's picture
Release final d768 MoE SimpleHC weights at step 53686
9586b20 verified
|
Raw History Blame Contribute Delete
2.7 kB
---
pipeline_tag: text-generation
tags:
- nexttransformer
- mixture-of-experts
- moe-d768-240tpp
- simplehc
- safetensors
datasets:
- xjxyys/dolma3_hq_300B_shuffled_clean
---
# NextTransformer MoE SimpleHC · d768, 240 TPP
Final pretrained checkpoint for the SimpleHC model on the NextTransformer `d768-240tpp` track. Training used 14,073,462,784 input tokens over 53,686 updates with a 4,096-token context. The model has 1,996,801,696 parameters and routes each token to 4 of 256 experts. TPP is measured against active non-embedding parameters.
| Final evaluation | Score |
| --- | ---: |
| Six-source validation BPB, macro average | 0.76459 |
| MoE-CORE, 14 tasks | 0.38208 |
[Public architecture and training configuration](https://github.com/Interactive-Active-AI/NextTransformer/blob/e4fb048b70a53358ec918946a9ef3abcd99c2ce2/moe/configs/d768-240tpp/simplehc.json) · [MoE protocol](https://github.com/Interactive-Active-AI/NextTransformer/blob/e4fb048b70a53358ec918946a9ef3abcd99c2ce2/moe/PROTOCOL.md)
## Load the checkpoint
The FP32 safetensors shards contain all 184 trained tensors and persistent buffers (7,987,214,976 bytes of tensor data). The model uses the NextTransformer MoE implementation. Run the example from the root of the pinned public checkout.
```bash
git clone https://github.com/Interactive-Active-AI/NextTransformer.git
cd NextTransformer
git checkout e4fb048b70a53358ec918946a9ef3abcd99c2ce2
python -m pip install 'torch==2.9.1' safetensors huggingface_hub tokenizers
```
```python
import json
from pathlib import Path
import torch
from huggingface_hub import snapshot_download
from safetensors.torch import load_file
from tokenizers import Tokenizer
from moe.model import MoEConfig, build_model
root = Path(snapshot_download("NextTransformer/MoE-SimpleHC-d768-240TPP"))
cfg = MoEConfig.from_serialized(json.loads((root / "model_config.json").read_text()))
model = build_model(cfg, device="cpu", initialize=False)
index = json.loads((root / "model.safetensors.index.json").read_text())
weights = {}
for shard in sorted(set(index["weight_map"].values())):
weights.update(load_file(root / shard))
model.load_state_dict(weights, strict=True, assign=True)
model.eval()
tokenizer = Tokenizer.from_file(str(root / "tokenizer.json"))
ids = [cfg.document_token] + tokenizer.encode("The sky is", add_special_tokens=False).ids
with torch.inference_mode():
logits = model(torch.tensor([ids]))
next_id = logits[0, -1, :tokenizer.get_vocab_size()].argmax().item()
print(tokenizer.decode([next_id]))
```
The included tokenizer is the pinned [Dolma 2 tokenizer](https://huggingface.co/allenai/dolma2-tokenizer/tree/5292e5d6c0f40b67cc765fe41bec991cf4345b5c).