ybaddam8 commited on
Commit
4d93678
·
verified ·
1 Parent(s): 2de29b0

Sync with 26167@5f34e0e: VQA duration from measured timings

Browse files
Files changed (2) hide show
  1. README.md +1 -1
  2. app.py +6 -3
README.md CHANGED
@@ -33,7 +33,7 @@ settings only; this README deliberately has no `hardware` line.
33
  - Device is `cuda` if `torch.cuda.is_available()`, otherwise `cpu`. InternVL uses bf16 on cuda
34
  and fp32 on CPU.
35
  - `vqa_ground` is decorated with `@spaces.GPU(duration=VQA_GPU_DURATION_S)`. It's a no-op off
36
- ZeroGPU. `VQA_GPU_DURATION_S` in `app.py` is a **placeholder** until measured on this Space.
37
  - BIT always runs on CPU (small, and keeps parity with the local path). `change_detect` holds
38
  no GPU allocation.
39
  - Models load once at module level (`low_cpu_mem_usage=True`),
 
33
  - Device is `cuda` if `torch.cuda.is_available()`, otherwise `cpu`. InternVL uses bf16 on cuda
34
  and fp32 on CPU.
35
  - `vqa_ground` is decorated with `@spaces.GPU(duration=VQA_GPU_DURATION_S)`. It's a no-op off
36
+ ZeroGPU. `VQA_GPU_DURATION_S` in `app.py` is 125 s, the measured CPU worst case (see the comment there). It's an upper bound for ZeroGPU; re-measure after switching hardware.
37
  - BIT always runs on CPU (small, and keeps parity with the local path). `change_detect` holds
38
  no GPU allocation.
39
  - Models load once at module level (`low_cpu_mem_usage=True`),
app.py CHANGED
@@ -40,9 +40,12 @@ WEIGHTS_REVISION = os.environ.get("WEIGHTS_REVISION", "main")
40
  EXPECTED_ADAPTER_SHA256 = "796d3c25d883d7798c3d7634f855c86f5ae2c0107922c7d5d80f216298dde405"
41
  EXPECTED_BIT_SHA256 = "c159ba76143447f58c9f367ce8126a0014f2e4ba218cdb97cca173952c38cb3b"
42
 
43
- # PLACEHOLDER: set from the first measured Space timings before switching to ZeroGPU.
44
- # No-op on CPU Basic; on ZeroGPU it caps each call's GPU allocation.
45
- VQA_GPU_DURATION_S = 120
 
 
 
46
 
47
  torch.set_num_threads(os.cpu_count() or 1)
48
 
 
40
  EXPECTED_ADAPTER_SHA256 = "796d3c25d883d7798c3d7634f855c86f5ae2c0107922c7d5d80f216298dde405"
41
  EXPECTED_BIT_SHA256 = "c159ba76143447f58c9f367ce8126a0014f2e4ba218cdb97cca173952c38cb3b"
42
 
43
+ # Measured on this Space (cpu-upgrade, fp32, MAX_NEW_TOKENS=128, 2026-09-25): a spatial
44
+ # question (answer + grounding + bbox passes) took 121.1 s and 117.6 s in-Space; a
45
+ # non-spatial one (two passes) 42.3 s and 41.7 s. 125 s covers the measured worst case.
46
+ # These are CPU times, so on ZeroGPU they are an upper bound: re-measure there and lower it.
47
+ # No-op off ZeroGPU; on ZeroGPU it caps each call's GPU allocation.
48
+ VQA_GPU_DURATION_S = 125
49
 
50
  torch.set_num_threads(os.cpu_count() or 1)
51