r/LocalLLaMA • • 3d ago

Discussion Inkling 2 Mini on RTX 4090 ~200 tok/s with vLLM, FP8 + NVFP4 + its built-in drafter

Got Thinking Machines’ new Inkling 2 Mini running on a single RTX 4090 at about 190-220 tokens/s, up from ~117 out of the box. It needed a few small patches to vLLM, which doesn’t support 4090s for this model yet.

This is with NVFP4 experts (W4A16) + FP8 W8A16 attention/head/embeddings, FP8 KV.

This fits in 24 GB with a 35k context, and an initial quality metric on some sample prompts reported about a 0.4% loss in perplexity.

94 Upvotes

53 comments sorted by

25

u/YetAnotherAnonymoose 3d ago

How did you even get 117 out of the box? In the prebuilt llama.cpp from Unsloth I only get 40-60t/s...

27

u/eesahe 3d ago

I didn't even bother trying with llama.cpp. This ~117 baseline was with vLLM.

9

u/Borkato 3d ago

I’m getting llama.cpp 20tg with 2x3090, I think I’m doing something wrong lmao

4

u/synth_mania 3d ago

I'm getting 45 with 1x 3090 and I think I'm doing something wrong too lmao

11

u/rorowhat 3d ago

Llama.cpp is now the slowest horse on the race.

5

u/No-Refrigerator-1672 vLLM 3d ago

Now? It was like that since two years at least

2

u/rorowhat 3d ago

Who was faster 2 years ago? I think it's been the last 6 months or so

3

u/Practical-Collar3063 2d ago

Seems like you have only been aware of it for the past 6 months but llama.cpp has always been much slower than VLLM or Sglang, especially at prefill.

That is the case because llama.cpp focuses on wide range of hardware support and ease of use instead of max performance on selected hardware like VLLM and Sglang.

2

u/rorowhat 2d ago

I've known about vLLM but its a very rigid framework.

0

u/Practical-Collar3063 2d ago

if you had you would not say this:

Who was faster 2 years ago? I think it's been the last 6 months or so

2

u/rorowhat 2d ago

Troll. vLLM is fast because you load the whole thing on vram. For the vast majority of people llama.cpp was the best option, since you can run any model with any combination of vram/ram even offloading to SSD.

0

u/Practical-Collar3063 2d ago

vLLM is fast because you load the whole thing on vram

You can load the whole model onto VRAM with llama.cpp and it would still be much slower than VLLM or Sglang. Llama.cpp has its  uses, best performance on latest hardware is just not one of them.

1

u/No-Refrigerator-1672 vLLM 2d ago edited 2d ago

vLLM, if your card had official support (not a vibecoded port), always was faster than llama.cpp for prompts longer than 8k-16k (depenting on model architecture). SGLang is even faster than vLLM too. That's for models that fit into VRAM completely. For CPU offload, ik_llama was and is faster.

1

u/dangerous_inference vLLM 2d ago

Vibecoded vLLM ports for consumer GPUs have been 5x faster (single request) than llama.cpp for nearly a year minimum.

1

u/No-Refrigerator-1672 vLLM 2d ago

Which ones? The ports I've seen are all garbage. They do run, but only the exact model, quant and setting that the author uses. Not worth the time if your usecase exactly matches. Official vllm, however, is rock stable, and still support anything down to Titan V, if we talk about consumer segment.

1

u/dangerous_inference vLLM 2d ago

1

u/No-Refrigerator-1672 vLLM 2d ago

So why would I run this instead of just official vllm? All listed cards are supported officially. Those forks don't show any performance testing; and they don't offer better model support either.

Edit: I mean i don't see them publishing speed benchmarks against normal vllm.

0

u/dangerous_inference vLLM 2d ago

They aren't supported.

→ More replies (0)

1

u/MDSExpro 2d ago edited 2d ago

It always was, especially with 1 than more concurrent request or on big contexts: https://homebrewserver.club/ollama-vs-llama-cpp-vs-lm-studio-vs-vllm.html

2

u/Ok-Shower7286 3d ago

at 5090 (and my llama.cpp fork), it generates 80 tps without mtp. I roughly guess 130~150tps expected. similar w/ qwen dense. in llama.cpp pr, the attention path isn't optimized yet (no fa support for the relative bias), and MTP isn't wired up https://github.com/ggml-org/llama.cpp/pull/32694#issuecomment-7057397254

1

u/rpkarma 2d ago

Don’t use llama for new models tbh, vLLM is where the real early optimisations usually are

9

u/kryptkpr Llama 3 3d ago

Would love to see the sm89 patches

15

u/eesahe 3d ago

Sure, here is a patch packaged by Claude:

7 one-line changes on top of vLLM PR #69028 (vLLM nightly 0.34.0rc1.dev1103, torch 2.14.0+cu130, Triton 3.8.0). It edits installed packages in place, so recommended to use a dedicated venv.

import glob, os, sys, sysconfig
SP = sys.argv[1] if len(sys.argv) > 1 else sysconfig.get_paths()["purelib"]
CAP = "current_platform.is_device_capability_family(120)"
SM89 = CAP + " or current_platform.is_device_capability(89)"
EDITS = [
    ("vllm/models/inkling2/quant_config.py", "        return 90\n", "        return 89\n"),  # min capability
    ("vllm/models/inkling2/nvidia/ops/conv_mix.py", "if " + CAP + ":\n            # Native conv/mix",
     "if " + SM89 + ":\n            # Native conv/mix"),          # portable conv/mix path, as on SM12x
    ("vllm/models/inkling2/nvidia/attention.py", "if " + CAP + ":\n            supported +=",
     "if " + SM89 + ":\n            supported +="),                # fp8 KV cache
    ("vllm/models/inkling2/speculator_config.py", "if " + CAP + ":\n            # The target's clipped",
     "if " + SM89 + ":\n            # The target's clipped"),      # DSpark draft KV stays bf16
    ("triton/language/extra/cuda/gdc.py", '"griddepcontrol.wait; // dummy $0"', '"mov.u32 $0, 0;"'),
    ("triton/language/extra/cuda/gdc.py", '"griddepcontrol.launch_dependents; // dummy $0"', '"mov.u32 $0, 0;"'),
    ("triton/backends/nvidia/driver.py", "self.launch_pdl = metadata.launch_pdl", "self.launch_pdl = False"),
]  # last three: no programmatic dependent launch (sm90+ PTX); kernels just run in stream order
for rel, old, new in EDITS:
    p = (glob.glob(os.path.join(SP, rel)) or [os.path.join(SP, rel)])[0]
    s = open(p).read()
    if s.count(old) != 1: sys.exit(f"{rel}: no unique match (already patched or different version)")
    open(p, "w").write(s.replace(old, new)); print("patched", rel)

That gets the stock checkpoint running at ~117 tok/s on a 4090. The jump to ~190-220 comes from FP8 attention/lm_head/embeddings with a small W8A16 Triton kernel, plus DSpark. That's a separate, bigger patch.

3

u/kryptkpr Llama 3 2d ago edited 2d ago

You rock, it works! slightly tweaked to keep changes inside vllm and leave Triton alone

Batching on 2x L40S looks decent

APIServer pid=442320) INFO 11-21 08:28:50 [loggers.py:347] Engine 000: Avg prompt throughput: 149.6 tokens/s, Avg generation throughput: 1732.0 tokens/s, Running: 63 reqs, Waiting: 1 reqs, Finished: 19 reqs, GPU KV cache usage: 21.1%

I see what you mean about the bare embeddings and lmhead a little FP8 would make the soup tastier

2

u/Viktri1 3d ago

damn, 35k context is not sufficient for Hermes. I was hoping to run it on a 4090 to see whether its prose is better than QFN and GLM.

4

u/eesahe 3d ago

I was not solving for context length. You could probably fit much more than that depending on what you care about, by freeing memory from elsewhere.

7

u/aarong691 3d ago

The drafter's acceptance rate would be interesting alongside tok/s, speculative decoding speed depends heavily on how often its guesses are accepted.

7

u/chris_0611 2d ago

35k context

aiii

1

u/Practical-Collar3063 2d ago

There has to be something wrong with OP's set up regarding KV cache.
KV cache memory requirement's scaling is theoritically half of qwen 27b

4

u/No-Library8065 2d ago

190 to 220 t/s on a 4090 is a big jump from 117. the 4090 patches are probably what most people here will want

3

u/Holiday_Point_603 2d ago

"fits with 35k context" is hilarious for a Model that size lol. But nice speeds!

1

u/Practical-Collar3063 2d ago

There has to be something wrong with OP's set up regarding KV cache.
KV cache memory requirement's scaling is theoritically half of qwen 27b

2

u/winky9827 2d ago edited 2d ago

This fits in 24 GB with a 35k context

Yeah this model is a big fail. The context VRAM requirement is absolutely bonkers for a 26b MoE model. Either the Inkling team was high, or they don't understand the target audience.

Edit: I was wrong. This model is awesome. Running on basalt with better performance, but there's a llama.cpp fix in the works too, I think.

0

u/Practical-Collar3063 2d ago

why would you discard completely a model based on some random redditor's number. he did not provide his exact set up and env variables. The theoretical scaling of inkling mini's kv cache is half of what Qwen 27b is. There is something wrong with OP's set up

0

u/LightBroom 2d ago edited 2d ago

No it's not, 24GB VRAM fits 64k q8_0 context with llama.cpp

At the same time llama.cpp reports much lower numbers so the reporting is probably probably broken

Edit:

There's large computer buffer being allocated and dependent on the -ub parameter. This is with ub at 512, on my desktop PC (7900XTX) and 32k context

I'll eventually try it on my main llm rig where I have much more VRAM available to see how much I can fit. But, it's slower than Qwen 27b on AMD so not sure if it's worth it yet. Llama.cpp crashes when compiled with HIP so I had to use Vulkan for this one.

| memory breakdown [MiB]                  | total   free     self   model   context   compute    unaccounted |
|   - Vulkan0 (RX 7900 XTX (RADV NAVI31)) | 24560 = 3031 + (20414 = 16330 +     678 +    3404) +        1114 |
|   - Host                                |                   628 =   469 +       0 +     159                |

This is with 64k context

| memory breakdown [MiB]                  | total   free     self   model   context   compute    unaccounted |
|   - Vulkan0 (RX 7900 XTX (RADV NAVI31)) | 24560 = 1322 + (22123 = 14263 +    1222 +    6636) +        1114 |
|   - Host                                |                  2790 =  2535 +       0 +     255                |

2

u/Practical-Collar3063 2d ago

No it's not

Inkling mini’s architecture having a theoretical scaling of half Qwen 27b’s KV cache is an actual verifiable fact. 

Now what you are talking about is the implementation in llama.cpp, those new architecture tend to have bugs.

People are already reporting much better max context window on other engines:  https://www.reddit.com/r/LocalLLaMA/comments/1y2b459/inkling_2_mini_on_2_rtx_3090_557k_context_vision/ This person report 177k token max context window on a single RTX 3090 and that is with the additional memory footprint of Dspark and BF16 KV Cache.

There seems to be unexplained memory overhead on llama.cpp at the moment for this model

0

u/LightBroom 2d ago

There seems to be unexplained memory overhead on llama.cpp at the moment for this model

Yeah, looks like maybe the KV cache has multiple copies per batch for the inner loops, who knows.

1

u/mesolimbic-bliss 3d ago

let the inference engine begin for Inkling-mini! by tomorrow we'll be getting 200 tps on 24gb vram

1

u/Poprouter 2d ago

those counters are handy for this. grab spec_decode_num_accepted_tokens_total and spec_decode_num_draft_tokens_total, then divide the first by the second. no separate run needed, the gain is in generation rather than prefill.

1

u/Turbulent_Ad6290 2d ago

Basalt / adamant

1

u/Mitchy103 2d ago

how is Inking 2 quality vs QFN 3.8?