Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Hugging Face 6 min read Case study mediumAdept

Accelerating Qwen3-8B Agent on Intel® Core™ Ultra with Depth-Pruned Draft Models

Speculative decoding with a Qwen3-0.6B draft model speeds up 4-bit Qwen3-8B on an Intel Lunar Lake integrated GPU by about 1.3× using OpenVINO.GenAI. Depth-pruning the draft raises that to about 1.4×: 6 of its 28 layers are removed by picking low-contribution blocks via angular distance, then the draft is fine-tuned on Qwen3-8B outputs for 500k Infinity-Instruct prompts. The gain matches the speedup formula, since lower draft latency improves overall throughput. The accelerated pair is demonstrated as a local smolagents agent that uses web search and python-pptx to build a slide deck.

Assumes: LLM inference basicsspeculative decodingmodel quantization

Related posts

  • Assisted Generation: a new direction toward low-latency text generation

    Hugging Face mediumAdept

    Assisted generation cuts autoregressive LLM latency by letting a much smaller assistant model with the same tokenizer greedily draft candidate tokens, then verifying them all in a single forward pass of the large model. The large model keeps matching tokens plus the first divergent one. The draft length adapts: it grows by 2 when every candidate matches and shrinks by 1 otherwise. The approach exploits the fact that forward passes are memory-bandwidth bound. In 🤗 Transformers it is exposed through an `assistant_model` argument to `generate` (batch size 1 only) and yields up to 2x speedups, 3x with INT8, and up to 10x when the model relies on memory offloading. It works best on input-grounded tasks like ASR and summarization, and with sampling only at low temperatures.

  • DeepSeek-V4: a million-token context that agents can actually use

    Hugging Face hardMaster

    DeepSeek-V4 (Pro: 1.6T total/49B active; Flash: 284B/13B active) is a MoE model family whose 1M-token context is made practical by a hybrid attention design that interleaves Compressed Sparse Attention (4x KV compression plus an FP4 lightning indexer selecting top-k blocks) with Heavily Compressed Attention (128x compression with dense attention), plus FP8 KV storage. At 1M tokens V4-Pro needs 27% of V3.2's per-token FLOPs and 10% of its KV cache, about 2% of a bf16 GQA-8 cache. Agent-focused post-training preserves reasoning across user turns when tools are involved, adds an XML-based |DSML| tool-call schema to reduce escaping and type errors, and relies on DSec, a Rust sandbox platform for RL rollouts. Agent benchmarks land near frontier closed models (SWE Verified 80.6, MCPAtlas 73.6), and MRCR 8-needle retrieval holds 0.59 at 1M tokens.

  • Optimize and deploy with Optimum-Intel and OpenVINO GenAI

    Hugging Face mediumAdept

    Hugging Face Transformers LLMs can be exported to OpenVINO IR with Optimum-Intel, quantized with NNCF, and deployed through the lightweight OpenVINO GenAI LLMPipeline from Python or C++. Models over one billion parameters default to INT8 weights during export. For Llama 3.1 8B the recommendation is to stack AWQ, scale estimation and mixed INT4/INT8 quantization using a calibration dataset. Wikitext perplexity goes from 7.34 in FP32 to 7.35 at INT8 and 7.83 at INT4. Code examples cover export via API and CLI, generation config, streaming, and chat mode that reuses the KV cache across turns.

  • Open-weight models are fast on Neon AI Gateway. Here's why

    Neon mediumAdept

    Neon AI Gateway serves open-weight models through Databricks Foundation Model APIs, so it gets that stack's inference optimizations: continuous batching with PagedAttention-style KV-cache paging and overlapped prefill/decode, a TensorRT-LLM backend with fused and GroupGEMM kernels for MoE, tensor parallelism, FP8 quantization, and per-GPU tuning. Prompt caching matters most for agent loops that resend a stable system prompt and tool schema. On gpt-oss in a production batch pipeline it raised per-replica input-token throughput 2.5× and cut P50 latency 3× at a ~30% hit rate. FP8 on H100 gave about 2.2× throughput over FP16. To benefit, keep prompt prefixes stable and point an OpenAI-compatible SDK at the gateway.

  • Run fast, private agents on-device with LFM2.5-24B-A2B

    Hugging Face mediumAdept

    LFM2.5-24B-A2B is an open-weight 24B-parameter MoE reasoning model with 2B active parameters per token, aimed at running tool-using agents on local hardware. It keeps LFM2's 40-layer hybrid of gated short convolutions and GQA with 64 experts and top-4 routing. The context window grows from 32K to 131K tokens, the vocabulary doubles to 128K, pre-training scales to ~33T tokens, and post-training runs SFT, teacher specialization, two on-policy distillation stages and agentic RL inside harnesses like OpenClaw and Hermes Agent. It leads larger MoEs such as Qwen3.6-35B-A3B on most tool-use and instruction-following benchmarks but trails on knowledge and coding tasks like SWE-Bench Verified. It decodes 184 tok/s on an M5 Max and up to 21K tok/s on a B300, and ships with transformers code and an OpenAI-compatible harness configuration.

The quest for software engineering knowledge.

Look:
Layout: