eac123 commited on
Commit
ee7fc50
·
verified ·
1 Parent(s): 0cdf651

budget summary handles aligned spec

Browse files
Files changed (1) hide show
  1. ptr/flops.py +2 -2
ptr/flops.py CHANGED
@@ -35,12 +35,12 @@ def step_flops(model, S, batch, n_iters, training=True):
35
 
36
  def flops_budget_summary(model, S, batch, n_iters, steps):
37
  """Total training FLOPs for one run, plus params. `n_iters` may be an int
38
- or ('dynamic', lo, hi) for per-batch sampled unrolls (mean used)."""
39
  p = count_params(model)
40
  if isinstance(n_iters, tuple):
41
  lo, hi = n_iters[1], n_iters[2]
42
  mean_iters = (lo + hi) / 2.0
43
- desc = f"dynamic U{{{lo}..{hi}}}"
44
  else:
45
  mean_iters = n_iters
46
  desc = str(n_iters)
 
35
 
36
  def flops_budget_summary(model, S, batch, n_iters, steps):
37
  """Total training FLOPs for one run, plus params. `n_iters` may be an int
38
+ or a (mode, lo, hi) tuple for per-batch sampled unrolls (mean used)."""
39
  p = count_params(model)
40
  if isinstance(n_iters, tuple):
41
  lo, hi = n_iters[1], n_iters[2]
42
  mean_iters = (lo + hi) / 2.0
43
+ desc = f"{n_iters[0]} U{{{lo}..{hi}}}"
44
  else:
45
  mean_iters = n_iters
46
  desc = str(n_iters)