Skip to content

fix(instrument): a component part of whose work fused elsewhere is not scored - #6222

Open
nathanielsimard wants to merge 2 commits into
mainfrom
fix/instrument-partly-fused
Open

nathanielsimard wants to merge 2 commits into
mainfrom
fix/instrument-partly-fused

Conversation

@nathanielsimard

Copy link
Copy Markdown
Member

Checklist

  • I have reviewed and understand the changes in this PR.
  • Confirmed that cargo run-checks has been executed.
  • Made sure the book is up to date with changes in this PR.
  • Added or updated changelog entries for user-visible changes, if applicable, following the
    changelog policy in CONTRIBUTING.md.

Related Issues/PRs

None.

Changes

The report printed impossible percentages for a component that was partly fused. On a Qwen3 4B decode under fusion:

out proj ×36                     0.1    0.4%   bytes  ▓▓▓▓▓▓▓▓▓▓ 1500%*   0.9   0.0
  · PlaneShuffleMatmulKernel ×1  0.1    0.4%
...
· PlaneShuffleMatmulKernel ×35 · fuses ↑ attention › out pr…   2.1  12.0%

One layer's out proj ran alone, and the other 35 fused with the residual add into a kernel on the parent. Since the component held a kernel of its own, it was not "fused elsewhere" and was scored: its floor covers all 36 entries (0.9 ms), while its time was one launch (0.06 ms). Its parent attention and feed forward (whose down fused into the block's kernel) had the same problem, with smaller numbers.

  • burn-instrument: FusedElsewhere now says how much of a component's work ran in a fused kernel recorded elsewhere, as a new FusedShare::{All, Part}. share() replaces contains(). All is the old set; Part is a component named by such a kernel that also ran kernels of its own.
  • burn-instrument-report:
    • A Part component keeps its floor, which the ladder counts in place of the fused kernel, exactly as before. Its row shows its measured time and its floor; the achieved column reads partly fused ↓ in place of a percentage, and there is no gain. It is left out of "worth reading first". The legend explains the mark when a row shows it.
    • The over-peak note loses its paragraph explaining that a partly fused component can read past the peak, since such a component is no longer scored.
    • A comparison treats a change between all, part and none as the work changing hands, as it already did between all and none.

The ladder's totals ("how much is on the table") don't change: they already counted a partly fused component at its floor and left the fused kernel's time out.

Testing

  • cargo test -p burn-instrument -p burn-instrument-report: passes.
  • New a_component_part_of_whose_work_fused_elsewhere_is_not_scored reproduces the stack shape above; it fails without the fix. a_component_fused_elsewhere_ran_no_kernel_of_its_own now also asserts the Part case.
  • cargo clippy -p burn-instrument -p burn-instrument-report --all-targets -- -D warnings and cargo fmt: clean.
  • Not run: cargo run-checks, and a report regenerated from a real run (no saved measurement of the run above).

AI Usage

Claude Code wrote the change and its tests, ran the checks above, and wrote this description and created the PR.

🤖 Generated with Claude Code

nathanielsimard and others added 2 commits October 25, 2026 09:43
…t scored

A stack whose first layer's projection ran alone and whose others fused
with the residual add is one component holding one launch, its floor
pricing every entry: the report scored that floor against one launch's
time and printed figures like 1500% of peak. FusedElsewhere now says how
much of a component's work ran elsewhere, all or part; a partly fused
component keeps its floor on the ladder but has no score.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Oct 25, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 66.16%. Comparing base (f0d2b08) to head (699f7cd).

Files with missing lines Patch % Lines
...s/burn-instrument/src/breakdown/fused_elsewhere.rs 0.00% 7 Missing ⚠️
crates/burn-instrument/src/breakdown/base.rs 0.00% 5 Missing ⚠️

❌ Your patch check has failed because the patch coverage (0.00%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.
❌ Your project check has failed because the head coverage (66.16%) is below the target coverage (80.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6222      +/-   ##
==========================================
- Coverage   66.17%   66.16%   -0.02%     
==========================================
  Files         878      878              
  Lines      127748   127751       +3     
==========================================
- Hits        84541    84528      -13     
- Misses      43207    43223      +16     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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