Use this when running the generate of the Tune stage and generating lowering-plan (`target_lowering_plan`) override candidates while keeping the `spec.ir.yaml` finalized in the core workflow and the target profile invariant. As an optional flow, it applies to the work of expanding trial candidates from the performance-exploration `tuning.spec`.
Install
npx skillscat add seiya/atmofab/workflow-tune-generate Install via the SkillsCat registry.
SKILL.md
Workflow Tune Generate
Purpose
Fix the candidate-generation responsibility of the Tune stage, and create performance-exploration candidates under fixed physics conditions. This flow is an optional flow separated from the core workflow, and treats spec.ir.yaml and the target profile (spec/targets/<target_id>.yaml) as invariant premises.
Scope
- the work of generating override variants of the CodegenBundle's
target_lowering_planfromtuning.spec - the work of generating exploration-space expansion candidates with
LLMassistance
Requirements
- Fix the
case/algorithm/io_contract/dependencysections ofspec.ir.yaml, and do not change the physics algorithm. - Generate candidates by changing only the lowering plan (
target_lowering_plan:parallelization/data_layout/fusion/decomposition/communication/accelerator_mapping). Changingspec.ir.yamlor the target profile (hardware.*/toolchain.*/parallel.backend/execution.*/harness) is forbidden (canonical boundary: "The override-allowed boundary" section ofdocs/TUNING_WORKFLOW.md). - When
tuning.specincludes an entry that overrides the IR or the target profile, do not launch Tune and stop withfail_closed. - Prioritize safe knobs such as
tile,fuse,vectorize, andlayout. - Keep
target_lowering_plan.parallelizationan object whosemodelmember names the parallel model ("none"when nothing is parallelized). TheGenerate.gateparallel-directive floor reads the model from that member (and themethod/scheme/kindspellings;docs/workflow/CODEGEN_BUNDLE_CONTRACT.md§Target lowering plan), and only a model namingnoneor another model exempts the variant from it — a model named under any other key declines nothing, so the target's OpenMP floor applies. A brand-new member inside an optional plan section is fine. - When proposing a new implementation pattern, record the basis for adding it to the
search_spaceoftuning.spec. - When using the
LLM, apply theLLMconventions ofSPEC.mdand output<stage>_meta.json.
Operations Rules
- Issue an
impl_hashper candidate, and do not re-run a duplicate candidate.impl_hashis computed from the target profile and the final value of the candidate'starget_lowering_plan(after the override;docs/PERFORMANCE_DIAGNOSTICS.md§3). - After candidate generation, save the variant lowering plan to a separate path, and run the same
Generate/Build/Validateas the core workflow with the samecaseand the same target profile. - Make
debug_mode=falsethe standard, and do not save failed-attempt artifacts. - On a candidate-generation failure, update
last_fail_reasonand hand it to verify.
Decision Criteria
- All candidates satisfy the
case/algorithm/io_contract/dependencyfixed conditions ofspec.ir.yaml. - The candidate diff is limited to the lowering plan (
target_lowering_plan). - The metadata holds the information needed for re-execution.