Skip to content

Commit f0b3f3e

Browse files
evilsocketclaude
andcommitted
feat(autoresearch): add network protocol task, standardize branch naming
New autoresearch task: - network/protocol: message serialization, tensor wire format, zstd compression, CRC32 checksums, auth handshake, discovery packets, topology layer lookup and auto-assignment Branch naming (all 11 tasks): - Replaced date-tag scheme (autoresearch/<task>/<tag>) with fixed branch names matching directory path (autoresearch/backends/cuda, autoresearch/models/tts, autoresearch/network/protocol, etc.) - Updated all program.md files and README.md Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 4a85717 commit f0b3f3e

14 files changed

Lines changed: 447 additions & 71 deletions

File tree

autoresearch/README.md

Lines changed: 44 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Cake Autoresearch
22

3-
Autonomous optimization of inference throughput across models, backends, and kernels.
3+
Autonomous optimization of inference throughput across models, backends, kernels, and network.
44

55
## Concept
66

@@ -17,15 +17,18 @@ autoresearch/
1717
├── models/ # Model-specific optimization
1818
│ ├── text-inference/ # Attention, MLP, cache, transformer blocks
1919
│ ├── moe/ # Mixture-of-Experts routing and dispatch
20+
│ ├── tts/ # TTS: diffusion head, DDPM, VAE, vocoder, mel
2021
│ └── image-generation/ # FLUX/Stable Diffusion components
2122
├── backends/ # Backend-specific GPU/CPU optimization
2223
│ ├── cuda/ # NVIDIA CUDA kernels (ops.cu, ops.rs)
2324
│ ├── metal/ # Apple Metal shaders (ops.msl)
2425
│ └── vulkan/ # Vulkan/wgpu compute shaders (ops.wgsl)
25-
└── kernels/ # Kernel-specific fused operation optimization
26-
├── attention/ # Scaled dot-product attention
27-
├── fused-ops/ # silu_mul, rms_norm, add3, add_scaled, etc.
28-
└── quantization/ # FP8 dequantization and weight preprocessing
26+
├── kernels/ # Kernel-specific fused operation optimization
27+
│ ├── attention/ # Scaled dot-product attention
28+
│ ├── fused-ops/ # silu_mul, rms_norm, add3, add_scaled, etc.
29+
│ └── quantization/ # FP8 dequantization and weight preprocessing
30+
└── network/ # Distributed inference protocol
31+
└── protocol/ # Serialization, topology, auth, discovery
2932
```
3033

3134
Each task directory contains:
@@ -43,11 +46,24 @@ Generated at runtime (gitignored):
4346
| `baseline.txt` | Baseline benchmark score from `prepare.sh` |
4447
| `experiments.tsv` | Tab-separated experiment log |
4548

49+
## Branching
50+
51+
Each task uses a **fixed branch name** matching its directory path:
52+
53+
```bash
54+
git checkout -b autoresearch/backends/cuda # CUDA kernels
55+
git checkout -b autoresearch/models/tts # TTS models
56+
git checkout -b autoresearch/network/protocol # Network protocol
57+
# etc.
58+
```
59+
60+
No date tags — one branch per task. Merge to main when done.
61+
4662
## Quick Start
4763

4864
```bash
4965
# 1. Pick a task
50-
cd autoresearch/kernels/fused-ops
66+
cd autoresearch/network/protocol
5167

5268
# 2. Run setup (builds, benchmarks baseline)
5369
bash prepare.sh
@@ -81,31 +97,39 @@ bash prepare.sh
8197

8298
### Models
8399

84-
| Task | Target | Primary Metric | Benchmarks |
85-
|------|--------|----------------|------------|
86-
| text-inference | Common text model components | Forward pass time | attention, mlp, blocks, cache |
87-
| moe | MoE routing and expert dispatch | MoE forward time | moe, expert_provider |
88-
| image-generation | FLUX/SD image pipeline | Component time | flux |
100+
| Task | Branch | Target | Benchmarks |
101+
|------|--------|--------|------------|
102+
| text-inference | `autoresearch/models/text-inference` | Attention, MLP, cache, blocks | attention, mlp, blocks, cache |
103+
| moe | `autoresearch/models/moe` | MoE routing and dispatch | moe, expert_provider |
104+
| tts | `autoresearch/models/tts` | Diffusion head, DDPM, VAE, vocoder | prediction_head, ddpm, connectors, mel, wav |
105+
| image-generation | `autoresearch/models/image-generation` | FLUX/SD pipeline | flux |
89106

90107
### Backends
91108

92-
| Task | Target | Hardware | Benchmarks |
109+
| Task | Branch | Hardware | Benchmarks |
93110
|------|--------|----------|------------|
94-
| cuda | CUDA kernels (ops.cu) | NVIDIA GPU | fused ops (GPU path) |
95-
| metal | Metal shaders (ops.msl) | Apple Silicon | fused ops (GPU path) |
96-
| vulkan | WGSL compute shaders (ops.wgsl) | Vulkan 1.3+ GPU | vulkan benchmarks |
111+
| cuda | `autoresearch/backends/cuda` | NVIDIA GPU | fused ops (GPU path) |
112+
| metal | `autoresearch/backends/metal` | Apple Silicon | fused ops (GPU path) |
113+
| vulkan | `autoresearch/backends/vulkan` | Vulkan 1.3+ GPU | vulkan benchmarks |
97114

98115
### Kernels
99116

100-
| Task | Target | Primary Metric | Benchmarks |
101-
|------|--------|----------------|------------|
102-
| attention | Attention implementations | Attention forward time | attention, linear_attn |
103-
| fused-ops | Fused activation/norm ops | Per-op latency | bench_utils fused ops |
104-
| quantization | FP8/GPTQ dequantization | Dequant throughput | quantization, flux dequant |
117+
| Task | Branch | Target | Benchmarks |
118+
|------|--------|--------|------------|
119+
| attention | `autoresearch/kernels/attention` | Attention implementations | attention, linear_attn |
120+
| fused-ops | `autoresearch/kernels/fused-ops` | Fused activation/norm ops | bench_utils fused ops |
121+
| quantization | `autoresearch/kernels/quantization` | FP8/GPTQ dequantization | quantization, flux dequant |
122+
123+
### Network
124+
125+
| Task | Branch | Target | Benchmarks |
126+
|------|--------|--------|------------|
127+
| protocol | `autoresearch/network/protocol` | Serialization, topology, auth, discovery | protocol, serialization, discovery, topology, auth |
105128

106129
## Prerequisites
107130

108131
- Rust toolchain (stable)
109132
- `cargo bench` support (divan benchmarks)
110133
- For backend tasks: appropriate GPU + feature flags (cuda, metal, vulkan)
134+
- For TTS tasks: `--features vibevoice,luxtts`
111135
- No model downloads required — all benchmarks use synthetic tensors

autoresearch/backends/cuda/program.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,8 @@ NVIDIA hardware. Lower is better.
1111

1212
## Setup
1313

14-
1. **Agree on a run tag**: e.g. `mar23`. Branch: `autoresearch/cuda/<tag>`.
15-
2. **Create the branch**: `git checkout -b autoresearch/cuda/<tag>`
16-
3. **Read the in-scope files**:
14+
1. **Create the branch**: `git checkout -b autoresearch/backends/cuda`
15+
2. **Read the in-scope files**:
1716
- `cake-core/src/backends/cuda/ops.cu` — Raw CUDA PTX kernels. **Primary target.**
1817
Contains all fused operation kernels: silu_mul, stable_softplus, rms_norm_gated,
1918
add_rms_norm, rms_norm_channel, add3, add_scaled, depthwise_conv1d_silu,
@@ -25,8 +24,8 @@ NVIDIA hardware. Lower is better.
2524
- `cake-core/src/backends/cuda/compat/` — CUDA version compatibility layer.
2625
- `cake-core/src/backends/mod.rs` — ComputeBackend trait definition.
2726
- `cake-core/benches/bench_utils.rs` — Backend operation benchmarks (fused_*_gpu variants).
28-
4. **Run prepare.sh**: `bash autoresearch/backends/cuda/prepare.sh`
29-
5. **Confirm baseline** and start experimenting.
27+
3. **Run prepare.sh**: `bash autoresearch/backends/cuda/prepare.sh`
28+
4. **Confirm baseline** and start experimenting.
3029

3130
**IMPORTANT**: This task requires an NVIDIA GPU with CUDA support. Build with `--features cuda`.
3231

autoresearch/backends/metal/program.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@ memory-bandwidth-bound at ~200-400 GiB/s depending on the chip. Lower is better.
1010

1111
## Setup
1212

13-
1. **Agree on a run tag**: e.g. `mar23`. Branch: `autoresearch/metal/<tag>`.
14-
2. **Create the branch**: `git checkout -b autoresearch/metal/<tag>`
15-
3. **Read the in-scope files**:
13+
1. **Create the branch**: `git checkout -b autoresearch/backends/metal`
14+
2. **Read the in-scope files**:
1615
- `cake-core/src/backends/metal/ops.msl` — Metal Shading Language compute kernels.
1716
**Primary target.** Contains all fused ops: silu_mul, stable_softplus, rms_norm_gated,
1817
add_rms_norm, rms_norm_channel, add3, add_scaled, depthwise_conv1d_silu,
@@ -21,8 +20,8 @@ memory-bandwidth-bound at ~200-400 GiB/s depending on the chip. Lower is better.
2120
implementation, MSL compilation, command buffer management, synchronization logic.
2221
- `cake-core/src/backends/mod.rs` — ComputeBackend trait definition.
2322
- `cake-core/benches/bench_utils.rs` — Backend operation benchmarks.
24-
4. **Run prepare.sh**: `bash autoresearch/backends/metal/prepare.sh`
25-
5. **Confirm baseline** and start experimenting.
23+
3. **Run prepare.sh**: `bash autoresearch/backends/metal/prepare.sh`
24+
4. **Confirm baseline** and start experimenting.
2625

2726
**IMPORTANT**: This task requires a Mac with Apple Silicon or Intel GPU. Build with `--features metal`.
2827

autoresearch/backends/vulkan/program.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@ compute shaders. Lower is better.
1010

1111
## Setup
1212

13-
1. **Agree on a run tag**: e.g. `mar23`. Branch: `autoresearch/vulkan/<tag>`.
14-
2. **Create the branch**: `git checkout -b autoresearch/vulkan/<tag>`
15-
3. **Read the in-scope files**:
13+
1. **Create the branch**: `git checkout -b autoresearch/backends/vulkan`
14+
2. **Read the in-scope files**:
1615
- `cake-core/src/backends/vulkan/ops.wgsl` — WGSL compute shaders. **Primary target.**
1716
Contains: elementwise ops (silu_mul, add3, add_scaled, rms_norm_gated, add_rms_norm,
1817
stable_softplus, exp_mul, sub_mul) and matrix operations (GEMV with tiled 4×64 layout,
@@ -24,8 +23,8 @@ compute shaders. Lower is better.
2423
- `cake-core/benches/bench_vulkan.rs` — Vulkan-specific benchmarks (GEMV, GEMM, silu_mul,
2524
add3, rms_norm, MLP, dispatch overhead).
2625
- `cake-core/benches/bench_utils.rs` — Backend operation benchmarks.
27-
4. **Run prepare.sh**: `bash autoresearch/backends/vulkan/prepare.sh`
28-
5. **Confirm baseline** and start experimenting.
26+
3. **Run prepare.sh**: `bash autoresearch/backends/vulkan/prepare.sh`
27+
4. **Confirm baseline** and start experimenting.
2928

3029
**IMPORTANT**: This task requires a Vulkan 1.3+ GPU. Build with `--features vulkan`.
3130

autoresearch/kernels/attention/program.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@ single most expensive operation in every transformer forward pass. Lower is bett
1010

1111
## Setup
1212

13-
1. **Agree on a run tag**: e.g. `mar23`. Branch: `autoresearch/attention/<tag>`.
14-
2. **Create the branch**: `git checkout -b autoresearch/attention/<tag>`
15-
3. **Read the in-scope files**:
13+
1. **Create the branch**: `git checkout -b autoresearch/kernels/attention`
14+
2. **Read the in-scope files**:
1615
- `cake-core/src/models/common/attention.rs` — CausalSelfAttention: Q/K/V projection,
1716
rotary position embeddings (RoPE), optional QK normalization, grouped-query attention
1817
(GQA) head repeat, scaled dot-product attention dispatch, output projection.
@@ -27,8 +26,8 @@ single most expensive operation in every transformer forward pass. Lower is bett
2726
- `cake-core/benches/bench_attention.rs` — Attention benchmarks.
2827
- `cake-core/benches/bench_linear_attn.rs` — GatedDeltaNet linear attention benchmarks.
2928
- `cake-core/benches/bench_cache.rs` — Cache benchmarks.
30-
4. **Run prepare.sh**: `bash autoresearch/kernels/attention/prepare.sh`
31-
5. **Confirm baseline** and start experimenting.
29+
3. **Run prepare.sh**: `bash autoresearch/kernels/attention/prepare.sh`
30+
4. **Confirm baseline** and start experimenting.
3231

3332
## Files You May Modify
3433

autoresearch/kernels/fused-ops/program.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,8 @@ for micro-optimization. Lower is better.
1111

1212
## Setup
1313

14-
1. **Agree on a run tag**: e.g. `mar23`. Branch: `autoresearch/fused-ops/<tag>`.
15-
2. **Create the branch**: `git checkout -b autoresearch/fused-ops/<tag>`
16-
3. **Read the in-scope files**:
14+
1. **Create the branch**: `git checkout -b autoresearch/kernels/fused-ops`
15+
2. **Read the in-scope files**:
1716
- `cake-core/src/backends/cpu/mod.rs` — CPU implementations of all fused ops. These are the
1817
default fallback and what benchmarks measure without GPU features.
1918
- `cake-core/src/backends/mod.rs` — ComputeBackend trait defining the fused op interface.
@@ -23,8 +22,8 @@ for micro-optimization. Lower is better.
2322
`fused_rms_norm_channel_cpu`, `fused_depthwise_conv1d_silu_cpu`, `fused_depthwise_conv1d_bias_cpu`,
2423
and GPU variants.
2524
- `cake-core/benches/bench_helpers.rs` — Shared helpers.
26-
4. **Run prepare.sh**: `bash autoresearch/kernels/fused-ops/prepare.sh`
27-
5. **Confirm baseline** and start experimenting.
25+
3. **Run prepare.sh**: `bash autoresearch/kernels/fused-ops/prepare.sh`
26+
4. **Confirm baseline** and start experimenting.
2827

2928
## Files You May Modify
3029

autoresearch/kernels/quantization/program.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@ for quantized models, making it one of the highest-frequency operations. Lower i
1010

1111
## Setup
1212

13-
1. **Agree on a run tag**: e.g. `mar23`. Branch: `autoresearch/quantization/<tag>`.
14-
2. **Create the branch**: `git checkout -b autoresearch/quantization/<tag>`
15-
3. **Read the in-scope files**:
13+
1. **Create the branch**: `git checkout -b autoresearch/kernels/quantization`
14+
2. **Read the in-scope files**:
1615
- `cake-core/src/utils/quantization.rs` — GPTQ 4-bit dequantization, FP8 blockwise
1716
dequantization, weight format detection, quantization utilities.
1817
- `cake-core/src/backends/cpu/mod.rs` — CPU FP8 dequant: software decoding of E4M3
@@ -26,8 +25,8 @@ for quantized models, making it one of the highest-frequency operations. Lower i
2625
FP8 blockwise).
2726
- `cake-core/benches/bench_flux.rs` — FP8 linear forward, F8 dequant benchmarks.
2827
- `cake-core/benches/bench_utils.rs` — fp8_linear_forward_cpu, fp8_linear_forward_with_bias_cpu.
29-
4. **Run prepare.sh**: `bash autoresearch/kernels/quantization/prepare.sh`
30-
5. **Confirm baseline** and start experimenting.
28+
3. **Run prepare.sh**: `bash autoresearch/kernels/quantization/prepare.sh`
29+
4. **Confirm baseline** and start experimenting.
3130

3231
## Files You May Modify
3332

autoresearch/models/image-generation/program.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,14 @@ text encoders (T5, CLIP), timestep embedding, and FP8 linear layers. Lower is be
99

1010
## Setup
1111

