(self)
| 602 | plt.savefig(f'{self.out_directory}/figure_4_Architectures.png', format='png', dpi=800, bbox_inches='tight') |
| 603 | |
| 604 | def plot_end_to_end(self): |
| 605 | mpl.rcParams['hatch.linewidth'] = 0.2 |
| 606 | mpl.rcParams['axes.linewidth'] = 0.5 |
| 607 | |
| 608 | script_dir = os.path.dirname(os.path.abspath(__file__)) |
| 609 | file_path = os.path.join(script_dir, "../end_to_end_bench/result") |
| 610 | cleaned_file_path = self.clean_end_to_end_file(file_path) |
| 611 | |
| 612 | column_names = [ |
| 613 | 'dataset', 'repetition', 'warmup_repetition', 'scheme', 'thread_n', |
| 614 | 'query', 'time(s)', 'result(tpc)', 'corrected_result(tpc)', 'validity', |
| 615 | 'compression_cycles', 'cycles' |
| 616 | ] |
| 617 | |
| 618 | benchmarked_data = pd.read_csv(cleaned_file_path, names=column_names, header=0) |
| 619 | scan_sum_data = benchmarked_data[['dataset', 'scheme', 'thread_n', 'cycles', 'repetition', 'query']].copy() |
| 620 | scan_sum_data['cycles'] = pd.to_numeric(scan_sum_data['cycles'], errors='coerce') |
| 621 | |
| 622 | scan_sum_data_w_cycles = scan_sum_data.copy() |
| 623 | scan_sum_data_w_cycles['cpt'] = ((scan_sum_data_w_cycles['cycles'] / scan_sum_data_w_cycles['repetition'])) * scan_sum_data_w_cycles['thread_n'] |
| 624 | scan_sum_data_w_cycles['tpc'] = 1 / scan_sum_data_w_cycles['cpt'] |
| 625 | |
| 626 | comp_data = pd.read_csv(cleaned_file_path, names=column_names, header=0) |
| 627 | comp_data = comp_data[ |
| 628 | (comp_data['thread_n'] == 1) & |
| 629 | (comp_data['query'] == 'SCAN') |
| 630 | ] |
| 631 | comp_data['cycles'] = pd.to_numeric(comp_data['compression_cycles'], errors='coerce') |
| 632 | comp_data['cpt'] = ((comp_data['cycles'] / comp_data['repetition'])) * comp_data['thread_n'] |
| 633 | comp_data['tpc'] = 1 / comp_data['cpt'] |
| 634 | comp_data['query'] = 'COMP' |
| 635 | |
| 636 | benchmarked_data = pd.concat([scan_sum_data_w_cycles, comp_data]) |
| 637 | benchmarked_data['dataset'] = benchmarked_data['dataset'].apply(self.get_dataset_name) |
| 638 | benchmarked_data['scheme'] = benchmarked_data['scheme'].apply(self.map_encoding_name) |
| 639 | benchmarked_data['query'] = benchmarked_data['query'] + benchmarked_data['thread_n'].astype(str) |
| 640 | benchmarked_data = benchmarked_data[['dataset', 'scheme', 'query', 'tpc', 'cpt']] |
| 641 | benchmarked_data = benchmarked_data.sort_values('scheme') |
| 642 | |
| 643 | # Table 6 Generation (City-Temp end-to-end speed) |
| 644 | METRIC_FOR_TABLE = 'cpt' |
| 645 | city_temp_data = benchmarked_data.copy() |
| 646 | city_temp_data = city_temp_data.sort_values(['scheme', 'dataset', 'query']) |
| 647 | city_temp_data = city_temp_data.set_index(['scheme', 'dataset'])[['query', METRIC_FOR_TABLE]].pivot(columns=['query']) |
| 648 | city_temp_data = city_temp_data.droplevel(0, axis=1) |
| 649 | city_temp_data = city_temp_data.reset_index() |
| 650 | city_temp_data = city_temp_data.fillna(0) |
| 651 | city_temp_data = city_temp_data[city_temp_data['dataset'] == 'City-Temp'] |
| 652 | city_temp_data = city_temp_data.set_index('scheme') |
| 653 | city_temp_data = city_temp_data[['SCAN1', 'SCAN8', 'SCAN16', 'SUM1', 'SUM8', 'SUM16', 'COMP1']] |
| 654 | print('Table 6 with Raw cycle values', city_temp_data) |
| 655 | city_temp_data.loc[:,:] = city_temp_data.loc[:,:].div(city_temp_data.iloc[0, :]) |
| 656 | city_temp_data.loc[['ALP', 'Uncompressed', 'PDE', 'Patas', 'Gorilla', 'Chimp', 'Chimp128', 'Zstd']] |
| 657 | print('Table 6 normalized', city_temp_data) |
| 658 | city_temp_data = city_temp_data.astype(str) |
| 659 | city_temp_data = city_temp_data.map(lambda x: x[:4]) # 4 precision digits |
| 660 | city_temp_data.iloc[1] = city_temp_data.iloc[1].astype(str) + 'x Slower than ALP ↓' |
| 661 | output_file = os.path.join(script_dir, "../tables/table_6.md") |
no test coverage detected