Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
168 commits
Select commit Hold shift + click to select a range
3512801
radeon forge: add package skeleton
rishavsanjay Aug 6, 2026
f5c5c91
radeon forge: define workload and trial contracts
rishavsanjay Aug 6, 2026
ef8e61e
radeon forge: add append-only experiment ledger
rishavsanjay Aug 6, 2026
af475b6
radeon forge: add hard-gated successive halving tuner
rishavsanjay Aug 6, 2026
9185982
radeon forge: parse AMD kernel resource metadata
rishavsanjay Aug 6, 2026
e67955c
radeon forge: add discoverable kernel-family search spaces
rishavsanjay Aug 6, 2026
f568d1d
radeon forge: compile candidate families for gfx1100
rishavsanjay Aug 6, 2026
8ac0ebe
radeon forge: add executable benchmark protocol
rishavsanjay Aug 6, 2026
0439d06
radeon forge: test contracts metadata and hard-gated tuning
rishavsanjay Aug 6, 2026
6b41c83
radeon forge: document architecture metrics and current boundary
rishavsanjay Aug 6, 2026
ea87596
radeon forge: record RDNA3 kernel corpus and provenance
rishavsanjay Aug 6, 2026
125ae83
radeon forge: add scoped deny-by-default permissions
rishavsanjay Aug 6, 2026
9082329
radeon forge: test command protocol and permission gates
rishavsanjay Aug 6, 2026
cfe1770
radeon forge: add native gfx1100 assembly GEMM family
rishavsanjay Aug 6, 2026
5d5d4e8
radeon forge: add workload package
rishavsanjay Aug 6, 2026
fc44f9b
radeon forge: add gfx1100 assembly GEMM benchmark oracle
rishavsanjay Aug 6, 2026
5f75d66
radeon forge: add permissioned gfx1100 tuning CLI
rishavsanjay Aug 6, 2026
2e475df
radeon forge: add deterministic local knowledge retrieval
rishavsanjay Aug 6, 2026
1d54bef
radeon forge: add loopback-only structured local planner
rishavsanjay Aug 6, 2026
db455b1
radeon forge: test local planner privacy and RAG citations
rishavsanjay Aug 6, 2026
f9f86d1
radeon forge: add multi-turn proposal and approval state machine
rishavsanjay Aug 6, 2026
38eb2b5
radeon forge: test multi-turn approval state machine
rishavsanjay Aug 6, 2026
9bd33e2
radeon forge: document agent layer and first hardware gate
rishavsanjay Aug 6, 2026
e9dece1
radeon forge: add unified trace recorder
rishavsanjay Aug 6, 2026
fb2d888
radeon forge: add persistent local backend protocol
rishavsanjay Aug 6, 2026
6a40c7a
radeon forge: add permissioned local tools
rishavsanjay Aug 6, 2026
6bb2d25
radeon forge: add agent-native session loop
rishavsanjay Aug 6, 2026
0923d1c
radeon forge: add unified inference engine
rishavsanjay Aug 6, 2026
d1343d2
radeon forge: export runtime API
rishavsanjay Aug 6, 2026
4f5ba39
radeon forge: add agentic profile analysis
rishavsanjay Aug 6, 2026
e11c861
radeon forge: export profiling API
rishavsanjay Aug 6, 2026
1fb12e1
radeon forge: add deterministic development backend
rishavsanjay Aug 6, 2026
5e2d9fe
radeon forge: add native tinygrad Llama backend
rishavsanjay Aug 6, 2026
4c4ecde
radeon forge: add tinygrad MockGPU correctness oracle
rishavsanjay Aug 6, 2026
883251d
radeon forge: add local web application server
rishavsanjay Aug 6, 2026
d13e976
radeon forge: add integrated UI shell
rishavsanjay Aug 6, 2026
4463dbd
radeon forge: style the local inference UI
rishavsanjay Aug 6, 2026
12dc2f6
radeon forge: wire the interactive UI
rishavsanjay Aug 6, 2026
d34bd5a
radeon forge: add content-addressed megakernel workspace
rishavsanjay Aug 6, 2026
3a8d4d7
radeon forge: add agent-facing optimization tools
rishavsanjay Aug 6, 2026
6508d77
radeon forge: seed typed megakernel contracts
rishavsanjay Aug 6, 2026
7ced140
radeon forge: export synthesis API
rishavsanjay Aug 6, 2026
3dc5eea
radeon forge: export oracle API
rishavsanjay Aug 6, 2026
41c30f1
radeon forge: integrate megakernel workspace and tools
rishavsanjay Aug 6, 2026
fd2117c
radeon forge: expose optimization lab API
rishavsanjay Aug 6, 2026
954ef7b
radeon forge: add megakernel optimization lab UI
rishavsanjay Aug 6, 2026
61babe4
radeon forge: style megakernel optimization lab
rishavsanjay Aug 6, 2026
0db6500
radeon forge: wire megakernel optimization lab
rishavsanjay Aug 6, 2026
71c4c43
radeon forge: serve optimization lab styles
rishavsanjay Aug 6, 2026
9129951
radeon forge: load optimization lab styles
rishavsanjay Aug 6, 2026
dc9eec4
radeon forge: record measured kernel durations
rishavsanjay Aug 6, 2026
069fbff
radeon forge: attach measured kernel and prefill spans
rishavsanjay Aug 6, 2026
7c77b6c
radeon forge: add portable single-file optimization recipes
rishavsanjay Aug 6, 2026
4c4449d
radeon forge: support recipe bundle placeholders
rishavsanjay Aug 6, 2026
55f95f0
radeon forge: export recipe library
rishavsanjay Aug 6, 2026
0fac222
radeon forge: expose recipe import export tools
rishavsanjay Aug 6, 2026
b57e2a8
radeon forge: add standalone recipe cli
rishavsanjay Aug 6, 2026
c889ab4
radeon forge: add portable batch-one recipe example
rishavsanjay Aug 6, 2026
3c5df24
radeon forge: test portable recipe round trips
rishavsanjay Aug 6, 2026
bf5b909
radeon forge: expose portable recipes in engine state
rishavsanjay Aug 6, 2026
ccb3c44
radeon forge: add recipe ui endpoints
rishavsanjay Aug 6, 2026
a2cd1b2
radeon forge: add portable recipe library ui
rishavsanjay Aug 6, 2026
862ecd5
radeon forge: style recipe library ui
rishavsanjay Aug 6, 2026
7b187c6
radeon forge: wire recipe import export ui
rishavsanjay Aug 6, 2026
57d4ee4
radeon forge: stream real tinygrad kernel profile events
rishavsanjay Aug 6, 2026
1d2a48f
radeon forge: reason over actual kernel profile ranges
rishavsanjay Aug 6, 2026
6d92836
radeon forge: harden backend trace field ingestion
rishavsanjay Aug 6, 2026
56277d4
radeon forge: allow named kernel evidence in traces
rishavsanjay Aug 6, 2026
9ebc191
radeon forge: add runtime integration tests
rishavsanjay Aug 6, 2026
c34d637
radeon forge: add externally measured trace durations
rishavsanjay Aug 6, 2026
9e0b696
radeon forge: recover pending tools after denied grants
rishavsanjay Aug 6, 2026
626b050
radeon forge: add compatibility-gated hook registry
rishavsanjay Aug 6, 2026
dd3fcaa
radeon forge: export runtime hook contracts
rishavsanjay Aug 6, 2026
9957b11
radeon forge: preserve hook descriptors in portable recipes
rishavsanjay Aug 6, 2026
4f2d4eb
radeon forge: define concrete optimization hook targets
rishavsanjay Aug 6, 2026
f499051
radeon forge: make optimization hooks execution-stage aware
rishavsanjay Aug 6, 2026
76b872f
radeon forge: export execution-stage hook contracts
rishavsanjay Aug 6, 2026
148765a
radeon forge: scope default hooks to execution stages
rishavsanjay Aug 6, 2026
d88be92
radeon forge: export stage-aware hook predicates
rishavsanjay Aug 6, 2026
bb3ee54
radeon forge: retain local runtime fingerprint metadata
rishavsanjay Aug 6, 2026
ee23326
radeon forge: expose scripted runtime metadata
rishavsanjay Aug 6, 2026
5d945b5
radeon forge: apply stage-specific model hooks with rollback
rishavsanjay Aug 6, 2026
bf739f3
radeon forge: inject active optimization state into model turns
rishavsanjay Aug 6, 2026
e8c3e63
radeon forge: add permissioned stage-aware hook deployment tools
rishavsanjay Aug 6, 2026
83739d7
radeon forge: connect stage-aware hooks to live sessions
rishavsanjay Aug 6, 2026
e27d645
radeon forge: resolve hooks at live inference stage boundaries
rishavsanjay Aug 6, 2026
5089b6c
radeon forge: test stage-specific hook selection and rollback
rishavsanjay Aug 6, 2026
7fb9ffd
ci: validate Radeon Forge branch
rishavsanjay Aug 6, 2026
2488ea1
radeon forge: attribute bottlenecks by execution stage
rishavsanjay Aug 6, 2026
f17ef42
radeon forge: unify direct UI actions with scoped permissions
rishavsanjay Aug 6, 2026
c7b1d74
radeon forge: expose permissioned hook activation and rollback UI API
rishavsanjay Aug 6, 2026
82895d1
radeon forge: visualize execution-stage optimization hooks
rishavsanjay Aug 6, 2026
e5c8892
radeon forge: render and control execution-stage hooks
rishavsanjay Aug 6, 2026
3f177c4
radeon forge: style stage-aware optimization controls
rishavsanjay Aug 6, 2026
fc9655c
radeon forge: fit stage profiler and hook panels
rishavsanjay Aug 6, 2026
f3b0973
radeon forge: test stage-aware kernel profiling
rishavsanjay Aug 6, 2026
2921d94
radeon forge: test portable execution-stage hook round trip
rishavsanjay Aug 6, 2026
3388087
radeon forge: add asynchronous local agent jobs
rishavsanjay Aug 6, 2026
3507232
radeon forge: expose live partial generation and incremental events
rishavsanjay Aug 6, 2026
e881ae0
radeon forge: run local agent turns asynchronously
rishavsanjay Aug 6, 2026
6e0ac05
radeon forge: export asynchronous job runtime
rishavsanjay Aug 6, 2026
e4799d4
radeon forge: stream local agent state through asynchronous UI jobs
rishavsanjay Aug 6, 2026
3cc38f0
radeon forge: stream local agent turns in the UI
rishavsanjay Aug 6, 2026
609fb3c
radeon forge: test live asynchronous agent generation
rishavsanjay Aug 6, 2026
5f48f5a
radeon forge: require complete compatibility evidence for deployment
rishavsanjay Aug 6, 2026
4b94d4b
radeon forge: add stage-aware empirical autotuning
rishavsanjay Aug 6, 2026
20d1189
radeon forge: export empirical search contracts
rishavsanjay Aug 6, 2026
26ad9ba
radeon forge: expose empirical W7900 autotuning to agents
rishavsanjay Aug 6, 2026
40c914c
radeon forge: carry tuned parameters into active runtime hooks
rishavsanjay Aug 6, 2026
1541d95
radeon forge: apply tuned parameters inside stage hooks
rishavsanjay Aug 6, 2026
584a519
radeon forge: test hard-gated stage autotuning
rishavsanjay Aug 6, 2026
b1a95a9
ci: cover stage autotuning tests
rishavsanjay Aug 6, 2026
78b83c3
radeon forge: share stage-specific autotuning spaces
rishavsanjay Aug 6, 2026
1538592
radeon forge: test portable stage autotuning knowledge
rishavsanjay Aug 6, 2026
a3dcf72
radeon forge: require transition oracles for stateful hooks
rishavsanjay Aug 6, 2026
744e088
radeon forge: export safe deployment policy
rishavsanjay Aug 6, 2026
1fc7d59
radeon forge: use transition-safe deployment registry
rishavsanjay Aug 6, 2026
f482c61
radeon forge: test executable adapters and transition-oracle deployment
rishavsanjay Aug 6, 2026
79b58f1
radeon forge: add batched prefill and exact KV reuse accounting
rishavsanjay Aug 6, 2026
7b02494
radeon forge: add exact KV materialization ledger
rishavsanjay Aug 6, 2026
dad3652
radeon forge: use tested KV reuse ledger in local inference
rishavsanjay Aug 6, 2026
b1411f8
radeon forge: test exact KV reuse accounting
rishavsanjay Aug 6, 2026
0fa91c5
ci: cover exact KV accounting
rishavsanjay Aug 6, 2026
db346c3
radeon forge: advertise native inference-engine capabilities
rishavsanjay Aug 6, 2026
6609ba3
radeon forge: add bounded native tool-call stream parser
rishavsanjay Aug 6, 2026
0424b87
radeon forge: test bounded structured tool parsing
rishavsanjay Aug 6, 2026
a02b04d
radeon forge: early-stop on native structured tool calls
rishavsanjay Aug 6, 2026
2e6be35
radeon forge: preserve exact structured tool transcripts
rishavsanjay Aug 6, 2026
370d5ca
radeon forge: test lossless native tool transcripts
rishavsanjay Aug 6, 2026
8c23307
radeon forge: expose native model-serving stream
rishavsanjay Aug 6, 2026
6d7e6be
radeon forge: add OpenAI-compatible local serving adapter
rishavsanjay Aug 6, 2026
6cd0466
radeon forge: hide raw tool protocol from standard streams
rishavsanjay Aug 6, 2026
3125b97
radeon forge: expose OpenAI-compatible local API
rishavsanjay Aug 6, 2026
2af3b95
radeon forge: test OpenAI-compatible local API adapter
rishavsanjay Aug 6, 2026
fe23afa
ci: cover structured tools and OpenAI API
rishavsanjay Aug 6, 2026
bd4ff58
radeon forge: render OpenAI tools into local model prompts
rishavsanjay Aug 6, 2026
ba7829b
radeon forge: inject tool contracts into generic local inference
rishavsanjay Aug 6, 2026
aa7fd3c
radeon forge: test local tool prompt injection
rishavsanjay Aug 6, 2026
32aa6bd
radeon forge: add signal-backed cancellation token
rishavsanjay Aug 6, 2026
c79f8c5
radeon forge: preserve resumable state after cancellation
rishavsanjay Aug 6, 2026
a29dc18
radeon forge: serialize and cancel resident model execution safely
rishavsanjay Aug 6, 2026
cd28964
radeon forge: add cross-token stop sequence matcher
rishavsanjay Aug 6, 2026
9c42981
radeon forge: test cross-token stop handling
rishavsanjay Aug 6, 2026
0996d82
radeon forge: test stop-buffered text transport
rishavsanjay Aug 6, 2026
8b22755
radeon forge: add tool execution provenance context
rishavsanjay Aug 6, 2026
ccd495f
radeon forge: add ROCm counter and ATT capture adapter
rishavsanjay Aug 6, 2026
d7d7240
radeon forge: expose stage-scoped ROCm profiler tools
rishavsanjay Aug 6, 2026
08ccc7e
radeon forge: test evidence-preserving ROCm captures
rishavsanjay Aug 6, 2026
fb538f5
radeon forge: test hardware-grounded profiler findings
rishavsanjay Aug 6, 2026
c1b8a61
radeon forge: compare compatible hardware profile captures
rishavsanjay Aug 6, 2026
0141753
radeon forge: test comparable hardware profile deltas
rishavsanjay Aug 6, 2026
d3f3632
radeon forge: add transformer-block transition oracle
rishavsanjay Aug 6, 2026
c6a6665
radeon forge: test transformer-block oracle harness
rishavsanjay Aug 6, 2026
25ac1ac
radeon forge: generate agent-facing candidate scaffolds
rishavsanjay Aug 6, 2026
0f71f58
radeon forge: test agent candidate scaffold contract
rishavsanjay Aug 6, 2026
d53a7af
radeon forge: add crash-safe local session persistence
rishavsanjay Aug 6, 2026
18a6225
radeon forge: test local session restart recovery
rishavsanjay Aug 6, 2026
e5fac9d
radeon forge: add local model worker plugin registry
rishavsanjay Aug 6, 2026
d951dd5
radeon forge: test local model worker plugins
rishavsanjay Aug 6, 2026
52ed99f
radeon forge: add agent evaluation package
rishavsanjay Aug 6, 2026
e0b663d
radeon forge: add frozen private-agent suite evaluator
rishavsanjay Aug 6, 2026
498e5e5
radeon forge: add local agent-suite benchmark CLI
rishavsanjay Aug 6, 2026
c8b2edb
radeon forge: add frozen private coding-agent suite
rishavsanjay Aug 6, 2026
142c72e
radeon forge: test frozen agent-loop evaluation
rishavsanjay Aug 6, 2026
d01342c
radeon forge: compare agent suites under quality gates
rishavsanjay Aug 6, 2026
9b35ad5
radeon forge: test quality-gated agent latency comparison
rishavsanjay Aug 6, 2026
208493b
radeon forge: test agent-metric deployment gate
rishavsanjay Aug 6, 2026
5492257
radeon forge: normalize recognized ATT and SQTT exports
rishavsanjay Aug 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .github/workflows/radeon-forge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Radeon Forge

on:
push:
branches: [radeon-forge]
paths:
- "extra/radeon_forge/**"
- "test/test_radeon_forge*.py"
- ".github/workflows/radeon-forge.yml"
pull_request:
paths:
- "extra/radeon_forge/**"
- "test/test_radeon_forge*.py"

permissions:
contents: read

jobs:
forge:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Compile Radeon Forge
run: python -m compileall -q extra/radeon_forge test/test_radeon_forge*.py
- name: Run isolated Forge tests
run: >-
python -m unittest -v
test.test_radeon_forge
test.test_radeon_forge_recipe
test.test_radeon_forge_runtime
test.test_radeon_forge_hooks
test.test_radeon_forge_autotune
test.test_radeon_forge_kv
test.test_radeon_forge_tool_stream
test.test_radeon_forge_openai
104 changes: 104 additions & 0 deletions extra/radeon_forge/KERNEL_CORPUS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# Kernel and optimization corpus

This file records the provenance and intended use of initial Radeon Forge implementation families. Inclusion does not imply that a kernel is correct or fast on the W7900. Every candidate must still pass target compilation, resource, numerical, benchmark, and held-out gates.

## Native RDNA3 / gfx1100 seed

### `extra/gemm/amd_asm_matmul.py`

Status: first hardware family.

