Skip to content

[WIP] support forge agent#52

Closed
jiaqiang-dot-liu wants to merge 20 commits into
AMD-AGI:mainfrom
jiaqiang-dot-liu:feat/add-forge-agent
Closed

[WIP] support forge agent#52
jiaqiang-dot-liu wants to merge 20 commits into
AMD-AGI:mainfrom
jiaqiang-dot-liu:feat/add-forge-agent

Conversation

@jiaqiang-dot-liu

Copy link
Copy Markdown
Collaborator

No description provided.

jiaqiang-dot-liu and others added 5 commits July 3, 2026 05:05
…rnel resolution

- New `image_kernel` task type: optimize a kernel that already ships inside the
  container image. setup_workspace seeds a per-run working copy from
  `image_repo_path` (reflink CoW, `.git` excluded) instead of git-cloning an
  upstream repo, so in-image submodules / prebuilt build cache / CK headers are
  reused directly (no clone, no submodule fetch, no network).
- prompt_builder: wire image_kernel into the task-type chain, the
  repository_language knowledge selection, and the workspace-info section.
- forge (agents/forge/launch_agent.py): resolve the kernel file robustly
  (workspace-relative -> repo subdir -> unique suffix match) so repository /
  image_kernel tasks whose sources live under a repo subdir work; fully
  backward compatible with legacy workspace-root snippets.
- cheatsheet: map MI325X / MI325 -> gfx942 (reuse MI300X architecture doc).
- tests: pure-python repro + regression tests (no GPU/network) for all of the above.

Co-authored-by: Cursor <cursoragent@cursor.com>
…not capped at 8h

bootstrap patches the run's timeout_seconds (KA_TIMEOUT_SECONDS) onto the forge
agent_config but leaves max_hours at its static default (8), so the forge-loop's
own time budget stopped a 32h run after ~8h (~25-110 iters) regardless of the
configured max_iters/timeout. Derive --max-hours from timeout_seconds (with a
15-min margin under the hard process-wait kill) so the loop budget tracks the
run's timeout. Default timeout (29700s) still yields ~8h (backward compatible).

Adds a unit test for the derivation.

Co-authored-by: Cursor <cursoragent@cursor.com>
jiaqiang-dot-liu and others added 12 commits July 6, 2026 11:40
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…rrectness

Co-authored-by: Cursor <cursoragent@cursor.com>
- add triton2flydsl softmax/rmsnorm/layernorm tasks (torch2hip-style
  4-file layout) with a self-contained BYOD measurement driver that is
  the correctness oracle + performance baseline and defines the op I/O
- route *2flydsl to KernelForge forge-rewrite (is_flydsl_rewrite): port
  the source to FlyDSL, then forge-loop optimizes it; shapes from the
  driver, candidate from target_file_path
- score the FINAL kernel via the task driver like torch2hip
  (write_rewrite_task_result), not an agent result JSON
- harden the forge subprocess: own process group + timeout group-kill +
  workspace orphan reap (shared _run_streamed) to avoid GPU leaks

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants