Support: add l0_swimlane intra-core pipeline profiler#1213
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughAdds a new ChangesL0 Swimlane Tool and Documentation
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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. Comment |
There was a problem hiding this comment.
Code Review
This pull request introduces the l0_swimlane tool, along with its associated documentation and skill guides, to generate AICore intra-core swimlane traces for tasks. The code review highlights several critical improvements: implementing a stack-based pairing approach for trace events without IDs to prevent trace corruption, passing resolved environment variables to the dump subprocess to avoid execution failures, explicitly specifying UTF-8 encoding and error replacement when reading or writing files to prevent decoding crashes, and generating RAII scopes in the replay host to prevent resource leaks upon API failures.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 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 @.claude/skills/l0-swimlane/SKILL.md:
- Around line 95-106: Update the `--case NAME` guidance in `SKILL.md` to remove
the claim that the replay defaults to the first matching case; instead explain
that `--case` must be passed explicitly to pin a specific case, and that
omitting it leaves the dump/run unscoped so the test may use default cases or
the wrong/newest dump. Keep the wording tied to the `--case`, `--set-arg`, and
replay behavior described in the `CASES[*]` section so readers understand when
case pinning is required.
In `@docs/dfx/l0-swimlane-profiling.md`:
- Around line 175-182: The workspace naming docs omit the `_mix...` segment,
which causes the example path to point to the wrong output directory. Update the
wording around the workspace location and trace filenames to use the actual
label format from the profiling flow, including the
`<Class>_<Case>_<platform>_<kernel>_mix<members>` segment in the referenced
workspace name and copied trace names. Keep the same structure in the section
that mentions the final traces so readers can map the generated workspace
correctly.
In `@simpler_setup/tools/l0_swimlane.py`:
- Around line 1140-1150: The task-submit --run payload in swimlane collection is
building a shell string with unquoted interpolated values, so update the command
construction in the code that assembles cmd to shell-quote every injected
path/value before embedding it. Use shlex.quote for CANN_HOME, PTO_ISA_ROOT,
REPO_ROOT, and ws in the run string so the task-submit invocation remains safe
and the script path is resolved correctly even when values contain spaces or
shell metacharacters.
- Around line 163-172: The default block width in _case_block_dim() is being
derived from the first platform-matching entry in CASES, which ignores the
user-selected dump case. Update the logic that feeds the synthesized slot-48
block_num so it resolves block_dim from the selected case via args.case or the
recovered manifest case instead of the current platform-first ordering. Make
sure the change is applied consistently where _case_block_dim() is used so
replay_host.cpp gets the block width for the pinned case, not an arbitrary
matching CASES entry.
🪄 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
Run ID: b9cc59f5-0006-4463-9e6b-870f7566af86
📒 Files selected for processing (3)
.claude/skills/l0-swimlane/SKILL.mddocs/dfx/l0-swimlane-profiling.mdsimpler_setup/tools/l0_swimlane.py
Dump-driven tool that traces one task's intra-core AICore pipeline under the msprof op simulator (camodel), one level below an L2 task block. - Capture a task's real args[] from a JSON-only args dump (hw-native-sys#1181 positional model), reconstruct them, and generate a combined replay workspace — zero hand-written shapes or scalars. - Mix-together replay: a whole mix task (AIC + AIV0 + AIV1) runs as one msprof op. Two same-source AIV members collapse to a single-AIV include (both lanes run it), covering SPMD mixes whose aiv0 == aiv1. - Flags for the manual decisions: --func-id (member set), --set-arg (shrink a scalar / control-tensor loop count without distorting the per-iteration pipeline), --spmd-block-num, --case, --debug-line. - docs/dfx/l0-swimlane-profiling.md: usage, fidelity rules, and a hw-native-sys#1181-suite coverage table with a runnable command per task shape. - .claude/skills/l0-swimlane/SKILL.md: agent-facing operating procedure, centered on how to pick --set-arg / --func-id / --case.
|
/gemini review |
|
Warning Gemini encountered an error creating the review. You can try again by commenting |
Dump-driven tool that traces one task's intra-core AICore pipeline under the msprof op simulator (camodel), one level below an L2 task block.