You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Browse filesBrowse the repository at this point in the historyBrowse files
committed
Phase A step 1: kill 2 syncs/forward in model LVM heads + EOS cache
Cherry-picked from upstream PR UCSB-AI#3 (namezhenzhang):
* lvm_value_utils.get_eos_token_ids: cache result on req._lvm_eos_token_ids;
was re-walking sets every candidate filter call.
* qwen2_lvm.py / qwen3_lvm.py / qwen2_5_vl_lvm.py: drop two
forward_batch.{extend_seq_lens,extend_prefix_lens}.tolist() calls per
LVM forward by carrying tree_value_cached_prefix_lens in the
TreeValueSpecInput. With ~1300 LVM forwards in the paper run, that
removes ~2600 GPU->CPU syncs.
* tree_value_spec.py: vectorize the candidate self-attention diagonal
using numpy fancy indexing instead of a per-token Python loop.
No algorithm change; same forward outputs.
Co-Authored-By: Zhen Zhang <namezhenzhang@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments