Skip to content

Drop VGPR count patch revert - #2505

Closed
superm1 wants to merge 1 commit into
ROCm:mainfrom
superm1:superm1/less-reverty
Closed

superm1 wants to merge 1 commit into
ROCm:mainfrom
superm1:superm1/less-reverty

Conversation

@superm1

@superm1 superm1 commented Dec 10, 2025

Copy link
Copy Markdown

We need the definition for other code. Just revert the VGPR size bump.

@jayhawk-commits

Copy link
Copy Markdown
Contributor

Will approve after I get a chance to look at CI logs that the patch applies cleanly on both OS.

@superm1

superm1 commented Dec 10, 2025

Copy link
Copy Markdown
Author

Is that CI failure real? I can't see how it could possibly be.

@jayhawk-commits

Copy link
Copy Markdown
Contributor

A hipcc_check failure was the test that led to me creating the original revert patch, as HIP runtime was failing on the kernel launch on Linux Strix Halo. This error messaging is different from that. A timeout without any previous logs on the different HIP calls is concerning.

@superm1

superm1 commented Dec 10, 2025

Copy link
Copy Markdown
Author

A hipcc_check failure was the test that led to me creating the original revert patch, as HIP runtime was failing on the kernel launch on Linux Strix Halo. This error messaging is different from that. A timeout without any previous logs on the different HIP calls is concerning.

Well the original commit fixed random failures that occurred with workloads that did context switches. But it was predicated on a kernel change being present to work.

It wasn't a 100% failure rate, but it was enough to notice.

Could you trigger that CI job again and see what happens?

@jayhawk-commits

Copy link
Copy Markdown
Contributor

I triggered the test job again and it timed out again.

@jayhawk-commits jayhawk-commits left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Changing review status due to test failure

@superm1

superm1 commented Dec 10, 2025

Copy link
Copy Markdown
Author

The CI failure looked like it's started at 10801ec. I've rebased the branch once more to confirm.
I've also made a draft PR that reverts that commit to check:
#2516

Comment on lines 4 to 7
Subject: [PATCH] Revert "hsakmt: bump vgpr count for gfx1151 (#1807)"

This reverts commit 770f30bc4c72d763742e39932e2c0583813d531f.
This reverts part of commit 770f30bc4c72d763742e39932e2c0583813d531f.
---

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If we proceed with this PR or not, this patch needs more information in the commit message.

Why did we revert the commit? What issues did it cause? Why are we carrying the revert via a patch instead of landing the revert in rocm-systems?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

For this ask, the information provided in #2338's description can be leveraged, plus more specifics on the kernel patch not released yet.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I'll update the description. But I want to be very clear - the kernel patch is released. It's upstream in the 6.18 kernel and already in stable and LTS kernels. The decision to carry this patch is because the downstream Ubuntu kernel that is used for CI doesn't have it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The story here isn't adding up for me, so we're going to need to dig in deeper (cc @stellaraccident). From that PR:

In order to not disrupt the next ROCm legacy release and kernel driver release, revert above using a patch that will live on TheRock until the corresponding KFD patch is released and usable on test runners.

We don't evaluate commits or patches based on what kernel drivers are installed on test runners used in a particular repository. We evaluate them based on what our support policy requires, and CI/CD runners are one way that we test that our support policies are satisfied. I don't have a link to those policies on hand (we should absolutely add that to the open source documentation), but any user-space dependency on kernel patches must be carefully rolled out as user-space software (ROCm) is distributed separately from kernel drivers.

In the context of this patch that reverts that commit, what I'm wondering is:

  • What does that commit do and why does reverting help in TheRock? The PR description was just "GFX1151 has 1.5x VGPR memory compared to the rest of GFX11."
  • If reverting helps us in TheRock, why are we not reverting in rocm-systems?
  • Is a fix possible that will make the changes compatible with all supported kernels/drivers (e.g. N, N-1, N-2)? Is that fix in progress?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Yes Stella met with me and several other people and that's how we landed on this policy. Our plan is that newer kernels the kernel exports source of truth (using cwsr and ctl stack size in sysfs) and rocr-runtime will use that to calculate VGPR size.

Is a fix possible that will make the changes compatible with all supported kernels/drivers (e.g. N, N-1, N-2)? Is that fix in progress?

Older kernels with non-legacy release will have wrong VGPR value. There will be a stability problem but it works for workloads that don't need a context switch. We brainstormed creative ideas, but couldn't come up with one for older kernels because the kernel enforces the size.

If reverting helps us in TheRock, why are we not reverting in rocm-systems?

Good point. I think it went into rocm-systems so that it could backport to 7.2. Based upon the policy discussion I could see an argument to revert there too. I'm not sure how we accomplish that though given this patch is in the TheRock already. It feels like a chicken and egg problem - no?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The revert of the VGPR change can happen in rocm-systems, with that same PR removing the patch from TheRock in the workflow yml files. This can happen first. Was it decided that this change will not make it to 7.2?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Here's an attempt at reverting it in rocm-systems. I'm worried how TheRock handles this though, I expect the build probably fails because of that chicken-egg problem.

