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.

98 lines
3.9 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. "size": data["list"][0]["task"]["size"],
  40. "total": sum([x / (iterations * batch_size * count * count) for x in list(chain([data["list"][i]["report"]["time"]["total"] for i in range(count)]))]),
  41. "combined": [ x / (count * batch_size) for x in list(chain(*[data["list"][i]["report"]["time"]["combined"] for i in range(count)]))],
  42. "submission": [ x / (count * batch_size) for x in list(chain(*[data["list"][i]["report"]["time"]["submission"] for i in range(count)]))],
  43. "completion": [ x / (count * batch_size) for x in list(chain(*[data["list"][i]["report"]["time"]["completion"] for i in range(count)]))]
  44. }
  45. # procceses a single file and appends the desired timings
  46. # to the global data-array, handles multiple runs with a runid
  47. # and ignores if the given file is not found as some
  48. # configurations may not be benchmarked
  49. def process_file_to_dataset(file_path, src_node, dst_node):
  50. try:
  51. file_data = load_time_mesurements(file_path)
  52. time = [file_data["total"]]
  53. run_idx = 0
  54. for t in time:
  55. data.append({ runid : run_idx, x_label : dst_node, y_label : src_node, v_label: calc_throughput(file_data["size"], t)})
  56. run_idx = run_idx + 1
  57. except FileNotFoundError:
  58. return
  59. # loops over all possible configuration combinations and calls
  60. # process_file_to_dataset for them in order to build a dataframe
  61. # which is then displayed and saved
  62. def main(node_config,title):
  63. folder_path = "benchmark-results/"
  64. for src_node in range(16):
  65. for dst_node in range(16):
  66. size = "512mib" if src_node == dst_node and src_node >= 8 else "1gib"
  67. file = os.path.join(folder_path, f"copy-n{src_node}ton{dst_node}-{size}-{node_config}-1e.json")
  68. process_file_to_dataset(file, src_node, dst_node)
  69. df = pd.DataFrame(data)
  70. data.clear()
  71. df.set_index(index, inplace=True)
  72. data_pivot = df.pivot_table(index=y_label, columns=x_label, values=v_label)
  73. plt.figure(figsize=(8, 6))
  74. sns.heatmap(data_pivot, annot=True, cmap="rocket_r", fmt=".0f")
  75. plt.title(title)
  76. plt.savefig(os.path.join(folder_path, f"plot-perf-{node_config}-throughput.png"), bbox_inches='tight')
  77. plt.show()
  78. if __name__ == "__main__":
  79. main("allnodes", title_allnodes)
  80. main("smart", title_smartnodes)