chore: share dequant buffers in TurboQuant to save memory#1661
Conversation
Signed-off-by: AlpinDale <alpindale@gmail.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 556b30deb7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| k_buf, v_buf = current_workspace_manager().get_simultaneous( | ||
| (buf_shape, torch.float16), | ||
| (buf_shape, torch.float16), |
There was a problem hiding this comment.
Prevent workspace-locked allocation in continuation prefill
This new allocation path sizes dequant buffers from cached_len on every large continuation (q_len > 128), but CUDA-graph mode locks the workspace after warmup/capture (gpu_model_runner.py calls lock_workspace()), so later long-context continuations can request a larger buffer than was profiled and crash with AssertionError from WorkspaceManager._ensure_workspace_size. Because cached_len can grow with request context length (up to model max context) while warmup typically profiles up to batched token limits, this introduces a runtime failure for long prompts that did not exist with the previous per-layer growable buffers.
Useful? React with 👍 / 👎.
No description provided.