Properties:

- direct RDNA3 instruction construction through tinygrad's AMD DSL;
- explicitly targets gfx1100;
- 128x128 float32 GEMM tile;
- 128-thread workgroup;
- VOPD-aware accumulator and operand register placement;
- LDS staging and double-buffer-style global prefetch;
- reference check against tinygrad matmul already exists.

Initial tuning/synthesis dimensions:

- FMAC pair order and instruction scheduling;
- prefetch placement and distance;
- `s_clause` grouping;
- waitcnt placement;
- LDS swizzle and padding;
- occupancy limiter used by the harness;
- matrix-shape specialization.

Unsafe dimensions are not exposed as blind scalar knobs. Structural variants must regenerate a complete program and pass the reference oracle.

## Llama fused-kernel patterns

Most current files under `extra/llama_kernels` compile with `HIPCCCompiler("gfx950", ...)`. They are therefore architectural patterns, not accepted gfx1100 candidates.

### Fused RMSNorm / multiply / FP8 quantization

Source:

- `extra/llama_kernels/fused_rmsnorm_mul_quantize_fp8/`

Useful ideas:

- remove intermediate HBM materializations;
- one workgroup per row with grid-stride row processing;
- vectorized BF16 loads;
- fused normalization, weighting, quantization, saved backward state, and amax;
- compile-time workgroup and grid parameters.

