Skip to content

[JIT] fix(jit): keep detached-head advice local to third-party clone - #5938

Merged
amd-ruitang3 merged 3 commits into
ROCm:mainfrom
adenzhou1350:codex/jit-clone-command-local-config
Nov 3, 2026
Merged

amd-ruitang3 merged 3 commits into
ROCm:mainfrom
adenzhou1350:codex/jit-clone-command-local-config

Conversation

@adenzhou1350

@adenzhou1350 adenzhou1350 commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Keep advice.detachedHead=false local to the third-party clone command instead of temporarily changing the user's global Git configuration. Preserve the existing Git < 2.49 fallback.

Motivation

The previous global write could restore an effective repository/system value into the wrong configuration scope, and an interrupted clone could leave the user's configuration changed.

Changes

  • Use git -c advice.detachedHead=false clone ... in the modern-Git path.
  • Add CPU tests for modern/legacy commands and a real clone with an isolated global configuration.
  • Merge main 89e00fdfe61e442a559132a3b78811bf2528b19a to restore its existing tests/ sources for the current CI workflow. The previous MI35X shard failed before test collection because the old PR tree lacked that directory.

Testing

  • Unit tests added or updated
  • Performance benchmarks run — not applicable to this host-side configuration-scope fix.
  • Tested on MI250X
  • Tested on MI300X

No documentation/API or new dependency change is needed. No breaking changes or performance claim.

PR Self-Review

Reviewed revision

54d1687

Behavior and intent

Only the modern-Git clone changes: its detached-HEAD advice is now command-local. It no longer reads, writes or restores global configuration. The repository URL, pinned revision, destination and clone flags stay the same; the older-Git clone/reset/submodule path remains unchanged.

Validation and unverified scope

On native Windows, Python 3.14.3 and Git 2.53.0.windows.2:

  • python -m pytest -q op_tests/test_jit_clone_config.py: 3 passed after the main merge.
  • Ruff 0.16.0 check aiter/jit/core.py op_tests/test_jit_clone_config.py: passed.
  • Black 26.3.0 --check on both files: passed.
  • PR-scoped git diff --check against main: passed. The clone function's AST and regression test contents are unchanged from c58aafc496.

Full aiter.jit.core import, ROCm execution and hosted CI on this revision remain unverified. These CPU tests load the checked-in function through its AST; they do not import ROCm extensions. Earlier c58aafc496 lint checks passed, but its Aiter Test Gate failed after python3 -m pytest -q tests reported a missing directory; the new merge supplies those existing upstream files, and a fresh hosted run is still needed.

PR-specific question

No tensor workload keys or tuning configurations consume this Git advice setting. The affected caller is clone_3rdparty("HipKittens") when its directory is missing and Git supports clone --revision (>= 2.49). The diff changes only the configuration scope of that command; it changes no operator dispatch, shape table, cache key or pinned third-party revision. The legacy-path regression checks its original three commands. This is static/CPU evidence, not validation of every kernel shape.

Changed op tests

op_tests/test_jit_clone_config.py is necessary because existing operator numerical tests do not check user Git configuration. Its modern-path test asserts the single command-local clone, its legacy test preserves clone/reset/submodule behavior, and its real-Git test checks the cloned revision and byte-for-byte preservation of an isolated global configuration. These cover different boundaries; the real-Git test requires Git >= 2.49 and otherwise skips. The explained exec suppression is limited to loading this checked-in function for CPU-only coverage.

Implementation, tests and this maintenance self-review were AI-assisted.

@adenzhou1350
adenzhou1350 requested a review from a team September 29, 2026 11:35
@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 5938 --add-label <label>

One backend per PR:
A PR changes one kernel backend: [Triton/Gluon] (Triton and Gluon count as one), [HIP], [ASM], [CK], [OPUS] or [FlyDSL]. If the title ends up with two backend tags, split the PR -- as stacked pull requests when one part cannot merge without the other.

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 stop the title rewrites; labels stay in sync either way.

@github-actions github-actions Bot changed the title fix(jit): keep detached-head advice local to third-party clone [JIT] fix(jit): keep detached-head advice local to third-party clone Sep 29, 2026
@github-actions github-actions Bot added the JIT label Sep 29, 2026
@zufayu
zufayu requested a review from valarLip September 30, 2026 00:33
@zufayu
zufayu requested review from amd-ruitang3 and removed request for valarLip October 10, 2026 03:02
@zufayu zufayu assigned amd-ruitang3 and unassigned valarLip Oct 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor

No activity for 15 days, so this is now labelled stale. A push or a comment clears it; keep-open exempts it. Nothing is closed automatically.

@github-actions github-actions Bot added the stale The PR hasn't been updated in 2 weeks label Oct 26, 2026
@amd-ruitang3

Copy link
Copy Markdown
Contributor

@aiter-bot review

@amd-ruitang3

Copy link
Copy Markdown
Contributor

@adenzhou1350 pls update code format.

@aiter-bot

Copy link
Copy Markdown

ROCm/aiter PR #5938 — [JIT] fix(jit): keep detached-head advice local to third-party clone

Replaces the temporary global git config advice.detachedHead write/restore around the JIT third-party clone in aiter/jit/core.py with a one-shot git -c advice.detachedHead=false on the clone command, and adds CPU-only tests for both git-version paths.

