observantdistressed commited on
Commit
abc01d9
·
verified ·
1 Parent(s): f45e1e9

Remove _TURBO_MERGE_BONUS from get_duration: the turbo merge is instant, the 120s bonus inflated the duration reservation

Browse files
Files changed (1) hide show
  1. app.py +1 -5
app.py CHANGED
@@ -1408,8 +1408,6 @@ _DUR_B, _DUR_C = 1.1745e-4, 3.8396e-9
1408
  _DECODE_BASE, _DECODE_PER_DEFAULT_CANVAS, _DEFAULT_CANVAS_PIXELS = 15, 15, 960 * 544 * 124
1409
  # `pack` mode: only the ~10 GB of VAEs move on a cold worker.
1410
  _PLACEMENT_ALLOWANCE, _PAD = 12, 10
1411
- # First turbo merge transfers ~1.2 GB of LoRA A/B factors CPU→CUDA inside @spaces.GPU; budget extra time.
1412
- _TURBO_MERGE_BONUS = 120
1413
 
1414
 
1415
  def get_duration(prompt_embeds, text_token_tags, image, last_image, height, width, num_frames, steps, seed, *a, **k):
@@ -1419,9 +1417,7 @@ def get_duration(prompt_embeds, text_token_tags, image, last_image, height, widt
1419
  rows = latent_frames * patches + (int(image is not None) + int(last_image is not None)) * patches
1420
  denoise = steps * (_DUR_B * rows + _DUR_C * rows**2)
1421
  decode = _DECODE_BASE + _DECODE_PER_DEFAULT_CANVAS * (height * width * num_frames) / _DEFAULT_CANVAS_PIXELS
1422
- # First turbo merge transfers ~1.2 GB of LoRA A/B factors CPU→CUDA inside @spaces.GPU.
1423
- turbo_bonus = _TURBO_MERGE_BONUS if k.get("turbo") and TURBO_AVAILABLE and not _TURBO_merged else 0
1424
- return max(60, int(denoise + decode) + _PLACEMENT_ALLOWANCE + _PAD + turbo_bonus)
1425
 
1426
 
1427
  @spaces.GPU(duration=get_duration, size=GPU_SIZE)
 
1408
  _DECODE_BASE, _DECODE_PER_DEFAULT_CANVAS, _DEFAULT_CANVAS_PIXELS = 15, 15, 960 * 544 * 124
1409
  # `pack` mode: only the ~10 GB of VAEs move on a cold worker.
1410
  _PLACEMENT_ALLOWANCE, _PAD = 12, 10
 
 
1411
 
1412
 
1413
  def get_duration(prompt_embeds, text_token_tags, image, last_image, height, width, num_frames, steps, seed, *a, **k):
 
1417
  rows = latent_frames * patches + (int(image is not None) + int(last_image is not None)) * patches
1418
  denoise = steps * (_DUR_B * rows + _DUR_C * rows**2)
1419
  decode = _DECODE_BASE + _DECODE_PER_DEFAULT_CANVAS * (height * width * num_frames) / _DEFAULT_CANVAS_PIXELS
1420
+ return max(60, int(denoise + decode) + _PLACEMENT_ALLOWANCE + _PAD)
 
 
1421
 
1422
 
1423
  @spaces.GPU(duration=get_duration, size=GPU_SIZE)