Candidate structural variants:

- per-workgroup amax followed by a second reduction;
- scalar global atomic amax;
- workgroup/thread-count choices valid for hidden dimension;
- residual-add fusion;
- direct C/HIP versus UOp representation.

Required before use on W7900:

- successful gfx1100 compilation;
- confirmation that the relevant dtype/intrinsics are supported and performant;
- numerical validation against tinygrad;
- resource metadata and no-spill gate;
- end-to-end relevance to the selected inference model.

### Fused cross entropy

Provenance pattern: upstream tinygrad PR #16263 replaced handwritten C with a portable UOp version while preserving fusion and memory savings. The PR notes that the then-current BEAM-tuned UOp forward remained much slower than handwritten C, while end-to-end training differed far less.

Use in Forge:

- compare direct target-specific code and portable UOp families;
- optimize the end-to-end objective, not an isolated kernel ratio;
- retain the portable family as fallback.

### Atomic amax

Provenance pattern: upstream tinygrad PR #17063 replaces a two-stage amax reduction with atomics to remove repeated reduction-kernel launches.

Use in Forge:

- structural alternative, not assumed winner;
- compare under representative tensor size and contention;
- reject if numerical or end-to-end behavior regresses.

## Compiler-resource oracle

Provenance pattern: upstream tinygrad PR #3641 demonstrates extraction of COMGR executable metadata including VGPR/SGPR counts, LDS, scratch, occupancy, and spill counts.