12-
1. **Agree on a run tag**: e.g. `mar23`. Branch: `autoresearch/image-generation/<tag>`.
13-
2. **Create the branch**: `git checkout -b autoresearch/image-generation/<tag>`
14-
3. **Read the in-scope files**:
12+
1. **Create the branch**: `git checkout -b autoresearch/models/image-generation`
13+
2. **Read the in-scope files**:
1514
- `cake-core/src/models/flux/` — FLUX transformer, T5/CLIP encoders, VAE, shardable variants.
1615
- `cake-core/src/models/sd/` — Stable Diffusion: CLIP, VAE, U-Net, scheduler.
1716
- `cake-core/benches/bench_flux.rs` — FLUX component benchmarks.
1817
- `cake-core/benches/bench_helpers.rs` — Shared helpers.
19-
4. **Run prepare.sh**: `bash autoresearch/models/image-generation/prepare.sh`
20-
5. **Confirm baseline** and start experimenting.
18+
3. **Run prepare.sh**: `bash autoresearch/models/image-generation/prepare.sh`
19+
4. **Confirm baseline** and start experimenting.
2120

2221
## Files You May Modify
2322

autoresearch/models/moe/program.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@ where K experts are selected from N total for each token. Lower is better.
1010

1111
## Setup
1212

13-
1. **Agree on a run tag**: e.g. `mar23`. Branch: `autoresearch/moe/<tag>`.
14-
2. **Create the branch**: `git checkout -b autoresearch/moe/<tag>`
15-
3. **Read the in-scope files**:
13+
1. **Create the branch**: `git checkout -b autoresearch/models/moe`
14+
2. **Read the in-scope files**:
1615
- `cake-core/src/models/common/mod.rs` — MoE layer: router, top-k gating, expert dispatch, combine.
1716
- `cake-core/src/models/common/expert_provider.rs` — ExpertProvider trait + StackedResidentProvider + IndividualResidentProvider.
1817
- `cake-core/src/models/common/disk_expert_provider.rs` — DiskExpertProvider for memory-mapped expert weights.
@@ -21,8 +20,8 @@ where K experts are selected from N total for each token. Lower is better.
2120
- `cake-core/benches/bench_moe.rs` — MoE forward benchmarks.
2221
- `cake-core/benches/bench_expert_provider.rs` — Expert weight access benchmarks.
2322
- `cake-core/benches/bench_blocks.rs` — MoE block benchmarks (qwen3_moe_block, qwen3_5_moe_block).
24-
4. **Run prepare.sh**: `bash autoresearch/models/moe/prepare.sh`
25-
5. **Confirm baseline** and start experimenting.
23+
3. **Run prepare.sh**: `bash autoresearch/models/moe/prepare.sh`
24+
4. **Confirm baseline** and start experimenting.
2625

2726
## Files You May Modify
2827

autoresearch/models/text-inference/program.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@ with small dimensions (hidden=64) for fast iteration. Lower is better.
1212

1313
To set up a new experiment run, work with the user to:
1414

15-
1. **Agree on a run tag**: propose a tag based on today's date (e.g. `mar23`). The branch `autoresearch/<tag>` must not already exist.
16-
2. **Create the branch**: `git checkout -b autoresearch/text-inference/<tag>` from the current branch.
17-
3. **Read the in-scope files** for full context:
15+
1. **Create the branch**: `git checkout -b autoresearch/models/text-inference`
16+
2. **Read the in-scope files** for full context:
1817
- `cake-core/src/models/common/attention.rs` — CausalSelfAttention: Q/K/V projection, rotary embeddings, scaled dot-product attention, output projection.
1918
- `cake-core/src/models/common/mlp.rs` — MLP: gate/up projection, SiLU activation, down projection.
2019
- `cake-core/src/models/common/transformer.rs` — TransformerBlock: attention + MLP + residual + RmsNorm composition.
@@ -27,9 +26,9 @@ To set up a new experiment run, work with the user to:
2726
- `cake-core/benches/bench_blocks.rs` — Transformer block benchmarks.
2827
- `cake-core/benches/bench_cache.rs` — Cache benchmarks.
2928
- `cake-core/benches/bench_helpers.rs` — Shared benchmark helpers (test_config, make_tensor, etc.).
30-
4. **Run prepare.sh**: `bash autoresearch/models/text-inference/prepare.sh`
31-
5. **Confirm baseline**: Check that `baseline.txt` and `experiments.tsv` were created.
32-
6. **Start experimenting**.
29+
3. **Run prepare.sh**: `bash autoresearch/models/text-inference/prepare.sh`
30+
4. **Confirm baseline**: Check that `baseline.txt` and `experiments.tsv` were created.
31+
5. **Start experimenting**.
3332

3433
## Files You May Modify
3534

0 commit comments

Comments
 (0)