Skip to content

Commit

Permalink
best-fit line appears to be working, not interactive
Browse files Browse the repository at this point in the history
  • Loading branch information
jowens committed Jul 16, 2024
1 parent 9de85dd commit 52b33a2
Showing 1 changed file with 36 additions and 17 deletions.
53 changes: 36 additions & 17 deletions nvperf.py
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,20 @@ def merge(df, dst, src, replaceNoWithNaN=False, delete=True):
domain=["AMD", "NVIDIA", "Intel"], range=["#ff0000", "#76b900", "#0071c5"]
)

dfpr = pd.DataFrame(
pd.melt(
df,
id_vars=["Launch", "Model", "GPU Type", "Vendor"],
value_vars=[
"Single-precision GFLOPS",
"Double-precision GFLOPS",
"Half-precision GFLOPS",
],
var_name="Datatype",
value_name="Processing power (GFLOPS)",
),
)

config_default = {
"df": df,
"x": "Launch:T",
Expand All @@ -553,6 +567,7 @@ def merge(df, dst, src, replaceNoWithNaN=False, delete=True):

config = {
"bw": {
"df": df[df["Memory Bandwidth (GB/s)"].notnull()],
"title": "Memory Bandwidth over Time",
"y": "Memory Bandwidth (GB/s):Q",
"color": "Memory Bus type:N",
Expand All @@ -577,18 +592,21 @@ def merge(df, dst, src, replaceNoWithNaN=False, delete=True):
"tooltip": ["Memory Size (GB)", "Memory Bus type"],
},
"l2": {
"df": df[df["L2 Cache (MB)"].notnull()],
"title": "L2 Cache Size over Time",
"y": "L2 Cache (MB):Q",
"color": "Memory Bus type:N",
"tooltip": ["L2 Cache (MB)"],
},
"l2dram": {
"df": df[df["L2 to DRAM Ratio"].notnull()],
"title": "L2 to DRAM Ratio",
"y": "L2 to DRAM Ratio:Q",
"color": "Memory Bus type:N",
"tooltip": ["L2 Cache (MB)", "Memory Size (GB)", "L2 to DRAM Ratio"],
},
"bwpin": {
"df": df[df["Memory Bandwidth per Pin (GB/s)"].notnull()],
"title": "Memory Bandwidth per Pin over Time",
"y": "Memory Bandwidth per Pin (GB/s):Q",
"color": "Memory Bus type:N",
Expand All @@ -600,22 +618,13 @@ def merge(df, dst, src, replaceNoWithNaN=False, delete=True):
},
"pr": {
"title": "Processing Power over Time",
"df": pd.melt(
df,
id_vars=["Launch", "Model", "GPU Type", "Vendor"],
value_vars=[
"Single-precision GFLOPS",
"Double-precision GFLOPS",
"Half-precision GFLOPS",
],
var_name="Datatype",
value_name="Processing power (GFLOPS)",
),
"df": dfpr[dfpr["Processing power (GFLOPS)"].notnull()],
"y": "Processing power (GFLOPS):Q",
"color": "Datatype:N",
"tooltip": ["Datatype", "Processing power (GFLOPS)"],
},
"sm": {
"df": df[df["SM count"].notnull()],
"title": "SM count over Time",
"y": "SM count:Q",
"shape": "GPU Type",
Expand All @@ -624,20 +633,25 @@ def merge(df, dst, src, replaceNoWithNaN=False, delete=True):
},
"sh": {
"title": "Shader count over Time",
"df": df[df["Pixel/unified shader count"] != 0],
"df": df[
df["Pixel/unified shader count"].notnull()
& (df["Pixel/unified shader count"] != 0)
],
"y": "Pixel/unified shader count:Q",
"shape": "GPU Type",
"color": vendor_colormap,
"tooltip": ["Pixel/unified shader count"],
},
"die": {
"df": df[df["Die size (mm2)"].notnull()],
"title": "Die Size over Time",
"y": "Die size (mm2):Q",
"shape": "GPU Type",
"color": vendor_colormap,
"tooltip": ["Die size (mm2)"],
},
"xt": {
"df": df[df["Transistors (billion)"].notnull()],
"title": "Transistor Count over Time",
"y": "Transistors (billion):Q",
"shape": "GPU Type",
Expand All @@ -660,13 +674,15 @@ def merge(df, dst, src, replaceNoWithNaN=False, delete=True):
"tooltip": ["Core clock (MHz)", "GPU Type"],
},
"cost": {
"df": df[df["Release Price (USD)"].notnull()],
"title": "Release price over Time",
"y": "Release Price (USD):Q",
"color": vendor_colormap,
"shape": "GPU Type",
"tooltip": ["Release Price (USD)"],
},
"fperdollar": {
"df": df[df["Single precision GFLOPS/USD"].notnull()],
"title": "GFLOPS per Dollar over Time",
"y": "Single precision GFLOPS/USD:Q",
"yscale": "linear",
Expand All @@ -679,6 +695,7 @@ def merge(df, dst, src, replaceNoWithNaN=False, delete=True):
],
},
"fpw": {
"df": df[df["Single precision GFLOPS/Watt"].notnull()],
"title": "GFLOPS per Watt over Time",
"color": "Fab (nm):N",
"y": "Single precision GFLOPS/Watt:Q",
Expand Down Expand Up @@ -748,13 +765,15 @@ def merge(df, dst, src, replaceNoWithNaN=False, delete=True):
],
},
"pwr": {
"df": df[df["TDP (Watts)"].notnull()],
"title": "Power over Time",
"y": "TDP (Watts)",
"shape": "Vendor:N",
"color": "Fab (nm):N",
"tooltip": ["Fab (nm)", "TDP (Watts)"],
},
"pwrdens": {
"df": df[df["Watts/mm2"].notnull()],
"title": "Power density over Time",
"y": "Watts/mm2",
"yscale": "linear",
Expand All @@ -763,6 +782,7 @@ def merge(df, dst, src, replaceNoWithNaN=False, delete=True):
"tooltip": ["Fab (nm)", "TDP (Watts)", "Die size (mm2)", "Watts/mm2"],
},
"transdens": {
"df": df[df["Transistor Density (B/mm2)"].notnull()],
"title": "Transistor density over Time",
"y": "Transistor Density (B/mm2)",
"shape": "Vendor:N",
Expand Down Expand Up @@ -911,18 +931,17 @@ def stripShorthand(str):
# groupby=[stripShorthand(c["color"])],
method=regression_method[c["xscale"]][c["yscale"]],
)
.mark_line(shape="mark", opacity=0.5)
.transform_fold(
["Best fit"], # these cols get packed into one field w/ ...
as_=["Regression", "y"],
), # [key, value]
.mark_line(opacity=0.5)
.transform_calculate(Fit='"LinReg"')
.encode(stroke="Fit:N"),
)
.encode(
# opacity=alt.condition(param_checkbox, alt.value(1.0), alt.value(0.05)),
alt.Color("Regression:N"),
)
.interactive()
.add_params(line_selection)
.resolve_scale(color="independent")
)

# chart = (
Expand Down

0 comments on commit 52b33a2

Please sign in to comment.