Forge uses these as hard or diagnostic signals:

- spills may be forbidden by workload contract;
- excess VGPR/LDS use can reject a candidate before expensive trials;
- a kernel that loses occupancy is not automatically rejected, but the trade-off is measured and retained in evidence.

## Corpus policy

1. Record source and target architecture.
2. Distinguish a reusable idea from code verified on gfx1100.
3. Preserve rejected variants and reasons.
4. Never import a claimed benchmark without reproducing it on the assigned W7900.
5. Prefer end-to-end inference improvement over isolated-kernel speedup.
6. Keep tinygrad/UOp implementations as reference and fallback even when direct generated code wins.
160 changes: 160 additions & 0 deletions extra/radeon_forge/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
# Radeon Forge

Radeon Forge is an oracle-guided, fully local performance-engineering agent for private AI workloads on AMD Radeon / ROCm.

The durable project is the workload intent, invariants, correctness oracle, benchmark protocol, hardware evidence, and experiment history. Generated kernel implementations are disposable candidates: Forge may regenerate or replace them, but it may not deploy one that fails a hard oracle.

## Track 2 scenario

A user asks Forge to optimize a locally deployed private agent under explicit constraints, for example:

```text
Minimize P95 end-to-end task latency on a Radeon PRO W7900.
Do not use remote model APIs. Preserve task success within 1% of baseline,
require valid tool calls, forbid kernel spills, and stay below the VRAM limit.
```

Forge decomposes the request, invokes compiler/test/benchmark tools, remembers prior experiments, requests permission for consequential actions, and deploys or rolls back a measured configuration.

## Optimization loop

```text
contract
-> baseline
-> choose kernel/runtime family
-> compile for gfx1100
-> reject invalid resource usage
-> correctness oracle
-> short hardware trials
-> successive halving
-> held-out validation
-> approval
-> deploy or revert
```

The agent may propose structural rewrites. The deterministic tuner evaluates parameters within each implementation family. Neither may override a failed correctness, quality, stability, privacy, or resource gate.

## Metrics

Primary submission metric:

- P95 end-to-end latency on a frozen private-agent task suite.

Supporting metrics:

- time to first token;
- inter-token latency and decode throughput;
- kernel/subgraph median and P95 latency;
- task success and tool-call validity;
- numerical maximum absolute and relative error;
- VGPR, SGPR, LDS, scratch, spills, occupancy, and peak VRAM;
- crash rate and repeated-run stability;
- external network calls.

Speed is optimized subject to correctness and quality constraints. A faster invalid candidate cannot win.

## Tinygrad's role

Tinygrad is used as:

1. the trusted reference implementation and end-to-end workload;
2. the baseline and fallback runtime;
3. a corpus of AMD kernel implementations and optimization patterns;
4. the low-level AMD execution path for selected generated candidates.

