noumanjavaid commited on
Commit
9f21f70
1 Parent(s): a641296

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +58 -0
app.py ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ import pandas as pd
3
+
4
+ def calculate_cost(num_pairs, gpu_type):
5
+ if gpu_type == "Nvidia A100":
6
+ daily_rate = 28
7
+ time_per_pair = 1 # minute
8
+ elif gpu_type == "H100 80GB PCIe":
9
+ daily_rate = 78.96
10
+ time_per_pair = 0.5 # assuming it's twice as fast
11
+ else: # AWS p4d.24xlarge
12
+ daily_rate = 786.48
13
+ time_per_pair = 0.25 # assuming it's four times as fast due to 8 GPUs
14
+
15
+ total_time_minutes = num_pairs * time_per_pair
16
+ total_time_hours = total_time_minutes / 60
17
+ hourly_rate = daily_rate / 24
18
+ total_cost = total_time_hours * hourly_rate
19
+
20
+ return total_cost
21
+
22
+ st.set_page_config(page_title="GPU Cost Calculator", page_icon="🧮", layout="wide")
23
+
24
+ st.title("GPU Cost Calculator")
25
+
26
+ # Input for number of pairs
27
+ num_pairs = st.number_input("Enter the number of pairs to process:", min_value=1, value=5)
28
+
29
+ # Select GPU type
30
+ gpu_type = st.selectbox(
31
+ "Select GPU type:",
32
+ ("Nvidia A100", "H100 80GB PCIe", "AWS p4d.24xlarge (8x A100)")
33
+ )
34
+
35
+ # Calculate button
36
+ if st.button("Calculate Cost"):
37
+ cost = calculate_cost(num_pairs, gpu_type)
38
+ st.write(f"Estimated cost for processing {num_pairs} pairs on {gpu_type}: ${cost:.4f}")
39
+
40
+ # Display GPU information
41
+ st.subheader("GPU Information")
42
+ gpu_data = {
43
+ "Provider": ["H100 80GB PCIe", "AWS (p4d.24xlarge)", "GPU Mart"],
44
+ "GPU": ["Nvidia H100", "Nvidia A100 (8 GPUs)", "Nvidia A100"],
45
+ "vCPUs": [16, 96, "Dual 18-Core E5-2697v4"],
46
+ "RAM": ["125 GB", "1152 GiB", "256 GB"],
47
+ "GPU Memory": ["80 GB", "320 GB (8 x 40 GB)", "40 GB HBM2e"],
48
+ "Instance Storage": ["Network Storage: 10Pb+", "8 x 1000 GB NVMe SSD", "240 GB SSD + 2TB NVMe + 8TB SATA"],
49
+ "Network Bandwidth": ["Not Specified", "400 Gbps", "100Mbps - 1Gbps"],
50
+ "On-Demand Price/hr": ["$3.29", "$32.77", "N/A"],
51
+ "Daily Price": ["$78.96", "$786.48", "$28.00"],
52
+ "Monthly Price": ["$2,368.80", "$23,594.40", "$799.00"],
53
+ "1-Year Reserved (Hourly)": ["N/A", "$19.22", "N/A"],
54
+ "3-Year Reserved (Hourly)": ["N/A", "$11.57", "N/A"]
55
+ }
56
+
57
+ df = pd.DataFrame(gpu_data)
58
+ st.table(df)