Ivis-50M-Pilot — Full Pipeline Release
End-to-end validated release: trained checkpoint + GGUF conversion + pure-numpy local inference engine + measured results.
هذا الإصدار يحتوي على النموذج المدرب، محوّل GGUF، محرك تشغيل محلي، ونتائج الاختبار المقاسة.
1. Model
| Architecture | Ivis Nepetai — hybrid Transformer + Mamba SSM + MoE |
| Total params | 55,677,824 (weight tying ON) |
| Layers | 10 (attention ×8 · Mamba at 3,7 · MoE at 8,9) |
| d_model / heads | 384 / 6 Q-heads, 2 KV-heads (GQA), head_dim 64 |
| MoE | 4 experts × 2 active, hidden 768 (FixedShapeMoE) |
| Context | 256 tokens |
| Vocab | 65,536 SentencePiece BPE (Arabic + English) |
2. Measured Training Results (Kaggle Tesla P100-16GB)
Optimizer: Adafactor lr=3e-4 · batch 8×256 · grad clip 1.0 · 300 steps.
Step Loss Perplexity Time
010 9.1995 9,892 16s
050 6.3237 558 76s
100 5.4242 227 153s
150 4.4839 89 229s
200 3.3126 27 305s
250 1.7707 5.9 381s
300 0.9197 2.51 457s
✅ Numerically stable across all 300 steps — monotonic descent, no divergence, no NaN.
⚠️ Transparency: pilot corpus ≈100 samples → final PPL reflects rapid fit/memorization at toy scale. This run validates optimization stability of the architecture, not final quality.
3. Local Inference Results (measured)
Runs without PyTorch — pure numpy reading GGUF directly:
$ python infer_numpy.py --gguf ivis-50m-pilot.gguf \
--tokenizer tokenizer.model --prompt "Python is a" --tokens 25
[engine] d_model=384 layers=10 params=55,677,824 tensors=126
=== Generation (25 new tokens in 1.1s) ===
Python is a of result the ## is Most your currently before consequences...
$ python infer_numpy.py --prompt "البرمجة هي" --tokens 30
=== Generation (14 new tokens in 0.5s) ===
البرمجة هي number user foran solution geometrically result installation...
| Benchmark | Value |
|---|---|
| Decode speed (CPU numpy) | ~23 tok/s |
| GGUF size (f16) | 111 MB |
| Load time | < 2s |
Output quality is weak because of training scale (not inference): words are real vocabulary tokens and structure is coherent — proof the numpy engine exactly matches PyTorch semantics.
4. Quick Start
pip install gguf sentencepiece numpy # no torch needed!
git clone https://huggingface.co/nepetai/ivis-50m-pilot
cd ivis-50m-pilot
python infer_numpy.py \
--gguf ivis-50m-pilot.gguf \
--tokenizer tokenizer.model \
--prompt "البرمجة هي" \
--tokens 40
Convert your own checkpoint (.pt → GGUF)
python convert_to_gguf.py \
--checkpoint ivis_2b_tpu_shared.pt \
--output my-model.gguf
Works on any machine — parses PyTorch zip archives directly (pickle + raw tensors), zero torch dependency.
5. Files
| File | Purpose |
|---|---|
ivis_50m_pilot.pt |
Original checkpoint (state_dict + model_info) |
ivis-50m-pilot.gguf |
GGUF container, f16, all 126 tensors |
infer_numpy.py |
Local inference engine (numpy-only) |
convert_to_gguf.py |
Torch-free .pt→GGUF converter |
tokenizer.model / .vocab |
SentencePiece BPE |
6. Engine internals (infer_numpy.py)
Exact re-implementation of the PyTorch forward pass:
- RMSNorm pre-norm blocks (eps 1e-6)
- GQA attention: rotate-half RoPE θ=10K, causal mask, KV cache decode
- Mamba selective SSM: depthwise conv state + sequential scan
h_t = e^{ΔA}h_{t-1} + ΔBu - FixedShapeMoE: softmax router → top-2 renormalized weighted expert sum
- Tied lm_head: logits = h @ Eᵀ
7. llama.cpp status
llama-cli reads the GGUF metadata successfully but reports
unknown model architecture: 'ivis-nepetai' — the hybrid layout needs a new C++ graph implementation upstream. Until then, use infer_numpy.py.
8. Scope note (research transparency)
Implemented in code but not yet validated at scale: 128K context (RoPE θ=500K, sliding window + sink attention), vision (MoonViT), audio encoder, GraphRAG/ToT reasoning. This release validates the core hybrid text stack only.
- Downloads last month
- -
We're not able to determine the quantization variants.