This contains my bachelors thesis and associated tex files, code snippets and maybe more. Topic: Data Movement in Heterogeneous Memories with Intel Data Streaming Accelerator
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

97 lines
3.8 KiB

  1. import os
  2. import json
  3. import pandas as pd
  4. from itertools import chain
  5. import seaborn as sns
  6. import matplotlib.pyplot as plt
  7. from common import calc_throughput
  8. runid = "Run ID"
  9. x_label = "Destination Node"
  10. y_label = "Source Node"
  11. v_label = "Throughput"
  12. title_allnodes = \
  13. """Copy Throughput in GiB/s tested for 1GiB Elements\n
  14. Using all 8 DSA Chiplets available on the System"""
  15. title_smartnodes = \
  16. """Copy Throughput in GiB/s tested for 1GiB Elements\n
  17. Using Cross-Copy for Intersocket and all 4 Chiplets of Socket for Intrasocket"""
  18. description_smartnodes = \
  19. """Copy Throughput in GiB/s tested for 1GiB Elements\n
  20. Nodes of {8...15} are HBM accessors for their counterparts (minus 8)\n
  21. Using all 4 DSA Chiplets of a Socket for Intra-Socket Operation\n
  22. And using only the Source and Destination Nodes DSA for Inter-Socket"""
  23. description_allnodes = \
  24. """Copy Throughput in GiB/s tested for 1GiB Elements\n
  25. Nodes of {8...15} are HBM accessors for their counterparts (minus 8)\n
  26. Using all 8 DSA Chiplets available on the System"""
  27. index = [ runid, x_label, y_label]
  28. data = []
  29. # loads the measurements from a given file and processes them
  30. # so that they are normalized, meaning that the timings returned
  31. # are nanoseconds per element transfered
  32. def load_time_mesurements(file_path):
  33. with open(file_path, 'r') as file:
  34. data = json.load(file)
  35. count = data["count"]
  36. batch_size = data["list"][0]["task"]["batching"]["batch_size"] if data["list"][0]["task"]["batching"]["batch_size"] > 0 else 1
  37. iterations = data["list"][0]["task"]["iterations"]
  38. return {
  39. "total": sum([x / (iterations * batch_size * count * count) for x in list(chain([data["list"][i]["report"]["time"]["total"] for i in range(count)]))]),
  40. "combined": [ x / (count * batch_size) for x in list(chain(*[data["list"][i]["report"]["time"]["combined"] for i in range(count)]))],
  41. "submission": [ x / (count * batch_size) for x in list(chain(*[data["list"][i]["report"]["time"]["submission"] for i in range(count)]))],
  42. "completion": [ x / (count * batch_size) for x in list(chain(*[data["list"][i]["report"]["time"]["completion"] for i in range(count)]))]
  43. }
  44. # procceses a single file and appends the desired timings
  45. # to the global data-array, handles multiple runs with a runid
  46. # and ignores if the given file is not found as some
  47. # configurations may not be benchmarked
  48. def process_file_to_dataset(file_path, src_node, dst_node):
  49. data_size = 1024*1024*1024
  50. try:
  51. time = [load_time_mesurements(file_path)["total"]]
  52. run_idx = 0
  53. for t in time:
  54. data.append({ runid : run_idx, x_label : dst_node, y_label : src_node, v_label: calc_throughput(data_size, t)})
  55. run_idx = run_idx + 1
  56. except FileNotFoundError:
  57. return
  58. # loops over all possible configuration combinations and calls
  59. # process_file_to_dataset for them in order to build a dataframe
  60. # which is then displayed and saved
  61. def main(node_config,title):
  62. folder_path = "benchmark-results/"
  63. for src_node in range(16):
  64. for dst_node in range(16):
  65. file = os.path.join(folder_path, f"copy-n{src_node}ton{dst_node}-1gib-{node_config}-1e.json")
  66. process_file_to_dataset(file, src_node, dst_node)
  67. df = pd.DataFrame(data)
  68. data.clear()
  69. df.set_index(index, inplace=True)
  70. data_pivot = df.pivot_table(index=y_label, columns=x_label, values=v_label)
  71. plt.figure(figsize=(8, 6))
  72. sns.heatmap(data_pivot, annot=True, cmap="rocket_r", fmt=".0f")
  73. plt.title(title)
  74. plt.savefig(os.path.join(folder_path, f"plot-perf-{node_config}-throughput.png"), bbox_inches='tight')
  75. plt.show()
  76. if __name__ == "__main__":
  77. main("allnodes", title_allnodes)
  78. main("smart", title_smartnodes)