tenstorrent/tt-emule

parallel-mock-implementation

Pattern for parallelizing emule mock authorship via the Workflow tool.

소스 보기

사용 방법

  1. 설치 명령을 복사하고 자신의 에이전트 환경에 설치하기 전에 소스 패키지를 확인하세요.
  2. 필요한 도구, 인증 정보, 지원 환경은 원본 문서에서 확인하세요.
  3. 입력과 원하는 산출물을 설명하고 출처와 결과를 대조하세요.
npx skills add https://github.com/tenstorrent/tt-emule --skill parallel-mock-implementation

시작 전 확인

  • 설치에는 모델 구독, API 한도, 파일 접근 권한이 포함되지 않습니다.
  • 별점 수와 설치 수는 활동 지표이며 독립적인 품질·보안 검증이 아닙니다.
원본 Skill 문서

원본 저장소의 제목, 예시, 코드, 표, 링크, 이미지를 유지해 표시합니다.

Parallel mock implementation

This is a building block, not a standalone bring-up workflow. Invoke it as part of /implement-mock or /compute-llk-bringup when the work-list is large enough to amortize the dispatch overhead.

When to use

  • ≥4 similar files to author (e.g. a batch of SFPU shims, a sweep of

missing NOC overloads, a fanout of fabric primitives).

  • Each output is independent — one file per worker, no shared

edits, no read dependencies between workers.

Don't use it for:

  • Single-file work — call the worker prompt directly inline.
  • Cross-cutting wiring that touches a shared file (e.g. one

sfpu_split_includes.h, one .claude/references/structure.yaml). The orchestrator handles those centrally after workers return.

Worker prompt skeleton

Each worker writes exactly one file. Customize the constraints for your scope; the structure below stays the same.

You are implementing an emule mock for tt-emule. Write exactly ONE file.

TARGET FILE: <relative path under include/jit_hw/ or src/>
UPSTREAM REFERENCE (read-only): <path to the silicon API definition>
ADDITIONAL REFERENCE (read-only, optional): <e.g. LLK impl, RTL spec>
REFERENCE EMULE FILES (read for boilerplate):
  <path to an existing similar mock — keep this list short>

REQUIRED SIGNATURES (mirror upstream — if upstream differs, follow upstream):
<list>

SEMANTICS:
<formula / contract>

HARD CONSTRAINTS:
- Do NOT modify any file other than the TARGET FILE.
- Do NOT touch shared wiring files (the orchestrator handles those).
- Do NOT run pytest, build, or commit.
- Read at most 3 files: upstream, optional second reference, one
  existing mock as boilerplate.
- (Add scope-specific exclusions — e.g. for compute shims:
  "Do NOT read tt_metal/llrt/, tt_metal/impl/dispatch/,
  tt_metal/soc_descriptors/".)

OUTPUT: write the file, return status=DONE with file=<relative path>
and lines=<count>.
If signature is ambiguous or upstream missing, return status=STUCK with
a one-sentence reason.
Do NOT invent signatures.

Result schema

js
const RESULT_SCHEMA = {
  type: 'object',
  properties: {
    status: { type: 'string', enum: ['DONE', 'STUCK'] },
    file:   { type: 'string' },
    lines:  { type: 'integer' },
    reason: { type: 'string' },
  },
  required: ['status', 'file'],
  additionalProperties: false,
}

Orchestration

js
phase('Write mocks')
const results = await parallel(ITEMS.map(it => () =>
  agent(makePrompt(it), {
    label: `mock:${it.name}`,
    phase: 'Write mocks',
    schema: RESULT_SCHEMA,
  }).then(r => ({ item: it.name, ...(r || {status: 'NULL'}) }))
))
const done  = results.filter(r => r.status === 'DONE')
const stuck = results.filter(r => r.status !== 'DONE')
log(`${done.length}/${ITEMS.length} DONE; ${stuck.length} STUCK`)
return { done, stuck }

Orchestrator finalization

After the workers return, the orchestrator (you) handles centrally:

  1. Visual diff each new file.
  2. Wire any shared aggregator/registration file (e.g. for compute LLK

shims: SFPU_OP_*_INCLUDE branches in sfpu_split_includes.h).

  1. Update .claude/references/structure.yaml with one line per new file (per CLAUDE.md

project rule).

  1. Build.
  2. Run targeted tests for each new mock — this loop can itself

parallelize via one pytest call per item.

  1. Promote 100%-pass entries into the regression script (e.g.

scripts/run_ttnn_pytests.sh for compute LLK shims).

  1. For partial passes, decide per-item: pytest -k filter, or defer

with a written note.

Anti-patterns

  1. Don't have parallel workers touch shared files. Each worker

owns a unique target path; the orchestrator centralizes wiring after the batch returns. Without this, you get racing writes that silently lose changes.

  1. Don't skip the `STUCK` branch. When a worker hits ambiguity it

must report STUCK with a reason; the orchestrator decides how to resolve (e.g. surface to the user, drop the item, hand-write it). Workers that "guess" produce subtle bugs that surface much later.

  1. Don't bypass the schema. Free-text worker output is unparseable

at scale. Even a STUCK item needs structured {status: STUCK, file: <intended path>, reason: <one sentence>}.

  1. Concurrency cap is automatic. The Workflow runtime limits

concurrent agent() calls (typically ≤16); excess queue up. Don't manually batch in chunks unless you have a reason — parallel() over the full work-list is fine.

관련 작업

같은 저장소의 Skills

더 많은 Skills

모든 Skills
tenstorrent
커뮤니티

index-based-ops

Bring up or debug index-based compute ops (TopK, Sort, Argmax) in tt-emule — ops that return values + indices, where ties make the index choice non-unique. Use when implementing one of these ops or triaging its value/index test failures.

설치 수
1
GitHub Stars
5
업데이트
10월 16일
tenstorrent
커뮤니티

memory-debug

Diagnose data-corruption failures in tt-emule operations (wrong values, partial zeros, off-by-N row/col writes). Use when a regression test reports ATOL 1e-3 on otherwise-functional kernel paths.

설치 수
1
GitHub Stars
5
업데이트
10월 16일
tenstorrent
커뮤니티

verify-mock

Verification checklist to walk before declaring a tt-emule mock complete. Use after implementing a stub (typically at the end of /implement-mock or /compute-llk-bringup) to catch the recurring failure modes — signature drift, no-op math, missing format dispatch, JIT-cache staleness, regression baseline drift.

설치 수
1
GitHub Stars
5
업데이트
10월 16일
tenstorrent
커뮤니티

workarounds

Registry of deliberate, non-ideal workarounds currently live in tt-emule (hacks we accepted to make something pass, NOT normal development practice). Read this before adding any new workaround, and when touching code that carries one — each entry records what the hack is, why it is not the right fix, the real root cause, and the path to removing it.

설치 수
1
GitHub Stars
5
업데이트
10월 16일