Radeon Forge is kept under `extra/radeon_forge` instead of being embedded deeply into tinygrad's compiler. This makes the oracle and tuning loop independently auditable and lets generated HIP/UOp/AMD-DSL implementations remain replaceable.

## Current implementation

Implemented:

- workload, objective, correctness, and resource contracts;
- hard feasibility gates;
- append-only JSONL experiment ledger;
- successive-halving tuner;
- AMD metadata parsing for registers, LDS, scratch, occupancy, and spills;
- target-specific HIP compilation backend;
- executable JSON benchmark protocol;
- kernel-family search-space representation;
- native gfx1100 assembly-GEMM family with valid alternate FMAC schedules and occupancy limits;
- gfx1100 hardware workload adapter with a tinygrad numerical oracle;
- fused RMSNorm/multiply/FP8 pattern family, gated as unverified on gfx1100;
- deterministic local retrieval with file-and-line citations;
- loopback-only OpenAI-compatible planner client with no remote fallback;
- deny-by-default, scoped, expiring permission grants;
- multi-turn proposal, revision, approval, authorization, completion, and failure state machine;
- unit tests for metadata, hard gates, command protocol, permissions, local endpoint restrictions, retrieval, and multi-turn approval.

Not yet claimed or implemented:

- no W7900 performance result has been recorded;
- the gfx950 Llama kernels are pattern references until individually compiled and validated on gfx1100;
- no generated candidate is approved for deployment;
- no local planner model/runtime has yet been selected and benchmarked on the W7900;
- the interactive terminal/web surface is still pending;
- the frozen end-to-end private-agent task suite and held-out evaluation are still pending.

## First gfx1100 hardware gate

Review the candidate plan without running hardware:

```bash
python3 -m extra.radeon_forge.cli --root . --family rdna3-asm-matmul --n 1024 --dry-run
```

After reviewing the printed plan, explicitly approve the local benchmark:

```bash
python3 -m extra.radeon_forge.cli \
--root . \
--family rdna3-asm-matmul \
--n 1024 \
--budgets 3,10,30 \
--approve-benchmark
```

This family validates the Forge search, permission, oracle, and evidence path. It is not the final Track 2 submission metric.

## Benchmark executable protocol

A workload harness receives:

- `RADEON_FORGE_CANDIDATE_JSON`
- `RADEON_FORGE_BUDGET`

Its final non-empty stdout line must be a JSON object such as:

```json
{
"compile_ok": true,
"stable": true,
"samples_us": [8.4, 8.2, 8.3],
"correctness": {
"passed": true,
"max_abs_error": 0.0002,
"max_rel_error": 0.0008,
"checked_values": 65536
},
"resources": {
"vgprs": 72,
"sgprs": 32,
"lds_bytes": 8192,
"scratch_bytes": 0,
"spilled_vgprs": 0,
"spilled_sgprs": 0
},
"evidence": {
"target": "gfx1100",
"reference": "tinygrad"
}
}
```

## Development validation

```bash
python3 -m unittest test.test_radeon_forge -v
python3 -m compileall -q extra/radeon_forge
```

Hardware evidence must be generated on the assigned Radeon Cloud W7900 before any speed claim is made.
7 changes: 7 additions & 0 deletions extra/radeon_forge/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
"""Radeon Forge: oracle-guided synthesis and autotuning for AMD inference workloads."""

from .contracts import Candidate, Objective, TrialResult, WorkloadContract
from .ledger import ExperimentLedger
from .tuner import successive_halving

__all__ = ["Candidate", "ExperimentLedger", "Objective", "TrialResult", "WorkloadContract", "successive_halving"]
Loading