← Back to AI Insights
Gemini Executive Synthesis

llm.asm inference (`asm-llm`) multi-threading performance under CPU contention.

Technical Positioning
Stable and predictable inference performance, even when competing with other CPU-bound processes.
SaaS Insight & Market Implications
The `asm-llm` inference engine experiences a severe ~20x performance degradation when its thread count matches hardware threads and other CPU-bound processes compete for cores. This issue stems from its unbounded `pause` loop for worker synchronization and aggressive spinning (`SPIN_LIMIT = 200000`) before falling back to `futex`. When a single worker is preempted, the entire matrix multiplication stalls while other threads waste cycles spinning. This design flaw makes `asm-llm` highly susceptible to CPU contention, rendering its performance unpredictable in shared environments. For a product aiming for fast local LLM inference, such instability is unacceptable. Mitigations like bounded spinning or more efficient synchronization are critical to ensure robust performance and resource-friendly operation, especially in multi-tenant or developer workstation scenarios.
Proprietary Technical Taxonomy
asm-llm decode drops ~20x -t equals hardware threads other processes compete for the cores CPU-bound work decode tok/s 64 tokens quiet machine

Raw Developer Origin & Technical Request

Source Icon GitHub Issue Nov 26, 2026
Repo: alesha-pro/llm.asm
asm-llm: decode drops ~20x when -t equals hardware threads and other processes compete for the cores

### What happens
When other CPU-bound work competes for the same cores, `asm-llm` with a thread count equal to the number of hardware threads slows down by roughly 20x. Lower thread counts degrade only mildly.

### Measured (decode tok/s, 64 tokens)
| `-t` | quiet machine | while an unrelated 8-thread CPU-bound job runs |
|---:|---:|---:|
| 8 | ~84 | 66–70 |
| 16 | 77–80 | 3.5–3.8 |

The numbers come from a desktop that was not perfectly idle, so treat them as indicative; the size of the drop was consistent across runs. Oversubscription without external load looks the same (see the default `-t 32` issue: 2.3 tok/s on 16 threads).

### Reproduce
```bash
# terminal 1: any 8-thread CPU-bound load, e.g.
./build/asm-gpt-train --data data/tinyshakespeare.txt --steps 1500 --seq 256 -t 8 --plain
# terminal 2:
./build/asm-llm -m models/qwen3-0.6b-q8_0.asmbin -p "Explain how a CPU cache works in 3 concise sentences." -n 64 -t 16
```

### What the code does
- Work is split into one fixed slice per thread, and the main thread waits for every worker in an unbounded `pause` loop (`shared/threads.asm:347-360`).
- Idle workers spin for `SPIN_LIMIT = 200000` iterations before falling back to `futex` (`shared/threads.asm:25`, `:125-133`).

**My guess (not confirmed by profiling):** if any single worker is preempted, the whole matmul waits for it while all other threads keep spinning, and with every hardware thread in use some worker is nearly always preempted.

### Possible mitigations
- Bound...

Developer Debate & Comments

No active discussions extracted for this entry yet.

Adjacent Repository Pain Points

Other highly discussed features and pain points extracted from alesha-pro/llm.asm.

Extracted Positioning
llm.asm Mini-GPT trainer (`asm-gpt-train`) argument validation.
Robust argument parsing and validation to prevent misconfiguration and ensure model integrity during training.
Extracted Positioning
llm.asm chat mode (`--chat`) prompt building and KV-cache management.
Adherence to official Qwen3 chat template for multi-turn conversations, ensuring optimal model behavior and context utilization.
Extracted Positioning
llm.asm Mini-GPT trainer and documentation.
Accurate and up-to-date documentation reflecting the current state and performance of the `llm.asm` project.

Frequently Asked Questions

Market intelligence mapped to llm.asm inference (`asm-llm`) multi-threading performance under CPU contention..

What is the technical positioning of llm.asm inference (`asm-llm`) multi-threading performance under CPU contention.?
Based on our AI analysis of the original developer request, its primary technical positioning is: Stable and predictable inference performance, even when competing with other CPU-bound processes.
What architecture is tied to llm.asm inference (`asm-llm`) multi-threading performance under CPU contention.?
Our proprietary extraction maps llm.asm inference (`asm-llm`) multi-threading performance under CPU contention. to adjacent architectural concepts including asm-llm, decode drops ~20x, -t equals hardware threads, other processes compete for the cores.

Engagement Signals

0
Replies
open
Issue Status

Cross-Market Term Frequency

Counts stored text matches for foundational terms like spinning and asm-llm in analysed public discussions. These counts do not measure adoption.

Stored text matches, not adoption or market-share measurements.

  • spinning: 3 records
  • asm-llm: 2 records
  • decode tok/s: 2 records
  • 64 tokens: 2 records
  • CPU cache: 2 records
  • decode drops ~20x: 1 records
  • -t equals hardware threads: 1 records
  • other processes compete for the cores: 1 records
  • CPU-bound work: 1 records
  • quiet machine: 1 records
  • unrelated 8-thread CPU-bound job: 1 records
  • desktop that was not perfectly idle: 1 records
  • oversubscription: 1 records
  • external load: 1 records
  • default -t 32 issue: 1 records
  • Work is split into one fixed slice per thread: 1 records
  • main thread waits for every worker: 1 records
  • unbounded pause loop: 1 records
  • shared/threads.asm:347-360: 1 records
  • Idle workers spin for SPIN_LIMIT = 200000 iterations: 1 records
  • falling back to futex: 1 records
  • shared/threads.asm:25: 1 records
  • :125-133: 1 records
  • preempted: 1 records
  • matmul waits: 1 records
  • hardware thread in use: 1 records
  • Possible mitigations: 1 records