stfc / janus-core

Tools for machine learnt interatomic potentials
https://stfc.github.io/janus-core/
BSD 3-Clause "New" or "Revised" License
9 stars 7 forks source link

Track carbon usage for calculations #203

Closed ElliottKasoar closed 1 month ago

ElliottKasoar commented 1 month ago

Resolves #68

See https://codecarbon.io/ and https://mlco2.github.io/codecarbon/index.html

There are quite a few alternative implementations, but this is one option, which adds a section to the log, based on the documentation e.g.:

- timestamp: 2024-07-10 17:20:53,779
  level: INFO
  message:
    timestamp: 2024-07-10T17:20:53
    project_name: janus-core
    run_id: cfd5626c-92bd-400d-bac6-bf2e599d34a0
    duration: 0.5009441375732422
    emissions: 4.837736120304575e-07
    emissions_rate: 9.657236720526065e-07
    cpu_power: 7.5
    gpu_power: 0.0
    ram_power: 5.823497772216797
    cpu_energy: 1.0434945424397786e-06
    gpu_energy: 0
    ram_energy: 8.089440937358934e-07
    energy_consumed: 1.8524386361756719e-06
    country_name: United Kingdom
    country_iso_code: GBR
    region: None
    cloud_provider:
    cloud_region:
    os: Linux-5.15.153.1-microsoft-standard-WSL2-x86_64-with-glibc2.31
    python_version: 3.11.9
    codecarbon_version: 2.5.0
    cpu_count: 8
    cpu_model: Intel(R) Core(TM) i7-8665U CPU @ 1.90GHz
    gpu_count: None
    gpu_model: None
    longitude: None
    latitude: None
    ram_total_size: 15.529327392578125
    tracking_mode: machine
    on_cloud: N
    pue: 1.0
  trace: logger
  line: 22

Alternatives include: