Skip to content

chore: share dequant buffers in TurboQuant to save memory#1661

Merged
AlpinDale merged 1 commit into
mainfrom
chore/turboquant-optim
Apr 28, 2026
Merged

chore: share dequant buffers in TurboQuant to save memory#1661
AlpinDale merged 1 commit into
mainfrom
chore/turboquant-optim

Conversation

@AlpinDale
Copy link
Copy Markdown
Collaborator

No description provided.

Signed-off-by: AlpinDale <alpindale@gmail.com>
@AlpinDale AlpinDale merged commit b42eeec into main Apr 28, 2026
1 check failed
@AlpinDale AlpinDale deleted the chore/turboquant-optim branch April 28, 2026 09:21
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +702 to +704
k_buf, v_buf = current_workspace_manager().get_simultaneous(
(buf_shape, torch.float16),
(buf_shape, torch.float16),
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

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