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
- Add more detailed timing information.
- More carefully assess the overhead of the profiler.
- Ensure there are no memory leaks or issues should the job terminate unexpectedly.
- Ensure this works on sweeper and multi-run jobs.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file hydra_profiler-0.0.1.tar.gz
.
File metadata
- Download URL: hydra_profiler-0.0.1.tar.gz
- Upload date:
- Size: 7.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 27f41f247c07d37fc5341fc784019f8f966b808c0963fb761bf29f43f2ce6f34 |
|
MD5 | 5c45c8975bbd307ffe67b76bd30506ad |
|
BLAKE2b-256 | de325e1a870f19ce988be90dc3ad531d00f94e2a38eef8567a349a2278d5abec |
File details
Details for the file hydra_profiler-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: hydra_profiler-0.0.1-py3-none-any.whl
- Upload date:
- Size: 3.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 33b7c8022fd0ede88218a45263004e991975179c13ebddcce29ef7e27e83be58 |
|
MD5 | 46c7c4032ac2a9bd3f81b31794929e7c |
|
BLAKE2b-256 | 5c365e9ff3f266ee06e4fd8faa358d91e5d38e08b3b1b17190101853b51254d3 |