Skip to content

Add GPU telemetry with fallback and test coverage - #3

Merged
Abdurrafay19 merged 3 commits into
masterfrom
feature/telemetry-profiler
Sep 5, 2026
Merged

Add GPU telemetry with fallback and test coverage#3
Abdurrafay19 merged 3 commits into
masterfrom
feature/telemetry-profiler

Conversation

@Abdurrafay19

Copy link
Copy Markdown
Owner

This pull request introduces a new, decoupled GPU and wall-clock telemetry profiler for Patchwork, along with comprehensive tests and a manual verification script. The profiler is designed to be robust in environments without a GPU (such as CI), ensuring no crashes and clear error reporting. The main features include a context manager for VRAM profiling, a decorator for easy integration, and a Pydantic model for telemetry results.

Telemetry Profiler Implementation:

  • Added patchwork/telemetry/profiler.py implementing a GPUProfiler context manager that tracks peak VRAM usage and duration, gracefully handling the absence of an NVIDIA GPU or driver, and providing a TelemetryResult Pydantic model for structured results. Includes a decorator (profile_vram) and a utility (profile_call) for easy integration.

Testing and Verification:

  • Added tests/test_profiler.py to verify all fallback and error-handling paths, ensuring correct behavior when no GPU is present and validating JSON serialization of telemetry results.
  • Added scripts/manual_profiler_test.py for manual, on-GPU verification of the profiler in real inference scenarios, allowing developers to confirm correct telemetry when a GPU is available.

@Abdurrafay19 Abdurrafay19 self-assigned this Sep 5, 2026
@Abdurrafay19 Abdurrafay19 added the enhancement New feature or request label Sep 5, 2026
@Abdurrafay19
Abdurrafay19 merged commit e5dab40 into master Sep 5, 2026
1 of 4 checks passed
@Abdurrafay19
Abdurrafay19 deleted the feature/telemetry-profiler branch September 10, 2026 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant