direction: right

vars: {
  d2-config: {
    theme-overrides: {
      N1: "#e0e0e0"
      N2: "#a0a0a0"
      N3: "#707070"
      N4: "#404040"
      N5: "#5d5d5d"
      N6: "#151515"
      N7: "#0a0a0a"

      B1: "#0a0a0a"
      B2: "#111111"
      B3: "#181818"
      B4: "#222222"
      B5: "#5d5d5d"
      B6: "#404040"

      AA2: "#76b900"
      AA4: "#3d7ab5"
      AA5: "#c4a035"

      AB4: "#7a3050"
      AB5: "#2a6b55"
    }
  }
}

gpu: "GPU (HBM)" {
  style: {
    fill: "#2a4a10"
    stroke: "#76b900"
    stroke-width: 2
    font-color: "#e0e0e0"
    font-size: 24
    bold: true
    border-radius: 0
  }
  latency: "~ns" {
    shape: text
    style: {
      font-size: 18
      font-color: "#76b900"
    }
  }
  cap: "Fastest, smallest" {
    shape: text
    style: {
      font-size: 14
      font-color: "#8a8a8a"
      italic: true
    }
  }
}

cpu: "CPU (pinned DRAM)" {
  style: {
    fill: "#0f1e30"
    stroke: "#3d7ab5"
    stroke-width: 2
    font-color: "#e0e0e0"
    font-size: 24
    bold: true
    border-radius: 0
  }
  latency: "~us" {
    shape: text
    style: {
      font-size: 18
      font-color: "#3d7ab5"
    }
  }
  cap: "10-100x GPU capacity" {
    shape: text
    style: {
      font-size: 14
      font-color: "#8a8a8a"
      italic: true
    }
  }
}

nvme: "Local NVMe" {
  style: {
    fill: "#142025"
    stroke: "#50a090"
    stroke-width: 2
    font-color: "#e0e0e0"
    font-size: 24
    bold: true
    border-radius: 0
  }
  latency: "~ms" {
    shape: text
    style: {
      font-size: 18
      font-color: "#50a090"
    }
  }
  cap: "TBs per node" {
    shape: text
    style: {
      font-size: 14
      font-color: "#8a8a8a"
      italic: true
    }
  }
}

remote: "Remote Storage (NIXL)" {
  style: {
    fill: "#201810"
    stroke: "#c08050"
    stroke-width: 2
    font-color: "#e0e0e0"
    font-size: 24
    bold: true
    border-radius: 0
  }
  latency: "~ms (RDMA)" {
    shape: text
    style: {
      font-size: 18
      font-color: "#c08050"
    }
  }
  cap: "Cluster-wide, shared" {
    shape: text
    style: {
      font-size: 14
      font-color: "#8a8a8a"
      italic: true
    }
  }
}

gpu -> cpu: "offload" {
  style: {
    stroke: "#c4a035"
    stroke-width: 2
    font-color: "#c4a035"
    font-size: 18
  }
}

cpu -> nvme: "write-through" {
  style: {
    stroke: "#c4a035"
    stroke-width: 2
    font-color: "#c4a035"
    font-size: 18
  }
}

nvme -> remote: "replicate" {
  style: {
    stroke: "#c4a035"
    stroke-width: 2
    font-color: "#c4a035"
    font-size: 18
  }
}
