Skip to content

Commit

Permalink
Pre-Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Tejas Ramesh committed Mar 28, 2024
1 parent a2f2d89 commit dd1482b
Showing 1 changed file with 23 additions and 22 deletions.
45 changes: 23 additions & 22 deletions triton_viz/tooltip.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
tooltip_descriptions = {
'Grid Size': 'Indicates the grid size used in the kernel launch.',
'BinaryOp': 'Shows the total number of binary operations performed in this kernel.',
'MakeRange': 'Shows the total number of arange operations performed in this kernel.',
'Load': 'Shows the total number of load operations performed in this kernel.',
'Store': 'Shows the total number of store operations performed in this kernel.',
'ExpandDims': 'Shows the total number of expand_dims operations performed in this kernel.',
'Dot': 'Shows the total number of dot operations performed in this kernel.',
'Reduce': 'Shows the total number of reduce operations performed in this kernel.',
'Total number of bytes loaded': 'Shows the total number of bytes loaded (mask=True).Note:On GPUs, this metric does not equate to the total number of bytes loaded from global memory (DRAM), as some data accesses may be handled through GPU caches.',
'Masked Load Ratio': 'Ratio of total number of bytes loaded (mask=True)/total number of bytes loaded (mask=True) + (mask=False).',
'Total number of bytes stored': 'Shows the total number of bytes stored (mask=True).',
'Masked Store Ratio': 'Ratio of total number of bytes stored (mask=True)/total number of bytes stored (mask=True) + (mask=False).'

"Grid Size": "Indicates the grid size used in the kernel launch.",
"BinaryOp": "Shows the total number of binary operations performed in this kernel.",
"MakeRange": "Shows the total number of arange operations performed in this kernel.",
"Load": "Shows the total number of load operations performed in this kernel.",
"Store": "Shows the total number of store operations performed in this kernel.",
"ExpandDims": "Shows the total number of expand_dims operations performed in this kernel.",
"Dot": "Shows the total number of dot operations performed in this kernel.",
"Reduce": "Shows the total number of reduce operations performed in this kernel.",
"Total number of bytes loaded": "Shows the total number of bytes loaded (mask=True).Note:On GPUs, this metric does not equate to the total number of bytes loaded from global memory (DRAM), as some data accesses may be handled through GPU caches.",
"Masked Load Ratio": "Ratio of total number of bytes loaded (mask=True)/total number of bytes loaded (mask=True) + (mask=False).",
"Total number of bytes stored": "Shows the total number of bytes stored (mask=True).",
"Masked Store Ratio": "Ratio of total number of bytes stored (mask=True)/total number of bytes stored (mask=True) + (mask=False).",
}


def create_tooltip(df):
styles = """
<style>
Expand Down Expand Up @@ -60,18 +60,19 @@ def create_tooltip(df):
}
</style>
"""

html = styles + '<table class="dataframe"><thead><tr>'
for col in df.columns:
html += f'<th>{col}</th>'
html += '</tr></thead><tbody>'
html += f"<th>{col}</th>"
html += "</tr></thead><tbody>"

for index, row in df.iterrows():
tooltip_text = tooltip_descriptions.get(row['Metric'], "No description available.")
tooltip_text = tooltip_descriptions.get(
row["Metric"], "No description available."
)
html += f'<tr><td class="tooltip">{row["Metric"]}<span class="tooltiptext">{tooltip_text}</span></td>'
html += f'<td>{row["Value"]}</td></tr>'

html += '</tbody></table>'

return html

html += "</tbody></table>"

return html

0 comments on commit dd1482b

Please sign in to comment.