noumanjavaid commited on
Commit
f02e0e7
·
verified ·
1 Parent(s): de460e4

Update app.py

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