lvwerra HF staff commited on
Commit
2441f02
1 Parent(s): 9105271

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -23,7 +23,7 @@ def n_opt(C):
23
  def d_opt(C):
24
  return (1/G) * ((C/6) ** (alpha / (alpha+beta)))
25
 
26
- def get_kd(kn):
27
  frac = (A/B)*(G**(-alpha-beta))
28
  kd = (1-((kn**-alpha -1)*frac))**(1/(-beta))
29
  return kd
@@ -55,10 +55,11 @@ def compute(N, D):
55
  D_opt = d_opt(C)
56
 
57
  kn = N/N_opt
 
58
 
59
- plot_curve(kn, 100*overhead(kn, get_kd(kn)))
60
 
61
- text = f"""Compute budget (TFLOPs): {C:.2E}\nTraining compute overhead (%): {100*compute_overhead(kn, get_kd(kn)):.2f}\nInference cost fraction (%): {kn*100:.2f}"""
62
  return text
63
 
64
  with gr.Blocks() as demo:
 
23
  def d_opt(C):
24
  return (1/G) * ((C/6) ** (alpha / (alpha+beta)))
25
 
26
+ def compute_kd(kn):
27
  frac = (A/B)*(G**(-alpha-beta))
28
  kd = (1-((kn**-alpha -1)*frac))**(1/(-beta))
29
  return kd
 
55
  D_opt = d_opt(C)
56
 
57
  kn = N/N_opt
58
+ kd = compute_kd(kn)
59
 
60
+ plot_curve(kn, kd)
61
 
62
+ text = f"""Compute budget (TFLOPs): {C:.2E}\nTraining compute overhead (%): {100*compute_overhead(kn, compute_kd(kn)):.2f}\nInference cost fraction (%): {kn*100:.2f}"""
63
  return text
64
 
65
  with gr.Blocks() as demo: