def plot_size_cdf(df, cdf_ax, cumsum_ax, cdf_kws=None, cumsum_kws=None, **kwargs): sizes = df[df.Sign > 0].Size if cdf_kws is None: cdf_kws = {} cdf_kws.update(kwargs) pu.cdf(sizes, ax=cdf_ax, **cdf_kws) if cumsum_kws is None: cumsum_kws = {} cumsum_kws.update(kwargs) sizes.sort_values().reset_index(drop=True).cumsum().plot(ax=cumsum_ax, **cumsum_kws) pu.cleanup_axis_bytes(cdf_ax.xaxis, format='%(value).0f %(symbol)s') cdf_ax.set_ylabel('CDF') cdf_ax.set_xlabel('Memory Allocation Size') pu.cleanup_axis_bytes(cumsum_ax.yaxis, maxN=5, format='%(value).0f %(symbol)s') cumsum_ax.set_ylabel('Cumsum of Sizes') cumsum_ax.set_xlabel('Memory Allocations')
def plot_jcts(df, fifo, **kwargs): ax = pu.cdf(df.JCT.dt.total_seconds(), label='SRTF') ax = pu.cdf(fifo.JCT.dt.total_seconds(), label='FIFO', ax=ax) ax.set_xlabel('JCT (s)') ax.set_ylabel('CDF') ax.legend() return ax
def plot_jcts(df, **kwargs): ax = kwargs.pop('ax', None) if ax is None: ax = plt.gca() for col in df.columns: pu.cdf(df[col].dt.total_seconds(), label=col, ax=ax, **kwargs) ax.set_xlabel('JCT (s)') ax.set_ylabel('CDF') ax.legend() return ax
def plot_ratio(df, **kwargs): df = df[df.Network.str.contains("eval")].set_index('Network') ratio = df.TransferTime / df['20iter-avg'] ax = pu.cdf(ratio, **kwargs) #ax.axvline(1) ax.set_xlabel('Transfer Time to Inference Latency Ratio') return ax