Skip to content

Instantly share code, notes, and snippets.

@ResidentMario
Created June 10, 2020 20:34
Show Gist options
  • Save ResidentMario/a33012a20df92d52144e9504df3fb5bc to your computer and use it in GitHub Desktop.
Save ResidentMario/a33012a20df92d52144e9504df3fb5bc to your computer and use it in GitHub Desktop.
from rich.console import Console
from rich.table import Column, Table
console = Console()
table = Table(show_header=True, header_style="bold magenta")
table.add_column("Model")
table.add_column("GPU", justify="right")
table.add_column("💾 (w/o MP)", justify="right")
table.add_column("💾 (w/ MP)", justify="right")
table.add_column("%Δ", justify="center")
table.add_row(
"Feedforward", "V100", "1.19 GB", "1.19 GB", "-"
)
table.add_row(
"", "T4", "0.932 GB", "0.936 GB", "-"
)
table.add_row(
"UNet", "V100", "4.33 GB", "[bold]3.71 GB[/bold]", "-14%"
)
table.add_row(
"", "T4", "4.26 GB", "[bold]2.67 GB[/bold]", "-37%"
)
table.add_row(
"BERT", "V100", "9.62 GB", "[bold]8.76 GB[/bold]", "-9%"
)
table.add_row(
"", "T4", "9.35 GB", "[bold]8.49 GB[/bold]", "-9%"
)
console.print(table)
from rich.console import Console
from rich.table import Column, Table
console = Console()
table = Table(show_header=True, header_style="bold magenta")
table.add_column("Model")
table.add_column("GPU", justify="right")
table.add_column("💸 (w/o MP)", justify="right")
table.add_column("💸 (w/ MP)", justify="right")
table.add_column("🏦", justify="center")
table.add_row(
"Feedforward", "V100", "$0.15", "$0.17", "[red]-$0.02[/red]"
)
table.add_row(
"", "T4", "$0.02", "$0.02", "-"
)
table.add_row(
"UNet", "V100", "$0.13", "$0.12", "[green]+$0.01[/green]"
)
table.add_row(
"", "T4", "$0.03", "$0.02", "[green]+$0.01[/green]"
)
table.add_row(
"BERT", "V100", "$0.27", "$0.12", "[green]+$0.15[/green]"
)
table.add_row(
"", "T4", "$0.15", "$0.05", "[green]+$0.10[/green]"
)
console.print(table)
from rich.console import Console
from rich.table import Column, Table
console = Console()
table = Table(show_header=True, header_style="bold magenta")
table.add_column("Model")
table.add_column("GPU", justify="right")
table.add_column("🕐 (w/o MP)", justify="right")
table.add_column("🕐 (w/ MP)", justify="right")
table.add_column("%Δ", justify="center")
table.add_row(
"Feedforward", "V100", "10m 10s", "10m 55s", "+7%"
)
table.add_row(
"", "T4", "8m 43s", "8m 39s", "-1%"
)
table.add_row(
"UNet", "V100", "8m 25s", "[bold]7m 58s[/bold]", "-5%"
)
table.add_row(
"", "T4", "13m 7s", "[bold]9m 14s[/bold]", "-30%"
)
table.add_row(
"BERT", "V100", "17m 38s", "[bold]8m 10s[/bold]", "-53%"
)
table.add_row(
"", "T4", "55m 17s", "[bold]20m 27s[/bold]", "-63%"
)
console.print(table)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment