fix: deduplicate mirrored Linux RAPL counters - #1276
Conversation
|
Thanks for your contribution, that seems great! |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1276 +/- ##
==========================================
+ Coverage 89.70% 89.79% +0.09%
==========================================
Files 48 48
Lines 4778 4791 +13
==========================================
+ Hits 4286 4302 +16
+ Misses 492 489 -3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Hello, you have created more than 20 repository today, I suspect you are an OpenClaw agent. I'm not against AI contribution, but a human must be accountable and willing to contribute to our project. Please respect the PR submission template. We will merge EMI PR in a few days then look back at this PR. |
|
Updated the PR description to the complete repository template, including the required 🟠 AI-generated disclosure. I personally reviewed and tested every submitted line, understand the implementation, and can explain and support it through review and after merge. |
Description
Drop mirrored nonzero Linux RAPL package counters at monitoring startup while preserving distinct package counters, zero counters, and DRAM domains. The documentation explains the multi-die mirrored-counter behavior.
Related Issue
Fixes #1274
Motivation and Context
Some Linux multi-die systems expose mirrored package-energy counters. Counting each mirror separately overstates CPU energy consumption, while indiscriminate deduplication could incorrectly remove distinct or zero-valued counters.
How Has This Been Tested?
uv run pytest tests/test_rapl_mmio_scanning.py -quv run pytest tests/test_cpu.py tests/test_rapl_mmio_scanning.py tests/test_rapl_parameters.py -quv run ruff check codecarbon/core/cpu.py tests/test_rapl_mmio_scanning.pyuv run ruff format --check codecarbon/core/cpu.py tests/test_rapl_mmio_scanning.pygit diff --checkScreenshots (if appropriate):
Not applicable.
Types of changes
AI Usage Disclosure
OpenAI Codex assisted with implementation, tests, and documentation preparation. I personally reviewed and tested every submitted line, understand the implementation, and can explain and maintain it.
Checklist: