gpu-compute: Skip LDS reservation for inactive waves - #12
Merged
Merged
Conversation
Do not reserve an LDS request when an explicit local-memory instruction has no active lanes. Such instructions bypass the local-memory pipeline, which normally releases the reservation.
Basemism
requested review from
mattsinc and
v-ramadas
and
a lite review from Copilot
September 17, 2026 10:34
There was a problem hiding this comment.
🟢 Approval recommended
The change is small, localized, and directly prevents the confirmed counter-leak path for inactive-lane local-memory instructions without altering active-lane behavior.
Pull request overview
This PR fixes a GPU compute scheduling/resource-accounting bug where a local-memory (LDS) instruction with no active lanes could still reserve LDS pipeline request resources, then get skipped before the LDS pipeline had a chance to release them—eventually triggering a panic when the wavefront is reused.
Changes:
- In
Wavefront::reserveResources(), only callreserveLmResource()for local-memory instructions whenexec_maskhas at least one active lane. - For local-memory instructions with an empty
exec_mask, avoid incrementing LDS in-pipe request counters while still returninglocalMemas the execution unit ID for scheduling bookkeeping.
File summaries
| File | Description |
|---|---|
| src/gpu-compute/wavefront.cc | Skips LDS request reservation for local-memory instructions with no active lanes to prevent leaked per-wave LDS request counters. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
mattsinc
approved these changes
Sep 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a local-memory instruction has no active lanes, gem5 skips issuing it to the LDS pipeline. However, the scheduler had already reserved an LDS request for it. That reservation is normally released by the pipeline, so it remained counted and later caused a panic when gem5 reused the wavefront.
Only reserve LDS resources when the instruction has active lanes. This leaves the existing handling for active LDS and flat-memory instructions unchanged.