rogermt commited on
Commit
cd8c1ce
Β·
verified Β·
1 Parent(s): 5c3da19

Add TRM solver skill for agent guidance

Browse files
Files changed (1) hide show
  1. trm_solver/SKILL.md +76 -0
trm_solver/SKILL.md ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # TRM Solver Skill β€” NeuroGolf 2026
2
+
3
+ ## Purpose
4
+ Use Kilo (headless DeepSeek CLI) to analyze ARC-AGI tasks and drive a tiny NN executor that exports ONNX models for NeuroGolf submission.
5
+
6
+ ## Pipeline
7
+ ```
8
+ ARC task JSON β†’ render as image β†’ kilo run β†’ markdown output β†’ parse TransformSpec β†’ create NN β†’ export ONNX
9
+ ```
10
+
11
+ ## Key files
12
+ - `trm_solver/executor.py` β€” 14 transform NN implementations + ONNX export
13
+ - `trm_solver/kilo_bridge.py` β€” full pipeline: render β†’ Kilo β†’ parse β†’ NN β†’ ONNX
14
+ - `trm_solver/README.md` β€” usage and transform catalog
15
+
16
+ ## How to run
17
+
18
+ ### Quick test (no LLM needed)
19
+ ```bash
20
+ python trm_solver/kilo_bridge.py --dry-run
21
+ ```
22
+
23
+ ### Single task
24
+ ```bash
25
+ python trm_solver/kilo_bridge.py --task data/training/007bbfb7.json --output-dir onnx_models
26
+ ```
27
+
28
+ ### Batch (overnight for full 400)
29
+ ```bash
30
+ python trm_solver/kilo_bridge.py --data-dir data/training --output-dir onnx_models
31
+ ```
32
+
33
+ ### From Kaggle (SDK tunnel)
34
+ ```bash
35
+ python trm_solver/kilo_bridge.py --data-dir data/training --use-sdk --server-url http://localhost:8765
36
+ ```
37
+
38
+ ## Kilo prompt format
39
+ The prompt is in `kilo_bridge.py` as `KILO_PROMPT_TEMPLATE`. It instructs DeepSeek to output:
40
+
41
+ ```markdown
42
+ ## Transform
43
+ name: <transform_name>
44
+
45
+ ## Parameters
46
+ - param1: value1
47
+ ```
48
+
49
+ Available transforms: identity, color_map, flip, transpose, rotate, upscale, kron_self_similar, tile_repeat, concat_patterns, pos_color_lut, spatial_gather, onehot_conv, onehot_linear.
50
+
51
+ ## What to do when Kilo gets it wrong
52
+ 1. Edit the `_spec.json` file in the output directory
53
+ 2. Re-export manually:
54
+ ```python
55
+ from trm_solver.executor import TransformSpec, create_transform_nn, export_to_onnx
56
+ spec = TransformSpec(name="correct_name", params={...})
57
+ model = create_transform_nn(spec)
58
+ export_to_onnx(model, (H, W), "task_id.onnx")
59
+ ```
60
+
61
+ ## ONNX size targets
62
+ - Most transforms: 0-1000 params (< 10 KB ONNX)
63
+ - onehot_conv (3Γ—3): 900 params (~12 KB)
64
+ - onehot_conv (5Γ—5): 2500 params (~30 KB)
65
+ - Target: keep all models under 50 KB for NeuroGolf
66
+
67
+ ## Verification
68
+ ```bash
69
+ # Check ONNX model works
70
+ python -c "
71
+ import onnxruntime as ort
72
+ import numpy as np
73
+ sess = ort.InferenceSession('onnx_models/007bbfb7.onnx')
74
+ out = sess.run(None, {'input': np.zeros((1,1,3,3), dtype=np.float32)})
75
+ print(out[0].shape)
76
+ "