Skip to content

docs: Copilot FlyDSL path instructions and review-pr C5 - #5730

Merged
samremes merged 4 commits into
ROCm:mainfrom
samremes:docs/flydsl-arch-helper-review-policy
Oct 12, 2026
Merged

samremes merged 4 commits into
ROCm:mainfrom
samremes:docs/flydsl-arch-helper-review-policy

Conversation

@samremes

Copy link
Copy Markdown
Contributor

Summary

  • Copilot code review does not load .claude/skills on its own. GitHub's supported hook is path-specific files under .github/instructions/*.instructions.md with applyTo globs; without excludeAgent, Copilot code review uses them (repository custom instructions, Copilot code review). Triton already uses this; FlyDSL PRs had none, so Copilot reviewed kernels with generic mixed-device advice and invented gcnArchName probes against get_gfx_runtime().
  • Add .github/instructions/aiter-ops-flydsl.instructions.md so matching FlyDSL/wrapper/test diffs get the in-repo authoring, cleanup, and aiter-op-test skills, plus the chip_info ISA-gate policy (homogeneous node; do not reimplement arch detection per kernel).
  • Add review-pr C5 (pointer only) on flydsl, flydsl-kernel, and ops-wrapper so Claude reviews do not re-raise the same false positive.

Test plan

  • Confirm Copilot on this draft (or a follow-up FlyDSL PR) no longer asks for per-kernel gcnArchName / mixed-device ISA checks when the wrapper uses get_gfx_runtime().
  • Confirm a test-only FlyDSL diff still gets aiter-op-test expectations (get_gfx() in main(), checkAllclose, one canonical suite).
  • python3 triage.py mapping matches committed MAPPING.md; C5 expands from rules.md.

Made with Cursor

Copilot code review does not load .claude/skills unless pointed there.
Match the existing Triton instructions file so FlyDSL PRs get authoring,
cleanup, and op-test rules, and stop mixed-device flags on get_gfx_runtime.

Signed-off-by: Sami Remes <[email protected]>
Co-authored-by: Cursor <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

🏷️ CI Guide

Runs automatically on every PR:

  • ✅ Pre-checks (submodule verification, code formatting)
  • ✅ Aiter op tests (gfx942 + gfx950)
  • ✅ Triton tests on MI35X (only when aiter/ops/triton/** or related paths are changed)

Extended tests (opt-in via labels):

Label Tests
ci:gfx1250-ffm-triton Run the five-shard gfx1250 FFM Triton test suite
ci:triton-300x Run an additional Triton test job on MI300X in PRs; main branch always runs both MI35X and MI300X
multigpu Aiter multi-GPU tests on the 8-GPU runner
ci:sglang SGLang integration tests: DeepSeek-R1-MXFP4 accuracy, Qwen 3.5 accuracy
ci:atom ATOM benchmark: DeepSeek-R1-0528, GPT-OSS-120B
ci:atom_full ATOM accuracy suite for PR and main models from ATOM models_accuracy.json
ci:vllm vLLM benchmark: GPT-OSS-120B, DeepSeek-R1-0528, Kimi-K2.5
ci:all All standard extended tests (excludes ci:atom_full)

Only add ci:atom_full for FlyDSL or Triton upgrades.
Add labels via the sidebar or gh pr edit 5730 --add-label <label>

PR title tags & labels:
Component tags ([Triton/Gluon], [HIP], [CK], [ASM], ...) are added to the PR title and as PR labels automatically from the changed files and re-synced on every push — change-type tags like [fix]/[Perf], op tags like [MLA], and human labels (ci:*) are left untouched. Add the no-auto-title label to opt this PR out.

@samremes
samremes requested review from zufayu and a balanced review from Copilot September 21, 2026 11:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

The path scope excludes chip_info.py, making its explicit review directive ineffective for standalone changes.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 1 Low severity

Open (1)
What changed in this PR

Adds FlyDSL-specific review guidance for Copilot and extends review-pr architecture-probe checks.

Changes:

  • Adds path-specific FlyDSL, wrapper, and test guidance.
  • Introduces the shared chip_info helper rule.
  • Regenerates the rule-family mapping.
File Description
.github/​instructions/​aiter-ops-flydsl.instructions.md Defines FlyDSL review instructions.
.claude/​skills/​review-pr/​triage.py Maps applicable families to the new rule.
.claude/​skills/​review-pr/​rules.md Documents the shared architecture-helper policy.
.claude/​skills/​review-pr/​MAPPING.md Updates the generated mapping consistently.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Added 'aiter/jit/utils/chip_info.py' to the applyTo list.

Co-authored-by: Copilot Autofix powered by AI <[email protected]>
@samremes
samremes marked this pull request as ready for review October 2, 2026 11:14
@samremes
samremes requested review from a team and a balanced review from Copilot October 2, 2026 11:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🔵 Needs a closer look

Some FlyDSL tests and Tier-2 wrappers remain uncovered, and C5 has conflicting verdict conditions.

Review effort: Balanced
Findings: None

Resolved since last review (1)
Previously missed (3)

In code that hasn't changed since last review

Medium severity Apply architecture dispatch rule to Tier-2 wrapper paths

.claude/​skills/​review-pr/​triage.py:1091

Attaching the rule only to ops-wrapper leaves Tier-2 wrappers uncovered because this branch is an elif after p in TIER. For example, changes to aiter/ops/mha.py or aiter/ops/attention.py derive tier2-dispatch, not ops-wrapper, even though the new applyTo: "aiter/ops/*.py" policy covers them and these files perform architecture dispatch. Add this rule to tier2-dispatch (or derive it independently for all matching wrapper paths) and regenerate MAPPING.md.

Low severity Resolve overlap between CLEAR and FIRE architecture detection rules

.claude/​skills/​review-pr/​rules.md:150

The CLEAR and FIRE conditions overlap: a PR can use get_gfx() in one path while adding a gcnArchName probe in another, making the rule direct the reviewer to both outcomes. Since the local probe is the violation, make CLEAR conditional on all added ISA detection using the shared helpers and let any new local probe take precedence.

Low severity Expand FlyDSL test glob to cover operation-prefixed filenames

.github/​instructions/​aiter-ops-flydsl.instructions.md:2

This glob misses existing FlyDSL test files whose operation name precedes flydsl, including op_tests/test_mha_flydsl.py, op_tests/test_mla_flydsl.py, and op_tests/test_mha_flydsl_varlen_bwd.py. Changes to those tests therefore will not receive the new test/architecture instructions, so the stated test-only coverage is incomplete. Expand the top-level test glob to match flydsl anywhere after test_.

Copilot AI balanced review requested due to automatic review settings October 2, 2026 13:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

C5 and instruction path coverage omit existing Tier-2 wrappers and FlyDSL test locations.

Review effort: Balanced
Findings: 2 Medium severity

Open (2)

Comment thread .claude/skills/review-pr/triage.py Resolved
@zufayu

zufayu commented Oct 10, 2026

Copy link
Copy Markdown
Contributor

The direction of this PR makes sense. The old rules have a real gap: C4 only checks newly hardcoded architecture strings, the existing FlyDSL rules do not define where runtime ISA information must come from, and GitHub Copilot does not load the .claude/skills guidance. This can lead to the right diagnosis but the wrong fix, such as replacing a runtime get_gfx() check with a new per-op gcnArchName/get_device_properties probe instead of using the shared helper.

Please tighten the change before merge:

  • Runtime dispatch/wrappers should use get_gfx_runtime(); tests and build-time/codegen paths should use get_gfx(). C5 currently treats either helper as CLEAR in any context, and the existing C4 example still says runtime-wrapper get_gfx() is acceptable.
  • Any newly added local ISA probe must take precedence and FIRE. CLEAR should require that all newly added architecture detection uses the appropriate shared helper, so CLEAR and FIRE cannot overlap.
  • Attach C5 to tier2-dispatch as well as the current families; otherwise standalone changes to mha.py, attention.py, quant.py, etc. skip it because of the preceding elif.
  • Broaden applyTo to cover the existing operation-prefixed and nested FlyDSL tests/benchmarks, including test_mha_flydsl.py, test_mla_flydsl.py, multigpu tests, and op_tests/op_benchmarks/flydsl/**.

Please also add focused regression cases for the runtime-vs-build helper distinction, Tier-2 wrapper derivation, local-probe precedence, and representative instruction globs.

Runtime dispatch must use get_gfx_runtime(); tests and codegen use
get_gfx(), which follows GPU_ARCHS and can name a different ISA on a
multi-target build. C5 now fires on an added local probe or an added
runtime get_gfx(), and clears only when every added check fits its
context. The C4 aiter#3870 example defers helper choice to C5.

C5 was skipped for Tier-1/Tier-2 files because ops-wrapper is the last
elif; attach it to tier1-import-chain and tier2-dispatch too.

Broaden applyTo to op-prefixed, multigpu, and benchmark FlyDSL files.

Co-authored-by: Cursor <[email protected]>
Signed-off-by: Sami Remes <[email protected]>
Copilot AI balanced review requested due to automatic review settings October 12, 2026 11:28
@samremes

samremes commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor Author

Thanks @zufayu, all four policy points were real gaps. Pushed 6aa1dd47bc:

  • Helper choice depends on context. C5 and the Copilot instructions now say runtime dispatch uses get_gfx_runtime(), and tests and codegen use get_gfx(), because get_gfx() follows GPU_ARCHS and returns the last entry on a multi-target build. An added get_gfx() in a runtime path fires C5. The C4 aiter#3870 example now points the helper question to C5.
  • Clear and fire no longer overlap. Any added local probe fires. Clearing requires every added architecture check to use the helper that fits its context. Only + lines count, so the ~38 wrappers that already call get_gfx() aren't flagged retroactively.
  • Tier-2 (and Tier-1) routing. C5 is now attached to tier2-dispatch and tier1-import-chain, so mha.py, attention.py, quant.py, jit/core.py and the rest no longer skip it because of the elif. MAPPING.md regenerated.
  • applyTo. op_tests/**/*flydsl*.py and op_tests/op_benchmarks/flydsl/** now cover test_mha_flydsl.py, test_mla_flydsl.py, test_mha_flydsl_varlen_bwd.py, the multigpu QuickReduce test and the bwd benchmark.

On regression cases: the skill has no test harness, and adding one for prose rules felt out of scope, so I checked it with made-up diffs instead:

case before after
aiter/ops/mha.py adds gcnArchName - C5
aiter/ops/attention.py adds runtime get_gfx() - C5
aiter/ops/quant.py + aiter/ops/gemm_op_a4w4.py - C5
aiter/jit/core.py adds gcnArchName - C5
aiter/ops/gemm_op_a4w4.py (control) C5 C5
aiter/ops/flydsl/pa_decode.py (control) C5 C5
op_tests/test_mha_flydsl.py (control) C5 C5
op_tests/test_gemm_a8w8.py (negative control) - -

triage.py expand on the first case emits the new C5 text, including its synthetic fire/clear examples (runtime-vs-build split and local-probe precedence). Against main, the new globs cover 34/34 FlyDSL files under op_tests/ (29 before) and match no non-FlyDSL controls. That glob check uses Python's PurePath.full_match, which only approximates GitHub's matcher. triage.py mapping matches MAPPING.md, and check_prompts.py reports no drift.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The instruction globs omit several wrapper, JIT, and canonical FlyDSL test paths that C5 is intended to cover.

1 open finding
2 resolved since last review

🧠 Review effort: Balanced

@zufayu

zufayu commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

LGTM

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.

3 participants