Skip to content

fix(ci): restore torch E2E coverage in unit-vs-E2E summary - #942

Open
WangLingxun wants to merge 4 commits into
mainfrom
fix/ci-torch-e2e-coverage-combine
Open

fix(ci): restore torch E2E coverage in unit-vs-E2E summary#942
WangLingxun wants to merge 4 commits into
mainfrom
fix/ci-torch-e2e-coverage-combine

Conversation

@WangLingxun

@WangLingxun WangLingxun commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Fix torch E2E coverage missing from the CI Unit vs Unit+E2E summary after PR Update turbo flydsl sparse attn #898 moved the combine step into docker exec without passing COVERAGE_FILE.
  • Rename unit snapshot from .coverage.unit to .coverage_unit so it is not treated as a .coverage.* parallel shard.
  • Explicitly merge .coverage_e2e.* shards before line-merging with unit data.
  • Only run the E2E-shard combine when shards actually exist, and require coverage_combined.json to be non-empty, so a failed merge fails the step instead of silently succeeding with no file.
  • Enable --cov-branch for the unit lane only, so a unit-tested function is only "covered" once both branch arms have run, not just one line of it. E2E stays line-only: turning on branch = true in .coveragerc_e2e made the trainer subprocess chain crash (SIGABRT across all 8 ranks in test_memory_benchmark) once coverage's branch trace was active during real GPU training — caught by this PR's own CI run, reverted before merge.
  • Caption the "including all modules" summary line to note Unit also counts branches while E2E is lines only, since coverage.py's own percent_covered now folds branches into the unit side of that number.
  • Refresh the stale backends/megatron note in coverage_summary.py: CI E2E now runs 15+ configs/PR, not 1-2.

PR #898 moved the torch coverage combine step into docker exec without
passing COVERAGE_FILE, so the first combine merged .coverage.unit as a
parallel shard instead of .coverage_e2e.*. Rename the unit snapshot to
.coverage_unit, merge E2E shards explicitly, and warn when
coverage_combined.json is missing.
@WangLingxun
WangLingxun marked this pull request as ready for review July 31, 2026 06:39
- Add branch = true / --cov-branch to unit and E2E .coveragerc so a
  covered function means both branch arms ran, not just one line.
- Only combine E2E shards when present, and require
  coverage_combined.json to be non-empty, so a failed merge shows red
  instead of silently succeeding with no file.
- Caption the "including all modules" summary line as lines+branches,
  since coverage.py's percent_covered now folds branches in.
- Refresh the stale backends/megatron note: CI E2E now runs 15+
  configs/PR, not 1-2.
test_memory_benchmark SIGABRT'd across all 8 ranks in the last run:
enabling coverage's branch trace while torchrun's real GPU training
subprocesses run is not safe. Unit (a plain pytest process) keeps
--cov-branch; only the E2E lanes drop back to line-only coverage.
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