Skip to content

Impl vit - #5

Open
sufubao wants to merge 20 commits into
mainfrom
impl_vit
Open

Impl vit#5
sufubao wants to merge 20 commits into
mainfrom
impl_vit

Conversation

@sufubao

@sufubao sufubao commented Jun 23, 2026

Copy link
Copy Markdown
Owner

No description provided.

sufubao added 20 commits June 21, 2026 22:11
Add QwenVLWorstCaseMixin as first base class in all three Qwen VL visual
transformer classes so the worst-case activation reservation API is available.

Also make model_infer/__init__.py imports of VisualModelRpcServer and
VisualModelRpcClient lazy (inside function bodies) to break the circular
import that arose: qwen2_visual -> worst_case_reserve -> model_infer/__init__
-> model_rpc -> qwen2_visual.
… cap

Codex finding: the square floor (isqrt then floor to a merge-unit multiple) built
180x180=32400 patches for the default caps, under the 32768-patch (8192 merged-token)
cap, so the startup probe could under-reserve vs the largest valid request. Round the
square side up so total patches >= the binding cap (an upper bound, never an undershoot).
…erved

Codex finding: reset_peak_memory_stats ran after weights were on the GPU, so
max_memory_reserved() returned weights+activation. The published SharedInt value and the
[mem] log / fail-fast hint said 'activation memory' but included ViT weights (e.g. InternViT-6B
made InternVL report 12.59 GB when the activation is ~1.8 GB). Capture the reserved baseline
before the dummy forward and return peak-baseline. The physical hold is unchanged (still no
empty_cache), so pool sizing is unaffected; only the diagnostic is now accurate.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant