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.

90 lines
3.1 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, index_from_element, load_time_mesurements
  6. runid = "Run ID"
  7. x_label = "Size of Submitted Task"
  8. y_label = "Throughput in GiB/s"
  9. var_label = "Submission Type"
  10. sizes = ["1kib", "4kib", "1mib"]
  11. sizes_nice = ["1 KiB", "4 KiB", "1 MiB", "128 MiB"]
  12. types = ["bs10", "bs50", "ssaw"]
  13. types_nice = ["Batch, Size 10", "Batch, Size 50", "Single Submit"]
  14. title = \
  15. """Throughput showing Optimal Submission Method and Size\n
  16. Copy Operation tested Intra-Node on DDR with 1 Engine per WQ"""
  17. description = \
  18. """Throughput showing Optimal Submission Method and Size\n
  19. Batch uses a Batch Descriptor of given Size\n
  20. Multi-Submit fills the Work Queue with n Single Descriptors\n
  21. Single-Submit submits one Descriptor and immediately waits\n
  22. Copy Operation tested Intra-Node on DDR with 1 Engine per WQ"""
  23. index = [runid, x_label, var_label]
  24. data = []
  25. # loads the measurements from a given file and processes them
  26. # so that they are normalized, meaning that the timings returned
  27. # are nanoseconds per element transfered
  28. def get_timing(file_path,type_label):
  29. divisor = 0
  30. if type_label == "bs10": divisor = 10
  31. elif type_label == "bs50" : divisor = 50
  32. else: divisor = 1
  33. return [ x / divisor for x in load_time_mesurements(file_path)]
  34. # procceses a single file and appends the desired timings
  35. # to the global data-array, handles multiple runs with a runid
  36. # and ignores if the given file is not found as some
  37. # configurations may not be benchmarked
  38. def process_file_to_dataset(file_path, type_label,size_label):
  39. type_index = index_from_element(type_label,types)
  40. type_nice = types_nice[type_index]
  41. size_index = index_from_element(size_label, sizes)
  42. size_nice = sizes_nice[size_index]
  43. data_size = 0
  44. if size_label == "1kib": data_size = 1024;
  45. elif size_label == "4kib": data_size = 4 * 1024;
  46. elif size_label == "1mib": data_size = 1024 * 1024;
  47. elif size_label == "128mib": data_size = 128 * 1024 * 1024;
  48. time = get_timing(file_path,type_label)
  49. run_idx = 0
  50. for t in time:
  51. data.append({ runid : run_idx, x_label: size_nice, var_label : type_nice, y_label : calc_throughput(data_size, t)})
  52. run_idx = run_idx + 1
  53. # loops over all possible configuration combinations and calls
  54. # process_file_to_dataset for them in order to build a dataframe
  55. # which is then displayed and saved
  56. def main():
  57. result_path = "benchmark-results/"
  58. output_path = "benchmark-plots/"
  59. for type_label in types:
  60. for size in sizes:
  61. file = os.path.join(result_path, f"submit-{type_label}-{size}.json")
  62. process_file_to_dataset(file, type_label, size)
  63. df = pd.DataFrame(data)
  64. df.set_index(index, inplace=True)
  65. df = df.sort_values(y_label)
  66. plt.figure(figsize=(4, 4))
  67. sns.barplot(x=x_label, y=y_label, hue=var_label, data=df, palette="mako", errorbar="sd")
  68. plt.savefig(os.path.join(output_path, "plot-submitmethod.pdf"), bbox_inches='tight')
  69. plt.show()
  70. if __name__ == "__main__":
  71. main()