Oleksandr Kuzmenko, EditorPublished 7 min readAI-assisted · editor-reviewed
TL;DR
- Compile-time AST autotuning matches or outperforms manual assembly micro-optimizations across diverse CPU instruction sets.
- Generating hardware-specific JSON sidecar profiles eliminates repetitive profiling during application startup.
- Writing neural loaders, dispatch queues, and GPU shaders in a single strongly-typed language removes multi-language build system friction.
Key facts
- Speech-to-text vs whisper.cpp
- 5x faster on Apple M1 (self-reported)
- Qwen3.6-35B-A3B prefill (EPYC)
- 2.3x speedup (self-reported)
- Qwen3.6-35B-A3B prefill (Graviton)
- 2.8x speedup (self-reported)
- Hardware profiles
- Pre-tuned for NEON, i8mm, SVE, AVX2, VNNI-512, AMX
Source: Key facts — Qwen3.6-35B-A3B prefill (EPYC), Qwen3.6-35B-A3B prefill (Graviton)
Source: Key facts. Qwen3.6-35B-A3B prefill (EPYC): 2.3x speedup (self-reported). Qwen3.6-35B-A3B prefill (Graviton): 2.8x speedup (self-reported). The chart compares only values that share a unit. Each figure is copied from the story.
Metric chart
- 2.3x speedup (self-reported)Qwen3.6-35B-A3B prefill (EPYC)
- 2.8x speedup (self-reported)Qwen3.6-35B-A3B prefill (Graviton)
- Qwen3.6-35B-A3B prefill (EPYC)2.3x speedup (self-reported)
- Qwen3.6-35B-A3B prefill (Graviton)2.8x speedup (self-reported)
Eliminating Kernel Explosion with AST Autotuning
Traditional inference runtimes like llama.cpp rely on thousands of lines of hand-crafted intrinsics maintained across multiple CPU instruction sets. When building real-time voice translation into game engines where the GPU was saturated by rendering frames, developers faced strict CPU latency limits. Integrating massive C++ codebases for small models proved inefficient, prompting the port of Whisper to daslang.
Rather than hand-writing individual compute kernels for every permutation of data type, CPU instruction, and tensor shape, dasllama utilizes compile-time AST macros:
[tune_perm(dot = "vpdpbusd", width = 512, mr = 16, requires = "avx512vnni,avx512bw")]
[tune_perm(dot = "amx_bf16", width = 512, mr = 16, nrsplit = 2, requires = "amx-bf16,avx512bf16,avx512vnni")]
[tune(gen = "dasllama_gemm_gen::k4_tile", fallback = "dot_vpdpbusd_width512_mr16")]
def k4q8_tile_gen(var yp : float?; kqg : uint8 const?; ksg : uint8 const?;
xqp : int8 const?; xsp : float const?; xbsp : int const?) {
kq_tile_ref(4, yp, kqg, ksg, xqp, xsp, xbsp, n, d, g, t0);
}Runtime Benchmarks and Hardware Sidecars
Under JIT execution, dasllama races available vectorization widths, loop unroll counts, and hardware intrinsics on the host machine. The optimal configuration is cached in a JSON sidecar file, bypassing profiling on future runs. This autotuning mechanism yields measured speedups over universal hand-tuned engines:
- Whisper Speech-to-Text: 5x faster than baseline
whisper.cppon Apple M1. - Qwen3.6-35B-A3B Prefill: 2.3x speedup on AMD EPYC and 2.8x on AWS Graviton.
- Unified Codebase: Tokenizers, runtime schedulers, Vulkan SPIR-V shaders, and OpenAI-compatible API servers are written entirely in
daslangwithout C++ FFI bindings.
Try it in 2 minutes
[tune(gen = "dasllama_gemm_gen::k4_tile", fallback = "dot_vpdpbusd_width512_mr16")]
def k4q8_tile_gen(var yp : float?; kqg : uint8 const?;
ksg : uint8 const?; xqp : int8 const?;
xsp : float const?; xbsp : int const?) {
kq_tile_ref(4, yp, kqg, ksg, xqp, xsp, xbsp, n, d, g, t0);
}When to use
- Deploy when running speech transcription, translation, or LLM prefill on resource-shared CPU hardware.
- Use when integrating local agent capabilities into desktop applications without bundling heavy C++ compilers.
- Ideal for cross-architecture deployments across diverse x86 and ARM cloud instances.
When NOT to use
- Do not use when high-end GPU VRAM is completely unconstrained and already handles all batching overhead.
- Avoid if your production pipeline requires verified OpenBLAS or vendor-certified cuBLAS certifications.
- Not ideal for projects that cannot accommodate JIT compilation runs or custom sidecar artifacts.
What to do today
- Benchmark CPU-bound speech recognition tasks against dasllama to evaluate latency gains on host instances.
- Adopt pre-computed hardware sidecar configs when shipping embedded or desktop local models.
- Evaluate AST-level compile-time unrolling macros to minimize matrix multiplication kernels in custom runtimes.
Step names are taken from What to do today.
Step names are taken from What to do today. Benchmark CPU-bound speech recognition tasks against dasllama to evaluate latency gains on host instances.. Adopt pre-computed hardware sidecar configs when shipping embedded or desktop local models.. Evaluate AST-level compile-time unrolling macros to minimize matrix multiplication kernels in custom runtimes.
- Benchmark CPU-bound speech recognition tasks against dasllama to evaluate latency gains on host instances.
- Adopt pre-computed hardware sidecar configs when shipping embedded or desktop local models.
- Evaluate AST-level compile-time unrolling macros to minimize matrix multiplication kernels in custom runtimes.
