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.

109 lines
3.4 KiB

  1. import os
  2. import pandas as pd
  3. import seaborn as sns
  4. import matplotlib.pyplot as plt
  5. from common import calc_throughput, load_time_mesurements, get_task_count
  6. result_path = "benchmark-results/"
  7. output_path = "benchmark-plots/"
  8. runid = "Run ID"
  9. x_label = "Destination Node"
  10. y_label = "Throughput in GiB/s"
  11. title_allnodes = \
  12. """Copy Throughput in GiB/s tested for 1GiB Elements\n
  13. Using all 8 DSA Chiplets available on the System"""
  14. title_smartnodes = \
  15. """Copy Throughput in GiB/s tested for 1GiB Elements\n
  16. Using Cross-Copy for Intersocket and all 4 Chiplets of Socket for Intrasocket"""
  17. title_difference = \
  18. """Gain in Copy Throughput in GiB/s of All-DSA vs. Smart Assignment"""
  19. description_smartnodes = \
  20. """Copy Throughput in GiB/s tested for 1GiB Elements\n
  21. Nodes of {8...15} are HBM accessors for their counterparts (minus 8)\n
  22. Using all 4 DSA Chiplets of a Socket for Intra-Socket Operation\n
  23. And using only the Source and Destination Nodes DSA for Inter-Socket"""
  24. description_allnodes = \
  25. """Copy Throughput in GiB/s tested for 1GiB Elements\n
  26. Nodes of {8...15} are HBM accessors for their counterparts (minus 8)\n
  27. Using all 8 DSA Chiplets available on the System"""
  28. index = [ runid, x_label, y_label]
  29. data = []
  30. data_peakbench_andre = [
  31. { runid : 0, x_label : 8, y_label : 64 },
  32. { runid : 0, x_label : 11, y_label : 63 },
  33. { runid : 0, x_label : 12, y_label : 40 },
  34. { runid : 0, x_label : 15, y_label : 54 }
  35. ]
  36. # loads the measurements from a given file and processes them
  37. # so that they are normalized, meaning that the timings returned
  38. # are nanoseconds per element transfered
  39. def get_timing(file_path):
  40. divisor = get_task_count(file_path)
  41. return [ x / divisor for x in load_time_mesurements(file_path)]
  42. # procceses a single file and appends the desired timings
  43. # to the global data-array, handles multiple runs with a runid
  44. # and ignores if the given file is not found as some
  45. # configurations may not be benchmarked
  46. def process_file_to_dataset(file_path, src_node, dst_node):
  47. size = 1024*1024*1024
  48. timing = get_timing(file_path)
  49. run_idx = 0
  50. for t in timing:
  51. tp = calc_throughput(size, t)
  52. data.append({ runid : run_idx, x_label : dst_node, y_label : tp})
  53. run_idx = run_idx + 1
  54. def plot_bar(table,title,node_config):
  55. plt.figure(figsize=(2, 3))
  56. sns.barplot(x=x_label, y=y_label, data=table, palette="mako", errorbar="sd")
  57. plt.ylim(0, 75)
  58. plt.savefig(os.path.join(output_path, f"plot-{node_config}-cpu-throughput.pdf"), bbox_inches='tight')
  59. plt.show()
  60. # loops over all possible configuration combinations and calls
  61. # process_file_to_dataset for them in order to build a dataframe
  62. # which is then displayed and saved
  63. def main(node_config,title,ext):
  64. src_node = 0
  65. for dst_node in {8,11,12,15}:
  66. file = os.path.join(result_path, f"copy-n{src_node}ton{dst_node}-1gib-{node_config}{ext}.json")
  67. process_file_to_dataset(file, src_node, dst_node)
  68. df = pd.DataFrame(data)
  69. data.clear()
  70. df.set_index(index, inplace=True)
  71. if ext == "brute": node_config = ext
  72. plot_bar(df, title, node_config)
  73. return df
  74. def plotandre():
  75. df = pd.DataFrame(data_peakbench_andre)
  76. df.set_index(index, inplace=True)
  77. plot_bar(df, title_allnodes, "andrepeak")
  78. return df
  79. if __name__ == "__main__":
  80. dandr = plotandre()
  81. dall = main("allnodes", title_allnodes, "-cpu")
  82. dbrt = main("brute", title_allnodes, "-cpu")