Skip to content

Conversation

@PiechockiF
Copy link

What does this PR do? Please describe:

Adds a CPU device stat tracker so recipes can run on CPU devices. Previously, running a recipe on CPU would throw DeviceTypeNotSupportedError.

Changes:

  • Added CpuDeviceStatTracker using psutil to track memory (RSS/VMS), CPU usage, thread count, and load average
  • Registered both CPU and CUDA trackers in recipe/composition/device_stat.py
  • Added unit tests for CPU tracker and integration tests for tracker selection
  • Exported Device and enable_deprecation_warnings in main __init__.py for test imports

Fixes #1391

Does your PR introduce any breaking changes? If yes, please list them:

No.

Check list:

  • Was the content of this PR discussed and approved via a GitHub issue? (Add a default CPU stat tracker #1391)
  • Did you read the contributor guideline?
  • Did you make sure that your PR does only one thing instead of bundling different changes together?
  • Did you make sure to update the documentation with your changes?
  • Did you write any new necessary tests?
  • Did you verify new and existing tests pass locally with your changes? (933 tests passing)
  • Did you update the CHANGELOG?

Notes:
all tests passed, no breaking changes to the existing code.
Implements option 3 from the issue (actual CPU tracker vs no-op). Users can still override with custom implementations.

- Implement CpuDeviceStatTracker using psutil for memory/CPU stats
- Register both CPU and CUDA trackers in recipe composition
- Fix circular imports between device_stat and cpu_stat modules
- Add comprehensive unit tests (933 passing)

Fixes DeviceTypeNotSupportedError when running recipes on CPU devices.
- Implement CpuDeviceStatTracker using psutil for memory/CPU stats
- Register both CPU and CUDA trackers in recipe composition
- Fix circular imports between device_stat and cpu_stat modules
- Add comprehensive unit tests (933 passing)
- Export Device and enable_deprecation_warnings in main __init__.py

Fixes DeviceTypeNotSupportedError when running recipes on CPU devices.
@PiechockiF PiechockiF requested a review from cbalioglu as a code owner October 22, 2025 03:14
@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a default CPU stat tracker

1 participant