Review (advisory): ⚠️ NEEDS WORK
Validation (deterministic): NOT RUN — REVIEW_AUTO_VALIDATE=0 (auto-validation disabled; the single test target op_tests/test_jit_clone_config.py was not run by the validator — a hand-run of it passed 2/3, with the real-git test skipped on this box's git 2.39.5 < 2.49)
Perf (advisory): NOT RUN — target exposes no benchmark entry point; the changed path is a one-time host-side git clone, not a per-iteration kernel path

⚠️ [verified] op_tests/test_jit_clone_config.py:34 uses exec to load clone_3rdparty, and the repo's pinned ruff 0.16.0 CI job fails on it (S102 "Use of exec detected" — reproduced locally with ruff==0.16.0; the "Check Code Style with Ruff" check is red on the PR), contradicting the description's "Ruff check on changed code passed"; the Standard Tests jobs that would collect this file were also skipped (the check-signal flake cascaded into the Aiter Test Gate), so the new tests have never run in CI. Author must add a justified # noqa: S102 (or restructure to avoid exec) and re-run CI so the standard tests actually execute the new file.
⚠️ [verified] aiter/jit/core.py is a Tier-1 JIT-engine contract and this PR changes its clone-path behavior, but the PR has zero recorded reviews — the de-facto owner by commit count (amd-ruitang3, 35 commits on aiter/jit/core.py) requested this review but has not approved. Reviewer should ask amd-ruitang3 to record explicit sign-off before merge.
📝 [verified] op_tests/test_jit_clone_config.py:20-35 execs the extracted clone_3rdparty body against a fabricated namespace (mock HIP_KITTENS_DIR/mp_lock/bd_dir), so the test pins the git argv but never imports aiter.jit.core — if a module-level global the function closes over is later removed, this test stays green while the real clone path raises NameError at runtime. Reviewer should ask whether the CPU-only trade-off is acceptable as-is or warrants a cheap import smoke alongside it.

@adenzhou1350

Copy link
Copy Markdown
Contributor Author

Fixed the reported format/lint blocker in c58aafc496. The exec now has a narrowly scoped # noqa: S102 with its rationale: it loads only the checked-in function for CPU-only coverage without importing ROCm extensions. Production code is unchanged.

Reproduced S102 before the fix; Ruff 0.16.0 and Black 26.3.0 now pass on both changed files. All 3 CPU tests pass on native Windows/Git 2.53, including the real clone/global-config check; git diff --check passes. I also corrected the PR description to name the pinned tools and the test boundary: this is not a full module-import or ROCm runtime test.

The previous Standard Tests were skipped after check-signal failed, so those are still pending hosted validation. The new push requests fresh workflows; any fork-workflow approval still needs an upstream maintainer. Thanks for the review.

@github-actions github-actions Bot removed the stale The PR hasn't been updated in 2 weeks label Oct 29, 2026
@aiter-bot

aiter-bot commented Oct 29, 2026 •

Copy link
Copy Markdown

READY FOR HUMAN REVIEW

PR Self-Review

Revision 54d168765efb · mode shadow

Author self-review accepted. Readiness report:

Author answers

  • PASS — current-SHA answers are present and structurally specific
Show the author's self-review answers

Behavior and intent

Only the modern-Git clone changes: its detached-HEAD advice is now command-local. It no longer reads, writes or restores global configuration. The repository URL, pinned revision, destination and clone flags stay the same; the older-Git clone/reset/submodule path remains unchanged.

Validation and unverified scope

On native Windows, Python 3.14.3 and Git 2.53.0.windows.2:

- `python -m pytest -q op_tests/test_jit_clone_config.py`: 3 passed after the main merge.
- Ruff 0.16.0 `check aiter/jit/core.py op_tests/test_jit_clone_config.py`: passed.
- Black 26.3.0 `--check` on both files: passed.
- PR-scoped `git diff --check` against main: passed. The clone function's AST and regression test contents are unchanged from `c58aafc496`.

Full `aiter.jit.core` import, ROCm execution and hosted CI on this revision remain unverified. These CPU tests load the checked-in function through its AST; they do not import ROCm extensions. Earlier `c58aafc496` lint checks passed, but its Aiter Test Gate failed after `python3 -m pytest -q tests` reported a missing directory; the new merge supplies those existing upstream files, and a fresh hosted run is still needed.

PR-specific question

No tensor workload keys or tuning configurations consume this Git advice setting. The affected caller is `clone_3rdparty("HipKittens")` when its directory is missing and Git supports `clone --revision` (>= 2.49). The diff changes only the configuration scope of that command; it changes no operator dispatch, shape table, cache key or pinned third-party revision. The legacy-path regression checks its original three commands. This is static/CPU evidence, not validation of every kernel shape.

Changed op tests

`op_tests/test_jit_clone_config.py` is necessary because existing operator numerical tests do not check user Git configuration. Its modern-path test asserts the single command-local clone, its legacy test preserves clone/reset/submodule behavior, and its real-Git test checks the cloned revision and byte-for-byte preservation of an isolated global configuration. These cover different boundaries; the real-Git test requires Git >= 2.49 and otherwise skips. The explained `exec` suppression is limited to loading this checked-in function for CPU-only coverage.

Implementation, tests and this maintenance self-review were AI-assisted.

PR state

  • PASS — pull request is marked ready for review

Copilot findings

  • PASS — no active Copilot finding lacks a substantive author reply
  • ADVISORY — Copilot did not review the current head SHA

Code and op-test hygiene

  • PASS — no committed artifact or conflict marker detected

Required CI

  • PASS — Black: passed
  • PASS — Ruff: passed
  • PASS — Repository dependency: passed
  • PASS — Aiter Test Gate: passed

Shadow mode reports what would block but keeps the status successful. Set AITER_PR_SELF_REVIEW_MODE=enforce only after reviewing real false positives.

@adenzhou1350
adenzhou1350 force-pushed the codex/jit-clone-command-local-config branch from f6bed99 to 54d1687 Compare October 29, 2026 11:34
@adenzhou1350

Copy link
Copy Markdown
Contributor Author

Merged current main in 54d1687 so the focused CI step has the upstream tests/ directory; the previous failure was collection (file or directory not found: tests). The three clone regressions and pinned Ruff/Black checks pass locally. I also completed the self-review for this head. Full module-import and ROCm coverage still need hosted CI.

@amd-ruitang3
amd-ruitang3 requested a review from ruanjm November 3, 2026 04:05

@ruanjm ruanjm 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.

The change in core.py LGTM.

@amd-ruitang3
amd-ruitang3 merged commit e1f4ef2 into ROCm:main Nov 3, 2026
4 checks passed
shantipriya-amd pushed a commit to shantipriya-amd/aiter that referenced this pull request Nov 18, 2026
…OCm#5938)

* fix(jit): keep detached-head advice local to third-party clone

Signed-off-by: Xucheng Zhou <[email protected]>

* test(jit): document trusted function execution for CPU coverage

Signed-off-by: Xucheng Zhou <[email protected]>

---------

Signed-off-by: Xucheng Zhou <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants