waveshaker commited on
Commit
bc8fffc
·
verified ·
1 Parent(s): 23689c1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -8
app.py CHANGED
@@ -102,7 +102,7 @@ WARMUP_EPOCH_FILE = "/tmp/warmup_epoch.txt"
102
  WARMUP_LAST_FILE = str(ROOT / ".warmup_last.json")
103
  WARMUP_PRE_GPU_BUDGET = 8.0 # 申请 GPU 前最多等多久(覆盖"已经很接近完成")
104
  WARMUP_RESIDUAL_WAIT = 5.0 # GPU 内残余等待上限(烧 GPU 预算,务必小)
105
- SYNC_ON_BOOT = True # 启动时是否 os.sync(默认关:只刷脏页,不预热)
106
 
107
  # ==========================================================================
108
  # 🧠 Global Runtime State
@@ -1108,8 +1108,8 @@ def _generate_impl(
1108
  _current_generation_task_id.set(task_id)
1109
 
1110
  # 疑似bug
1111
- #_warm_wait_in_gpu(unet_choice)
1112
-
1113
  # global _previous_arch_for_gc
1114
 
1115
  print(f"[Token探针] task={task_id} | token_present={bool(LocalContext.request.get(None) and LocalContext.request.get(None).headers.get('x-ip-token'))}", flush=True)
@@ -1605,10 +1605,11 @@ class WarmupManager:
1605
  with self._lock:
1606
  plan = self._plan
1607
  self._plan = None
1608
- if plan is None and self._resume:
1609
- plan, self._resume = self._resume, None
1610
- self._seq += 1
1611
- plan = {**plan, "seq": self._seq}
 
1612
  self._active = plan
1613
  if plan is None:
1614
  time.sleep(0.2)
@@ -1849,7 +1850,8 @@ def _boot_warmup():
1849
  break
1850
  time.sleep(0.2)
1851
 
1852
- warmup.request_sweep(reason="boot_sweep")
 
1853
 
1854
  # ==========================================================================
1855
  # 🌐 FastAPI & API Routes
 
102
  WARMUP_LAST_FILE = str(ROOT / ".warmup_last.json")
103
  WARMUP_PRE_GPU_BUDGET = 8.0 # 申请 GPU 前最多等多久(覆盖"已经很接近完成")
104
  WARMUP_RESIDUAL_WAIT = 5.0 # GPU 内残余等待上限(烧 GPU 预算,务必小)
105
+ SYNC_ON_BOOT = False # 启动时是否 os.sync(默认关:只刷脏页,不预热)
106
 
107
  # ==========================================================================
108
  # 🧠 Global Runtime State
 
1108
  _current_generation_task_id.set(task_id)
1109
 
1110
  # 疑似bug
1111
+ # _warm_wait_in_gpu(unet_choice)
1112
+
1113
  # global _previous_arch_for_gc
1114
 
1115
  print(f"[Token探针] task={task_id} | token_present={bool(LocalContext.request.get(None) and LocalContext.request.get(None).headers.get('x-ip-token'))}", flush=True)
 
1605
  with self._lock:
1606
  plan = self._plan
1607
  self._plan = None
1608
+ # 疑似bug
1609
+ # if plan is None and self._resume:
1610
+ # plan, self._resume = self._resume, None
1611
+ # self._seq += 1
1612
+ # plan = {**plan, "seq": self._seq}
1613
  self._active = plan
1614
  if plan is None:
1615
  time.sleep(0.2)
 
1850
  break
1851
  time.sleep(0.2)
1852
 
1853
+ # 疑似bug
1854
+ # warmup.request_sweep(reason="boot_sweep")
1855
 
1856
  # ==========================================================================
1857
  # 🌐 FastAPI & API Routes