<jupyter_start><jupyter_text>FlexDriver performance modelRun the performance model of FlexDriver to recreate the charts of the paper.<jupyter_code>%config InlineBackend.figure_format = 'retina'

from common import *
from fld_model import *
fld_model_df = pd.concat(fld_model(**kwargs) for kwargs in [
    { 'model': '25GbE/PCIe x8', 'linerate': 25, 'pci_lanes': 8, }, 
    { 'model': '50GbE/PCIe x8', 'linerate': 50, 'pci_lanes': 8, }, 
    { 'model': '100GbE/PCIe x16', 'linerate': 100, 'pci_lanes': 16 },
])
fld_model_df.model = pd.Categorical(fld_model_df.model).reorder_categories(
    ['25GbE/PCIe x8', '50GbE/PCIe x8', '100GbE/PCIe x16'])
fld_model_df[fld_model_df['size'] == 1088][[
    'pci_outbound_control_overhead', 'model', 'pci_expected_bandwidth',
    'pci_packet_rate', 'ethernet_linerate']]
value_vars = ['ethernet_linerate', 'pci_expected_bandwidth']
value_var_names = ['Eth', 'PCIe']
melted = (fld_model_df
          .melt(id_vars=['size', 'model', 'linerate'], value_vars=value_vars)
          .sort_values('linerate')
         )
melted.variable.replace(dict(zip(value_vars, value_var_names)), inplace=True)
melted.variable = melted.variable.astype(pd.CategoricalDtype()).cat.reorder_categories(value_var_names[:min(len(value_vars), len(value_var_names))])
plt = p9.ggplot(melted,
                p9.aes(x='size', y='value', color='variable', linetype='variable')) + \
    p9.geom_line() + \
    p9.scale_x_continuous(name='packet size [byte]', limits=(4, 1024), breaks=[512 * i for i in range(1, 5)]) + \
    p9.scale_y_continuous(name='bandwidth [Gbps]', limits=(0, None)) + \
    top_legend + \
    p9.theme(figure_size=(fig_width-0.5, performance_model_height),
             subplots_adjust={'top': 0.8}) + \
    p9.coord_cartesian(ylim=(0, None)) + \
    p9.facet_wrap('model') + \
    eth_pci_scale
plt
plt.save('fld_model_breakdown.pdf')
df = fld_model_df[fld_model_df['size'] == 512][['linerate', 'bandwidth', 'ethernet_linerate']].set_index('linerate')
df['bandwidth'] / df['ethernet_linerate']<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.17007797270955166, 'fraction_numerical': 0.031189083820662766, 'mean_word_length': 5.2782874617737, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '295477', 'license': 'BSD-2-Clause', 'n_tokens_mistral': 846, 'n_tokens_neox': 785, 'n_words': 124, 'path': 'fld_model_figures.ipynb', 'repo_name': 'haggaie/flexdriver-model', 'size': '2052'}