Skip to content

Instantly share code, notes, and snippets.

name: deepseek operational carbon estimate
description: null
tags: null
aggregation:
metrics:
- operational-carbon
type: both
initialize:
plugins:
power-to-energy-ws:
@jmcook1186
jmcook1186 / neuralwatt-helper.py
Last active April 29, 2025 13:26
Preprocessing of raw power data into IF inputs
import pandas as pd
root = './neuralwatt/'
in_data = 'inference.nvidia_smi_log.none_h100_llama3.3_20250316_230401.csv'
# clean and prep data
data = pd.read_csv(root+in_data)
data = data[['timestamp', 'power.draw(W)']] # extract relevant features
data.replace(' ', 'T', regex=True, inplace=True) # format timestamp
name: carbon-intensity plugin demo
description: null
tags: null
aggregation:
metrics:
- operational-carbon
type: both
initialize:
plugins:
power-to-energy-ws:
@jmcook1186
jmcook1186 / aggregate-arrays.txt
Last active February 9, 2024 13:51
aggregate-metrics-array
const tree = {
name: "Root",
children: [{
name: "A",
energy: [40, 40, 40],
carbon: [10, 10, 10],
children: [{
name: "C",
@jmcook1186
jmcook1186 / aggregate-draft.txt
Last active February 9, 2024 13:51
IF: draft aggregation function
/** This function does a depth-first, post-order traversal of the tree and aggregates the named metrics from each child into the parent node all the way up to the root*/
const tree = {
name: "Root",
carbon: 0,
energy: 0,
children: [{
name: "A",
energy: 40,
@jmcook1186
jmcook1186 / aggregation-test2.yml
Created January 24, 2024 11:56
manifest file for testing aggregation feature
name: nesting-demo
description: null
tags:
kind: web
complexity: moderate
category: on-premise
aggregation:
type: both
metrics:
- 'cpu-util'
// some input data with gaps in the record
const inputs = [{ timestamp: '2023-07-06T00:00', carbon: 10, energy: 30, duration: 10 },
{ timestamp: '2023-07-06T00:10', carbon: 10, energy: 30, duration: 10 },
{ timestamp: '2023-07-06T00:30', carbon: 10, energy: 30, duration: 5 },
{ timestamp: '2023-07-06T00:50', carbon: 10, energy: 30, duration: 20 }
]
const startTime = '2023-07-06T00:00'
const interval = 60
const endTime = '2023-07-06T10:00'
@jmcook1186
jmcook1186 / demo-ompl
Created November 8, 2023 11:02
demo ompl
name: if-demo
description: pipeline demo
initialize:
models:
- name: azure-importer
kind: builtin
- name: cloud-instance-metadata
kind: builtin
- name: intel
kind: shell
@jmcook1186
jmcook1186 / demo-impl
Created November 8, 2023 11:00
IF demo impl
name: if-demo
description: pipeline demo
initialize:
models:
- name: azure-importer
kind: builtin
- name: cloud-instance-metadata
kind: builtin
- name: intel
kind: shell
@jmcook1186
jmcook1186 / biosnicar-distributed.py
Created June 12, 2023 09:01
distributed runs of biosnicar using Dask delayed
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# save this alongside snicar-driver.py and run in the terminal using
# `python src/biosnicar/biosnicar-distributed.py`
import numpy as np
from pathlib import Path
import dask