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.

93 lines
3.0 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. # loads the measurements from a given file and processes them
  31. # so that they are normalized, meaning that the timings returned
  32. # are nanoseconds per element transfered
  33. def get_timing(file_path):
  34. divisor = get_task_count(file_path)
  35. return [ x / divisor for x in load_time_mesurements(file_path)]
  36. # procceses a single file and appends the desired timings
  37. # to the global data-array, handles multiple runs with a runid
  38. # and ignores if the given file is not found as some
  39. # configurations may not be benchmarked
  40. def process_file_to_dataset(file_path, src_node, dst_node):
  41. size = 1024*1024*1024
  42. timing = get_timing(file_path)
  43. run_idx = 0
  44. for t in timing:
  45. tp = calc_throughput(size, t)
  46. data.append({ runid : run_idx, x_label : dst_node, y_label : tp})
  47. run_idx = run_idx + 1
  48. def plot_bar(table,title,node_config):
  49. plt.figure(figsize=(2, 3))
  50. sns.barplot(x=x_label, y=y_label, data=table, palette="mako", errorbar="sd")
  51. plt.ylim(0, 75)
  52. plt.savefig(os.path.join(output_path, f"plot-{node_config}-cpu-throughput.pdf"), bbox_inches='tight')
  53. plt.show()
  54. # loops over all possible configuration combinations and calls
  55. # process_file_to_dataset for them in order to build a dataframe
  56. # which is then displayed and saved
  57. def main(node_config,title,ext):
  58. src_node = 0
  59. for dst_node in {8,11,12,15}:
  60. file = os.path.join(result_path, f"copy-n{src_node}ton{dst_node}-1gib-{node_config}{ext}.json")
  61. process_file_to_dataset(file, src_node, dst_node)
  62. df = pd.DataFrame(data)
  63. data.clear()
  64. df.set_index(index, inplace=True)
  65. if ext == "brute": node_config = ext
  66. plot_bar(df, title, node_config)
  67. return df
  68. if __name__ == "__main__":
  69. dall = main("allnodes", title_allnodes, "-cpu")
  70. dbrt = main("brute", title_allnodes, "-cpu")