ROCm/rocm-systems#2268

If that's the case I think we should merge this PR to TheROck, then that one to rocm-systems and then a 3rd to drop this patch file all together in TheRock.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the context. This is sounding good to me. I'd like to get enough of this sort of discussion in commit messages and PR descriptions too, so others watching the development activities can understand what is going on as well.

Based upon the policy discussion I could see an argument to revert there too. I'm not sure how we accomplish that though given this patch is in the TheRock already. It feels like a chicken and egg problem - no?

The revert of the VGPR change can happen in rocm-systems, with that same PR removing the patch from TheRock in the workflow yml files.

Yep. I'm adding some docs for how the patches are managed in #2517. See these sections:

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

The change is in 7.2 - very specifically because the documentation ensures the proper kernel is loaded.

@superm1
superm1 force-pushed the superm1/less-reverty branch from 183c0b6 to 56b3058 Compare December 11, 2025 01:18
superm1 added a commit to superm1/rocm-systems that referenced this pull request Dec 11, 2025
Although the value is correct; there is no source of truth between
kernel and userspace.  This leads to problems if the kernel has strict
restrictions (such as kernel 6.17 or earlier). The restrictions were
lifted in 6.17.9 and and 6.18, but there is no guarantee userspace is
using this.

So short term this value will be wrong.  But on newer kernels the kernel
will communicate the right size and rocr-runtime will be adjusted to
use that.

Link: ROCm/TheRock#2505
Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
superm1 added a commit to ROCm/rocm-systems that referenced this pull request Dec 11, 2025
Although the value is correct; there is no source of truth between
kernel and userspace.  This leads to problems if the kernel has strict
restrictions (such as kernel 6.17 or earlier). The restrictions were
lifted in 6.17.9 and and 6.18, but there is no guarantee userspace is
using this.

So short term this value will be wrong.  But on newer kernels the kernel
will communicate the right size and rocr-runtime will be adjusted to
use that.

Link: ROCm/TheRock#2505

Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
systems-assistant Bot pushed a commit to ROCm/ROCR-Runtime that referenced this pull request Dec 11, 2025
Although the value is correct; there is no source of truth between
kernel and userspace.  This leads to problems if the kernel has strict
restrictions (such as kernel 6.17 or earlier). The restrictions were
lifted in 6.17.9 and and 6.18, but there is no guarantee userspace is
using this.

So short term this value will be wrong.  But on newer kernels the kernel
will communicate the right size and rocr-runtime will be adjusted to
use that.

Link: ROCm/TheRock#2505

Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
[rocm-systems] ROCm/rocm-systems#2268 (commit 0c4d08f)
@superm1

superm1 commented Dec 11, 2025

Copy link
Copy Markdown
Author

OK so with ROCm/rocm-systems#2268 merged, I think that once TheRock gets the next rocm-systems submodule bump we can drop the patch I was touching here.

The patch was reverted in rocm-systems and is no longer necessary in
TheRock.

Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
@superm1
superm1 force-pushed the superm1/less-reverty branch from 56b3058 to cdafc59 Compare December 13, 2025 05:32
@superm1
superm1 requested a review from marbre as a code owner December 13, 2025 05:32
@superm1 superm1 changed the title Revert less of the VGPR count bump patch. Drop VGPR count patch revert Dec 13, 2025

@ScottTodd ScottTodd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We get test failures just dropping the patch on its own: https://github.com/ROCm/TheRock/actions/runs/20187543773/job/57962204079?pr=2505

We'll drop the patch when we bump rocm-systems, like on #2533.

@superm1

superm1 commented Dec 15, 2025

Copy link
Copy Markdown
Author

We get test failures just dropping the patch on its own: https://github.com/ROCm/TheRock/actions/runs/20187543773/job/57962204079?pr=2505

We'll drop the patch when we bump rocm-systems, like on #2533.

OK, I'll just close and we can track that happening in #2533.

@superm1 superm1 closed this Dec 15, 2025
@github-project-automation github-project-automation Bot moved this from TODO to Done in TheRock Triage Dec 15, 2025
@superm1
superm1 deleted the superm1/less-reverty branch December 15, 2025 16:03
xuchen-amd pushed a commit to ROCm/rocm-systems that referenced this pull request Dec 16, 2025
Although the value is correct; there is no source of truth between
kernel and userspace.  This leads to problems if the kernel has strict
restrictions (such as kernel 6.17 or earlier). The restrictions were
lifted in 6.17.9 and and 6.18, but there is no guarantee userspace is
using this.

So short term this value will be wrong.  But on newer kernels the kernel
will communicate the right size and rocr-runtime will be adjusted to
use that.

Link: ROCm/TheRock#2505

Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants