File size: 1,941 Bytes
830e33a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
services:
  # ── LFM3-1.7B with a training-free depth loop (arXiv 2605.23872) ──
  # Window [8-11] executed twice, each application contributing half a residual
  # step (damped Euler, K=2). Baked as a plain 28-layer GGUF: the window's
  # post_attention_norm / post_ffw_norm weights are scaled by 0.5 in both the
  # original layers and the copies, which is exact (both HF and llama.cpp apply
  # them as RMSNorm on the branch output, before the residual add).
  #
  # Build the file with:
  #   python3 scripts/loop_gguf_k.py base.gguf \
  #       loop.gguf 8 11 2 0.5
  #   python3 scripts/check_loop_gguf.py base.gguf \
  #       loop.gguf 8 11 2 0.5
  #
  # Measured (RTX 4070, Q8_0, -ngl 99): pp512 18184 -> 16699 t/s, tg128
  # 160.3 -> 142.6 t/s (-8.2% / -11.1%), params 1.73B -> 1.97B.
  # ARC-Easy 5-shot 1000q: 60.8% -> 69.2%. GSM8K 80q: 67.5% -> 61.3% (n.s.).
  lfm3-1.7b-loop:
    # build this image as described in REPRODUCE.md (llama.cpp master >= 1014775c8 + CUDA runtime)
    image: lfm3-llama:master-1014775c8
    container_name: lfm3-1.7b-loop
    restart: unless-stopped
    ports:
      - "8080:8080"
    volumes:
      - ./models:/models:ro
    entrypoint:
      - /opt/llama/llama-server
      - -m
      - /models/LFM3-1.7B-loop-8-11-Q8_0.gguf
      - --alias
      - lfm3-1.7b-loop
      - --jinja
      - -ngl
      - "99"
      - -fa
      - "on"
      - --parallel
      - "${LFM3_NP:-8}"
      - --kv-unified
      - --temp
      - "0.1"
      - --top-k
      - "50"
      # NOTE: no --repeat-penalty here: it costs ~5% decode (135 -> 128.6 t/s measured)
      # and agents send their own sampling params anyway.
      - --metrics
    command:
      - --host
      - 0.0.0.0
      - --port
      - "8080"
      - -c
      - "${LFM3_CTX:-262144}"
    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              count: all
              capabilities: [gpu]