Skip to main content

A simple hydra profiler to track and record memory usage and runtime information of jobs.

Project description

Hydra Profiler

This package provides an extremely simple utility that can be used via the Hydra configuration system's experimental callbacks system to automatically profile the memory usage and runtime of your Hydra-launched python jobs.

Installation

pip install hydra-profiler

Usage

When running any hydra job, just add the following to your command line:

$COMMAND... ++hydra.callbacks.profiler._target_=hydra_profiler.profiler.ProfilerCallback

Once your job is complete, a memray memory profile will be saved to the hydra's run directory under the filepath ${hydra.run.dir}/${job_name}.memray. Additionally, a timing.json file will be written that contains the overall job's runtime. No extensive time profiling (e.g., with cProfile) is included at this time.

You can also add this to your hydra configuration file directly:

hydra:
  callbacks:
    profiler:
      _target_: hydra_profiler.profiler.ProfilerCallback

You can then use the output files via any memray tool (on the memory side) and just by inspecting the timing.json file for the runtime.

Future Work

  1. Add more detailed timing information.
  2. More carefully assess the overhead of the profiler.
  3. Ensure there are no memory leaks or issues should the job terminate unexpectedly.
  4. Ensure this works on sweeper and multi-run jobs.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hydra_profiler-0.0.1.tar.gz (7.1 kB view hashes)

Uploaded Source

Built Distribution

hydra_profiler-0.0.1-py3-none-any.whl (3.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page