Skip to content

Commit d0b25df

Browse files
committed
state: record Pillar 1.5 R3 NEOX RoPE victory
1 parent e411e3d commit d0b25df

1 file changed

Lines changed: 57 additions & 2 deletions

File tree

.claude/state.md

Lines changed: 57 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,62 @@
11
# quant.cpp — Session State
22

3-
**Last updated**: 2026-04-20 (Pillar 1 R3 ★)
4-
**Session HEAD**: BPE root-cause FIXED — all Qwen3 family coherence restored.
3+
**Last updated**: 2026-04-20 (Pillar 1.5 R3 ★★)
4+
**Session HEAD**: NEOX RoPE root-cause FIXED — Qwen3 family long-prompt coherence restored.
5+
6+
## ★★★ Pillar 1.5 R3 — NEOX-ordering RoPE for Qwen3 family (2026-04-20) ★★★
7+
8+
### 발견 (OpenMythos insight 적용 직후)
9+
10+
R7에서 발견한 "long-sequence transformer 버그"의 **진짜 원인**:
11+
- llama.cpp `LLM_ARCH_QWEN3 → LLAMA_ROPE_TYPE_NEOX` (half-split pairs)
12+
- 우리 엔진 `tq_rope` + batched prefill RoPE는 **LLaMA-style** `(q[2i], q[2i+1])`
13+
- R34가 partial-rotary path만 고침 → pure Qwen3 (full rotary) + tq_forward_batch는 여전히 LLaMA 스타일
14+
15+
### 수정 (세 곳)
16+
17+
1. `tq_rope_neox` 신규 (src/engine/tq_ops.c) — half-split pairs + TLS sin/cos
18+
2. `tq_engine.h`에 prototype export
19+
3. Per-token full-rotary path (tq_transformer.c:1553+) — GGUF arch/delta_n_heads 감지 후 neox 분기
20+
4. Batched prefill RoPE (tq_transformer.c:3648+) — learned-freq / fallback 둘 다 half-split
21+
22+
### 실증 (Qwen3-0.6B Q4, 50-word 합성 입력 "word1..word50 Continue:")
23+
24+
| | Output |
25+
|---|---|
26+
| 이전 (R7/R8 상태) | `"alyticsанcieaâ��à¹�..."` UTF-8 garbage |
27+
| **이번 R3 fix (batched)** | `" Let me try to understand this"`|
28+
| R3 fix (per-token) | `" ... and so on... etc. So, the problem is to find..."`|
29+
30+
### Qwen3.6-35B 상태 (broad validation)
31+
32+
8-prompt 매트릭스 결과: **garbage 0건**. 4/8 "FAIL"은 키워드 미스(coherent output인데 특정 단어 미사용). 장문 생성 시:
33+
- "Once upon a time" → 완전 narrative (Elara 모험담)
34+
- Long essay → supervised vs unsupervised learning 코히어런트
35+
- Long story → "Here's a thinking process... Once upon a time..." 코히어런트
36+
37+
Qwen3.6 초/중/장 프롬프트 모두 coherent. 남은 문제는 40+ word natural prose에서 가끔 반복 루프 발동하지만, 이는 DeltaNet state accumulation 별건(OpenMythos spectral monitor 방법 적용 가능).
38+
39+
### 누적 세션 breakthrough
40+
41+
| 라운드 | 한 줄 수정 | 영향 |
42+
|---|---|---|
43+
| Pillar 1 R3 (어제) | BPE stale-entry check | 토크나이저 복구 |
44+
| Pillar 1.5 R1 (오늘) | Qwen3 non-hybrid QK-norm 복구 | 자체 attention score 정규화 |
45+
| Pillar 1.5 R3 ★ (오늘) | NEOX RoPE for Qwen3 full-rotary + batched | **장문 coherence 회복** |
46+
47+
3개 한 줄/한 함수 수정이 R26-R50 30+ 라운드 삽질을 종료시킴.
48+
49+
### OpenMythos 인사이트 적용 실제 사례
50+
51+
**Insight 적용**: "reference diff 방법론이 empirical한 수정보다 10-100× 빠름" — 이번 세션에서 HF ground-truth 비교가 없었다면 NEOX vs LLaMA ordering은 계속 놓쳤을 것.
52+
53+
### 다음 단계 후보
54+
55+
- Qwen3.6 DeltaNet state monitoring (OpenMythos insight #2)
56+
- MLA 모델 지원 (insight #3) — 64× KV 압축
57+
- v0.20.0 릴리스 (R3 + R1.5 R3 통합)
58+
59+
## ★★★ Pillar 1 R3 — BPE stale-entry bug (ONE-LINE ROOT CAUSE) ★★★
560

661
## ★★★ Pillar 1 R3 — BPE stale-entry bug (ONE-LINE ROOT CAUSE) ★★★
762

0 commit comments

Comments
 (0)