BoHuangLab commited on
Commit
10b2d78
·
verified ·
1 Parent(s): f2dfd29

ZeroGPU duration 75 s: ~2x a measured run, two anonymous runs a day

Browse files
Files changed (2) hide show
  1. README.md +6 -4
  2. app.py +6 -4
README.md CHANGED
@@ -156,11 +156,13 @@ The fixed settings — 512 images at 100 ODE steps — take **~85 s on an A40**
156
  scales linearly in both, so a section that needs to be faster should lower them in
157
  `pipeline.py` (`NUM_IMAGES`, `NUM_STEPS`).
158
 
159
- On ZeroGPU the per-call budget is set by `ZEROGPU_DURATION` (default 120 s). Keep it
160
  close to what a run needs: `spaces` requests 1.5× it on the default GPU size, and ZeroGPU
161
- refuses any request above the visitor's allowance before running anything — at 300 s
162
- (450 s requested) every visitor without PRO was turned away with "The requested GPU
163
- duration (450s) is larger than the maximum allowed".
 
 
164
 
165
  ---
166
 
 
156
  scales linearly in both, so a section that needs to be faster should lower them in
157
  `pipeline.py` (`NUM_IMAGES`, `NUM_STEPS`).
158
 
159
+ On ZeroGPU the per-call budget is set by `ZEROGPU_DURATION` (default 75 s). Keep it
160
  close to what a run needs: `spaces` requests 1.5× it on the default GPU size, and ZeroGPU
161
+ admits a run only when the visitor's remaining daily quota covers the whole request, while
162
+ charging only the time used. A titration takes ~56 s on ZeroGPU (measured 2026-10-16), so
163
+ 75 s requests ~113 s — twice the run, and two runs a day on an anonymous visitor's ~180 s;
164
+ signed-in visitors get more. At 300 s (450 s requested) every visitor without PRO was
165
+ turned away with "The requested GPU duration (450s) is larger than the maximum allowed".
166
 
167
  ---
168
 
app.py CHANGED
@@ -46,10 +46,12 @@ except Exception as exc: # never let the shim take the app down
46
  try:
47
  import spaces
48
 
49
- # What a run needs, not a safe-looking maximum: spaces requests 1.5x this (the 'large' GPU
50
- # size), and ZeroGPU refuses outright any request above the visitor's allowance -- at 300 s
51
- # (450 s requested) every visitor without PRO got "larger than the maximum allowed".
52
- GPU_DECORATOR = spaces.GPU(duration=int(os.environ.get("ZEROGPU_DURATION", "120")))
 
 
53
  except Exception: # running locally or on a dedicated GPU
54
  def GPU_DECORATOR(fn):
55
  return fn
 
46
  try:
47
  import spaces
48
 
49
+ # What a run needs, not a safe-looking maximum. spaces requests 1.5x this (the 'large' GPU
50
+ # size), and ZeroGPU admits a run only if the visitor's remaining daily quota covers the whole
51
+ # request, though it charges only the time used. A titration takes ~56 s on ZeroGPU
52
+ # (2026-10-16), so 75 s requests ~113 s: twice that, and two runs a day on an anonymous
53
+ # visitor's ~180 s. At 300 s (450 s requested) every visitor without PRO was refused.
54
+ GPU_DECORATOR = spaces.GPU(duration=int(os.environ.get("ZEROGPU_DURATION", "75")))
55
  except Exception: # running locally or on a dedicated GPU
56
  def GPU_DECORATOR(fn):
57
  return fn