This is a randomly initialized tiny model based on nvidia/Hymba-1.5B-Instruct for testing and debugging.

Feature Source This repo
Checkpoint tensor elements 1.52B BF16 5.33M BF16, 16.38K F32
Safetensors weight files 3.05 GB (model.safetensors) 10.74 MB (model.safetensors)
Layers 32, each a fused SSM + attention hybrid 4, same fused hybrid
Residual width / MLP width 1,600 / 5,504 128 / 440
Q heads / KV heads / KQ head_dim / V head_dim 25 / 5 / 64 / 128 4 / 1 / 32 / 64
SSM state / expand / conv kernel 16 / 2 / 4 Same
KV-reuse groups 15 producer/consumer pairs [0,1] and [2,3]
Global / sliding attention layers 0,15,31 global; 1024 window layers 0,3 global; same window
Memory tokens 128 Same
Vocabulary rows / embedding tying 32,001 / tied Same
Stored precision BF16 Same

Transformers has no Hymba implementation, so the pinned NVIDIA remote code is included (load with trust_remote_code=True); it uses SDPA instead of the source flex-attention default. The fused selective-scan path requires mamba_ssm and causal-conv1d on CUDA. Its custom KV/SSM cache (with 128 interspersed memory tokens) predates the Transformers 5.x Cache API, so the example runs generation with use_cache=False (full recomputation); cached decoding is not claimed.

SGLang 0.5.10 registers no native implementation for HymbaForCausalLM (no EntryClass in sglang/srt/models), so only the generic TransformersForCausalLM fallback exists, which does not shard the model across tensor-parallel ranks. Serving evidence for this repository is the Transformers example.

File path Size
model.safetensors 10.7MB

Example usage

Transformers (βœ… verified)

Load the included pinned Hymba implementation with trust_remote_code=True. The pinned custom hybrid KV/SSM cache predates the Transformers 5.x Cache API and interacts with the 128 memory tokens, so generation runs with use_cache=False (full recomputation); forward and cache-free generation are verified.

def run_transformers(model_id: str):
    import torch
    from transformers import AutoModelForCausalLM, AutoTokenizer

    model_id = str(model_id)
    tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
    model = (
        AutoModelForCausalLM.from_pretrained(
            model_id, trust_remote_code=True, dtype=torch.bfloat16, attn_implementation="sdpa"
        )
        .eval()
        .cuda()
    )
    prompt = tokenizer.apply_chat_template(
        [{"role": "user", "content": "Tell me a joke."}],
        tokenize=False,
        add_generation_prompt=True,
    )
    inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
    with torch.no_grad():
        assert torch.isfinite(model(**inputs, use_cache=False).logits).all()
        output = model.generate(**inputs, do_sample=False, max_new_tokens=8, use_cache=False)
    print(tokenizer.decode(output[0], skip_special_tokens=True))


if __name__ == "__main__":
    run_transformers(model_id="tiny-random/hymba")

Creating this repo

Change log

  • 2026-11-07: Initial version rebuilt from the official nvidia/Hymba-1.5B-Instruct source with four hybrid Mamba/attention layers, KV-reuse pairs and global/sliding attention.

This repo is generated by GPT-6.1-Sol.

Downloads last month
135
Safetensors
Model size
5.35M params
Tensor type
F32
Β·
BF16
Β·
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for tiny-random/hymba

Finetuned
(1)
this model

Collection including tiny-random/hymba