8000 GitHub - acidtib/bucle: Inference engine for looped transformers, built for Pascal GPUs. · GitHub
[go: up one dir, main page]

Skip to content
acidtibPublic

About

Inference engine for looped transformers, built for Pascal GPUs.

Resources

Contributing

Stars

2 stars

Watchers

0 watching

Forks

Repository files navigation

Bucle

Run looped transformers on old GPUs.

CI Release License: MIT

Speed · Quick start · Models · Commands · Build · Report your GPU

Bucle is an inference engine for looped models, written in Rust and CUDA. It runs Inkling 2 Mini on Pascal GPUs.

Speed

Tokens per second with UD-Q4_K_XL. Prefill reads an 8,451-token prompt (opencode's system prompt and tools); decode generates 128 tokens after it.

GPU VRAM Prefill 1x Prefill 2x Decode 1x Decode 2x
GTX 1080 8 GB 323 512 20.2 30.2
Tesla P100 SXM2 16 GB 299 529 32.1 33.4
Tesla P40 24 GB 426 635 27.3 29.4

Add your GPU.

Quick start

Linux, glibc 2.31 or newer. NVIDIA driver 525 or newer on Pascal (sm_60 to sm_62), or 550 or newer on newer cards, which compile the release's CUDA 12.4 PTX on first start.

curl -LsSf https://raw.githubusercontent.com/acidtib/bucle/main/install.sh | sh

Once installed:

bucle serve unsloth/Inkling-2-Mini-GGUF

The first run picks a GGUF that fits your GPUs and RAM and downloads it to the Hugging Face cache. The server listens on 127.0.0.1:8080 (--port to change it) with OpenAI and Anthropic APIs.

curl http://127.0.0.1:8080/v1/chat/completions \
  -H 'Content-Type: application/json' \
  -d '{"model":"inkling-2-mini","messages":[{"role":"user","content":"Hello"}]}'

If something is wrong, run bucle doctor unsloth/Inkling-2-Mini-GGUF and paste the output into an issue.

Models

File Size Top-1 vs Q8_0 Mean KL
unsloth/Inkling-2-Mini-GGUF:UD-Q4_K_M 16.6 GB 96.8% 0.041
unsloth/Inkling-2-Mini-GGUF:UD-Q4_K_XL 17.6 GB 96.7% 0.045
ggml-org/Inkling-2-Mini-GGUF:IQ4_NL 17.6 GB 95.2% 0.070
unsloth/Inkling-2-Mini-GGUF:UD-IQ3_XXS 11.7 GB 92.0% 0.104
ggml-org/Inkling-2-Mini-GGUF:Q8_0 27.8 GB reference

Top-1 is how often the file picks the same next token as Q8_0. Mean KL is how far its predictions drift from Q8_0; lower is better. Both are measured on prose, code and agent text.

Given a repo, serve picks the file that fits your GPUs and RAM. bucle plan shows which one.

Commands

Command What it does
bucle serve MODEL OpenAI and Anthropic chat API
bucle doctor MODEL lists GPUs and the memory plan, checks every GPU against the CPU
bucle plan [REPO] picks the GGUF that fits your GPUs and RAM
bucle pull MODEL downloads a GGUF to the Hugging Face cache
bucle bench MODEL --tokens-file FILE prefill and decode speed on a prompt

MODEL is a repo (unsloth/Inkling-2-Mini-GGUF), a repo and quant (unsloth/Inkling-2-Mini-GGUF:UD-Q4_K_M), a file in a repo (owner/repo/path/file.gguf) or a local path. bucle COMMAND --help lists every flag.

serve flags
Flag
--context N context limit, including generated tokens; planned from VRAM and RAM by default
--port N listen port, default 8080
--expert-cache-mib N GPU 0 expert budget; 0 turns the GPU expert cache off
--kv-format q8_0|q4_0|q6_g smaller K/V for longer context, lossy
--attn-format q5_0 5-bit attention weights, lossy
--prefill-activations f32 full-precision prompt processing; the default q8_0 is faster
--draft MODEL DSpark speculative decoding
--tail-skip N skip low-ranked experts in decode, lossy
--no-prefix-cache, --prefix-cache-dir DIR, --prefix-cache-mib N saved prompt prefixes
Developer commands
Command What it does
bucle logits MODEL --tokens ... one logit row per input token
bucle decode MODEL --tokens ... --steps N prefill, then one logit row per decode step
bucle trace MODEL --tokens ... hidden state per token and per layer visit
bucle convert-experts MODEL CHECKPOINT OUT converts the native checkpoint's NVFP4/MXFP8 experts into a sidecar for --experts
bucle expert-rows MODEL --layer L --expert E --matrix M dumps decoded expert rows to check a conversion
bucle pool ... joins machines into a pool; links only for now, remote experts are #69

These feed the scripts in tools/compare.

opencode

{
  "provider": {
    "bucle": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "Bucle",
      "options": { "baseURL": "http://127.0.0.1:8080/v1", "apiKey": "local" },
      "models": { "inkling-2-mini": { "name": "Inkling 2 Mini", "limit": { "context": 131072, "output": 32768 } } }
    }
  },
  "model": "bucle/inkling-2-mini"
}

Set limit.context no higher than the context limit bucle serve prints at startup.

Important

The server runs one request at a time and has no authentication. Keep it on localhost or a network you trust.

Build

Rust and CUDA 12.x. CUDA 13 dropped Pascal.

RUSTFLAGS="-C target-cpu=native" cargo build --release --features cuda

BUCLE_CUDA_TARGETS picks the GPU targets. The default is sm_60,sm_61,sm_62,compute_61.

Contributing

See CONTRIBUTING.md and the issues.

License

MIT

About

Inference engine for looped transformers, built for Pascal GPUs.

Resources

Contributing

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packa 31E6 ges

Contributors

Languages

0