Skip to content

[sgl] view could hold the memory too long and introduced large memory#19109

Merged
ispobock merged 1 commit intosgl-project:mainfrom
bixue2010:bi/fix_sch
Feb 21, 2026
Merged

[sgl] view could hold the memory too long and introduced large memory#19109
ispobock merged 1 commit intosgl-project:mainfrom
bixue2010:bi/fix_sch

Conversation

@bixue2010
Copy link
Contributor

consumption

Motivation

in current maybe_collect_customized_info, v is a batch tensor (B, ...), v[i] takes a view, and when it got put into req.customized_info, req.customized_info will be accumulated until request is finished. since v[i] takes a view, hence the memory can't be released until all the requests in the batch finished. which means this will depend on the longest running request finish to be able to release the memory.

In some situation, when we stored slightly larger info in customized_info, this could accumulate quite large memory, which introduced OOM.

Modifications

suggest to take a copy of v[i] to break the view.

Accuracy Tests

unit test.

Benchmarking and Profiling

N/A

Checklist

Review Process

  1. Ping Merge Oncalls to start the PR flow. See the PR Merge Process.
  2. Get approvals from CODEOWNERS and other reviewers.
  3. Trigger CI tests with comments or contact authorized users to do so.
    • /tag-run-ci-label, /rerun-failed-ci, /tag-and-rerun-ci
  4. After green CI and required approvals, ask Merge Oncalls to merge.

@gemini-code-assist
Copy link
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@Qiaolin-Yu
Copy link
Collaborator

/tag-and-rerun-ci

@ispobock ispobock merged commit bf36aa4 into sgl-project:main Feb 21, 2026
185 of 203 checks passed
@bixue2010 bixue2010 deleted the bi/fix_sch branch February 21, 2026 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants