Skip to content

Add: AICore fault triage to the device error code guide - #1501

Merged
ChaoWao merged 1 commit into
hw-native-sys:mainfrom
ChaoWao:docs-aicore-fault-triage
Jul 27, 2026
Merged

Add: AICore fault triage to the device error code guide#1501
ChaoWao merged 1 commit into
hw-native-sys:mainfrom
ChaoWao:docs-aicore-fault-triage

Conversation

@ChaoWao

@ChaoWao ChaoWao commented Jul 26, 2026

Copy link
Copy Markdown
Collaborator

Why

docs/troubleshooting/device-error-codes.md covers capacity codes (§2) and stalls (§3), but an AICore addressing fault is the third way a run reaches the same generic 507018 — and it had no section. #1489 re-derived the procedure from scratch over a full investigation and still could not close, so this records what that investigation established.

What

A new §4 with three steps, ordered so the cheap disqualifications come first:

F1 — is it the kernel's addressing, or did the core jump elsewhere? These look identical from the host and have nothing in common as bugs. If GetBinAndKernelNameExceptionArgs: binSize matches the runtime's own aicore_kernel.o rather than your kernel, the report is naming the polling-dispatch executor and the fault is a dispatch-payload / function_bin_addr problem — no amount of reading kernel arithmetic will find it. #1036 is the worked example.

F2 — rule the kernel in or out statically, before instrumenting. A kernel whose TASSIGN bases are compile-time constants and whose extents come from a template cannot compute an out-of-range UB address; runtime values that only shrink a tile move nothing. Summing the highest byte reached against the UB size settles it on paper. This is what cleared all five allreduce modes in #1489 (constant bases, nranks only divides the chunk count, ≤132 KiB of 192 KiB at every rank count).

F3 — real fault vs post-mortem register dump. A core reaped mid-spin can produce a fault-looking line describing the state it died in. If the deadlock and SPIN detectors are both zero and only HandleTaskTimeout fired, nothing on the device proved a fault — the wait that never completed is the investigation, not the addressing line.

The part that matters most

The section states plainly that the harness will not isolate your device log: outputs/<case>_<ts>/ is created only when a DFX flag is on, so a plain onboard run leaves its log in the shared ~/ascend/log/debug/ among every other user's on the box.

That is not hypothetical — it is why #1489 is still open. Its one real occurrence produced exactly the artifact that would have decided F1, and it was unattributable by the time anyone looked.

.claude/rules/running-onboard.md already says to export ASCEND_PROCESS_LOG_PATH; what was missing is what to read once you have the log, which is the substance here.

Notes for review

  • Renumbers the trailing "Codes with no end-to-end test" §4 → §5 and fixes the in-page link that pointed at the old number (markdownlint MD051 caught it).
  • The doc is now 339 lines / 7 H2 sections, past the 300-line, 5-H2 soft target in doc-consistency.md §6 — it was already over before this change. The natural split is a landing page plus device-error-codes/{capacity,stall,aicore-fault,untested}.md. I did not bundle that restructure into a content-only change; flagging it instead, per that rule's "flag it to the user" clause.

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Jul 26, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: dfae4ca6-397c-400e-91cf-533eb65062a8

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Changes

Device error documentation

Layer / File(s) Summary
AICore fault troubleshooting guidance
docs/troubleshooting/device-error-codes.md
Adds log redirection steps and F1–F3 guidance for diagnosing AICore faults, renumbers the following section to 5, and corrects its internal link target.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Poem

A rabbit hops through logs at night,
F1, F2, F3 make faults bright.
The numbers line up, links point true,
AICore clues now guide you through.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: adding AICore fault triage guidance to the device error code guide.
Description check ✅ Passed The description directly matches the doc update and explains the new AICore fault triage section, log guidance, and renumbering.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ChaoWao

ChaoWao commented Jul 26, 2026

Copy link
Copy Markdown
Collaborator Author

The two red ut jobs here are not caused by this PR — it changes one markdown file and nothing else. Earning that rather than asserting it, per .claude/rules/discipline.md §5:

The failing step is "Run Python unit tests", and the failure is:

tests/ut/py/test_worker/test_orphan_child_reaping.py::test_children_exit_when_parent_is_killed FAILED
AssertionError: expected exactly 3 forked sub-worker pids, parent reported [6778, 6779, 6780, 3]

That is my test from #1495, already on main, scraping pids out of the parent subprocess's combined stdout+stderr and picking up a bare number from a log line. main is red for it independently of this PR.

Fixed in #1504 (dedicated pid file instead of parsing a log stream). This PR will go green on a rebase once that lands; nothing to change here.

@ChaoWao
ChaoWao force-pushed the docs-aicore-fault-triage branch from e619503 to 439325c Compare July 27, 2026 00:46

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/troubleshooting/device-error-codes.md`:
- Around line 275-281: Revise the guidance in the out-of-range UB address
section so compile-time TASSIGN offsets and template-derived extents are ruled
out only after calculating their maximum reachable byte bound and confirming it
fits within the AIV UB size for every admitted input. Remove the unconditional
“cannot” assertion, and direct readers to F1’s second case only when that bounds
comparison succeeds.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 3d11567c-7ecf-4ec0-9f10-0339a784955d

📥 Commits

Reviewing files that changed from the base of the PR and between 22f2d53 and 439325c.

📒 Files selected for processing (1)
  • docs/troubleshooting/device-error-codes.md

Comment thread docs/troubleshooting/device-error-codes.md Outdated
@ChaoWao
ChaoWao force-pushed the docs-aicore-fault-triage branch from 439325c to 53e09bf Compare July 27, 2026 01:44
@ChaoWao

ChaoWao commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator Author

Updated now that #1489 is closed. Still worth merging — the content was never specific to that issue.

The gap this fills is structural: the guide had "chasing down a capacity code" and "chasing down a stall", but nothing for an AICore addressing fault, which is the third distinct way a run reaches the same generic 507018. That gap exists whatever happened to #1489.

The worked example got stronger, not weaker. #1489 closed as very likely fixed by #1477 — a CoreTracker whose uint64_t state overran past 21 clusters while those cases ran at the device's full 24. So F2's verdict there was correct: the kernels never were at fault, and the answer sat in F1's second case (corrupted dispatch state) the whole time. What went wrong in that investigation was not F2; it was stopping after F2 instead of following it into F1.

The section now says that outcome explicitly. A worked example that names where it ended up is worth more than one that trails off at "and then we could not reproduce it".

Everything else stands unchanged, in particular the note that the harness will not isolate your device log — that is why #1489's one real occurrence lost the artifact that would have decided F1 on the spot, and it is still true for the next one.

@ChaoWao
ChaoWao force-pushed the docs-aicore-fault-triage branch from 53e09bf to 3e38c65 Compare July 27, 2026 01:47
The guide covered capacity codes and stalls but had nothing for an AICore
addressing fault, which is the third way a run reaches the same generic
507018. hw-native-sys#1489 spent an investigation re-deriving the procedure from
scratch and still could not close, so record it.

Three steps, ordered so the cheap disqualifications come first:

- F1 separates "the kernel computed a bad address" from "the core was
  made to execute something that is not the kernel". `binSize` in
  GetBinAndKernelNameExceptionArgs matching the runtime's own
  aicore_kernel.o means the report is naming the polling-dispatch
  executor, so the fault is a dispatch-payload problem and no amount of
  reading the kernel's arithmetic will find it. hw-native-sys#1036 is the worked
  example.
- F2 rules the kernel in or out statically. Constant TASSIGN bases plus
  template tile extents do not make an out-of-range address impossible —
  the constants can overrun on their own — but they make it decidable on
  paper, because runtime values that only shrink a tile move no base and
  grow no extent. Summing the highest byte reached and comparing against
  the UB size settles it either way without touching the device. This is
  what cleared the allreduce collectives in hw-native-sys#1489.
- F3 separates a real fault from a post-mortem register dump of a core
  reaped mid-spin, by counting which detector actually fired.

hw-native-sys#1489 has since been closed as very likely fixed by hw-native-sys#1477 — a CoreTracker
whose uint64_t state overran past 21 clusters while those cases ran at the
device's full 24. F2's verdict held: the kernels were never at fault, and
the answer was in F1's second case all along. The section says so, because
a worked example that names its own outcome is worth more than one that
trails off.

Also state where the device log has to be redirected and why the harness
will not do it: outputs/<case>_<ts>/ exists only when a DFX flag is on, so
a plain onboard run leaves its log in the shared ~/ascend/log/debug/ with
every other user's, and the evidence is unattributable once the run ends.
That is how hw-native-sys#1489's only real occurrence lost the one artifact that would
have decided F1.

Renumber the trailing section and fix the in-page link that pointed at
its old number.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@ChaoWao
ChaoWao merged commit 4d3b6da into hw-native-sys:main Jul 27, 2026
14 checks passed
@ChaoWao
ChaoWao deleted the docs-aicore-fault-triage branch July 27, 2026 02:34
ChaoWao added a commit to ChaoWao/simpler-fork that referenced this pull request Jul 27, 2026
… dots

`fix-pr` Step 6 told you to squash first and rebase after: the `> 1` row
soft-resets to `$BASE_REF`, and only the following list says "rebase onto
`$BASE_REF`". `commit-and-push` has the opposite (correct) order, so the two
documents disagreed and the skill's order is the one that corrupts the commit.

`git reset --soft "$BASE_REF"` moves HEAD to the base but keeps the branch's
index. If the branch still sits on an older base — which it does whenever
anything merged while the PR was open — every file the base gained meanwhile is
recorded as a deletion by the PR. Rebasing afterwards does not repair it: the
revert is by then part of the PR's own diff and replays cleanly onto the new
base. It surfaces as unrelated files being reverted, easy to miss in a large
diff and easy to merge.

Hit while squashing hw-native-sys#1506: `docs/troubleshooting/device-error-codes.md` came
back as -86 lines because hw-native-sys#1501 had merged since the branch point.

Step 6 now fetches and rebases at the top, *before* the edit step rather than
after it: git refuses to rebase a dirty worktree, so a rebase placed after the
fix cannot run at all. Verification gains a three-dot diff of the file list, and
it lives with the single-commit check after the commit exists — at the
soft-reset itself `HEAD` is `$BASE_REF`, so that diff is empty by construction
and would have verified nothing. Two dots would also list files the base has and
the branch does not, rendering them as the branch's deletions: it both hides a
real revert in the noise and invents fake ones.

The single-commit check now separates its outcomes, since the surrounding table
already treats them differently: `> 1` squashes again, `0` stops.

`commit-and-push` §1 gains the fetch, and its soft-reset step states the
precondition it silently relied on.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
ChaoWao added a commit that referenced this pull request Jul 27, 2026
… dots (#1516)

`fix-pr` Step 6 told you to squash first and rebase after: the `> 1` row
soft-resets to `$BASE_REF`, and only the following list says "rebase onto
`$BASE_REF`". `commit-and-push` has the opposite (correct) order, so the two
documents disagreed and the skill's order is the one that corrupts the commit.

`git reset --soft "$BASE_REF"` moves HEAD to the base but keeps the branch's
index. If the branch still sits on an older base — which it does whenever
anything merged while the PR was open — every file the base gained meanwhile is
recorded as a deletion by the PR. Rebasing afterwards does not repair it: the
revert is by then part of the PR's own diff and replays cleanly onto the new
base. It surfaces as unrelated files being reverted, easy to miss in a large
diff and easy to merge.

Hit while squashing #1506: `docs/troubleshooting/device-error-codes.md` came
back as -86 lines because #1501 had merged since the branch point.

Step 6 now fetches and rebases at the top, *before* the edit step rather than
after it: git refuses to rebase a dirty worktree, so a rebase placed after the
fix cannot run at all. Verification gains a three-dot diff of the file list, and
it lives with the single-commit check after the commit exists — at the
soft-reset itself `HEAD` is `$BASE_REF`, so that diff is empty by construction
and would have verified nothing. Two dots would also list files the base has and
the branch does not, rendering them as the branch's deletions: it both hides a
real revert in the noise and invents fake ones.

The single-commit check now separates its outcomes, since the surrounding table
already treats them differently: `> 1` squashes again, `0` stops.

`commit-and-push` §1 gains the fetch, and its soft-reset step states the
precondition it silently relied on.
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.

1 participant