Skip to content

gpu-compute: Skip LDS reservation for inactive waves - #12

Merged
mattsinc merged 1 commit into
stagingfrom
staging-basem/fix-inactive-lds-counter
Sep 17, 2026
Merged

mattsinc merged 1 commit into
stagingfrom
staging-basem/fix-inactive-lds-counter

Conversation

@Basemism

Copy link
Copy Markdown

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.

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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 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 call reserveLmResource() for local-memory instructions when exec_mask has at least one active lane.
  • For local-memory instructions with an empty exec_mask, avoid incrementing LDS in-pipe request counters while still returning localMem as 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
mattsinc requested a review from abmerop September 17, 2026 23:12
@mattsinc
mattsinc merged commit 38a11a4 into staging Sep 17, 2026
1 check passed
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.

3 participants