Skip to content

[docs] How to cherry-pick to pre-monorepo branches - #221

Merged
bstefanuk merged 7 commits into
ROCm:developfrom
bstefanuk:how-to-cherry-pick-for-rocm-70
Jun 18, 2025
Merged

bstefanuk merged 7 commits into
ROCm:developfrom
bstefanuk:how-to-cherry-pick-for-rocm-70

Conversation

@bstefanuk

Copy link
Copy Markdown
Contributor

Add documentation on the proper process to cherry pick changes from the monorepo into pre-monorepo branches. In particular, release-staging/rocm-rel-x.y branches.

@bstefanuk bstefanuk self-assigned this Jun 16, 2025
@bstefanuk
bstefanuk requested a review from a team as a code owner June 16, 2025 16:21
@bstefanuk bstefanuk added documentation ci:docs-only Docs only changes NoCI Don't run CI labels Jun 16, 2025
@bstefanuk
bstefanuk marked this pull request as draft June 16, 2025 17:05

@stanleytsang-amd stanleytsang-amd 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.

Hmm, I can imagine a corner case where this policy would be problematic, if I'm reading this correctly. Let's use 7.0 as a toy example

  1. release-staging/rocm-rel-7.0 branch gets created from develop branch, contains 7.0 commits.
  2. Work now begins on 7.1 stuff. 7.1 PRs get merged into develop branch. Eventually, there might be a 7.1 PR which causes the code to be fundamentally incompatible with 7.0 code in the release-staging/rocm-rel-7.0 branch.
  3. If I want to cherry-pick a fix for 7.0 into the release-staging/rocm-rel-7.0 branch, with the new policy it would have to land in develop first, but the issue is, the code contained the 7.0 cherry-pick PR may not be compatible with the 7.1 code in develop

I suppose we could do 7.1 development work in a different branch during the 7.0 cycle, but that's a divergence from our current workflow and that's a pretty significant amount of time. Maybe I misread something.

@malcolmroberts

Copy link
Copy Markdown
Contributor

We need to have the context of how repos are moved over (eg, if history is preserved, and, if so, how) in order for this procedure to make sense. I'd suggest making a PR that documents how libraries are moved from separate to combined repositories first.

@evetsso

evetsso commented Jun 17, 2025

Copy link
Copy Markdown
Contributor

Hmm, I can imagine a corner case where this policy would be problematic, if I'm reading this correctly. Let's use 7.0 as a toy example

Maybe a more concrete example is if something needed to be reverted only in the release-staging branch, like something accidentally got into the branch that wasn't supposed to be there and needed to be taken out. You wouldn't want to have to take that out of develop as well.

@bstefanuk

Copy link
Copy Markdown
Contributor Author

Hmm, I can imagine a corner case where this policy would be problematic, if I'm reading this correctly. Let's use 7.0 as a toy example

  1. release-staging/rocm-rel-7.0 branch gets created from develop branch, contains 7.0 commits.
  2. Work now begins on 7.1 stuff. 7.1 PRs get merged into develop branch. Eventually, there might be a 7.1 PR which causes the code to be fundamentally incompatible with 7.0 code in the release-staging/rocm-rel-7.0 branch.
  3. If I want to cherry-pick a fix for 7.0 into the release-staging/rocm-rel-7.0 branch, with the new policy it would have to land in develop first, but the issue is, the code contained the 7.0 cherry-pick PR may not be compatible with the 7.1 code in develop

I suppose we could do 7.1 development work in a different branch during the 7.0 cycle, but that's a divergence from our current workflow and that's a pretty significant amount of time. Maybe I misread something.

Please see the comment I have posted regarding an addition to the FAQs.

@bstefanuk

bstefanuk commented Jun 17, 2025 •

Copy link
Copy Markdown
Contributor Author

Hmm, I can imagine a corner case where this policy would be problematic, if I'm reading this correctly. Let's use 7.0 as a toy example

Maybe a more concrete example is if something needed to be reverted only in the release-staging branch, like something accidentally got into the branch that wasn't supposed to be there and needed to be taken out. You wouldn't want to have to take that out of develop as well.

This is a fair edge case, we can add it to the FAQs. Please recommend a specific question and provide an answer so I can get a feel for how you would like the provide guidance to developers on how to overcome this. @evetsso @stanleytsang-amd.

@bstefanuk

bstefanuk commented Jun 17, 2025 •

Copy link
Copy Markdown
Contributor Author

We need to have the context of how repos are moved over (eg, if history is preserved, and, if so, how) in order for this procedure to make sense. I'd suggest making a PR that documents how libraries are moved from separate to combined repositories first.

@malcolmroberts I hear you, but isn't your question more related to a component's migration to the monorepo? The current document is only intended to provide a best practice reference for how to reflect cherry-picks to release-staging in pre-monorepo projects. If you haven't migrated to the monorepo, this document is irrelevant until that time.

Edit: Either way, thank you for providing an actionable suggestion in your comment! I actually think this is a great idea so that we can clarify what the process looks like for devs that see this coming down the pipe. For now (though I don't think this is expressly what you were asking for) here's an example of a PR that was migrated from Tensile into the monorepo: #212

@stanleytsang-amd

Copy link
Copy Markdown
Contributor

Apologies in advance if I'm missing something here, but I do have a fundamental question about this:

Why are we even instigating this change in procedure at all? From what I understand from the existing accepted software release process set out for Math Libs, we are allowed and are supposed to target PRs directly into the release branches (as opposed to targeting develop and then subsequently cherry-picking them into the release branch). Then we merge back the PRs into develop as necessary. In my opinion, the existing method is less problematic (ie. the issue I brought up, which you did address, but it is still extra work compared to the existing workflow) and it would still be compatible with the requirements of updating the original public repo branches as outlined in this PR. Is there some technical reason why we're doing this change? What am I missing?

@bstefanuk

bstefanuk commented Jun 18, 2025 •

Copy link
Copy Markdown
Contributor Author

Apologies in advance if I'm missing something here, but I do have a fundamental question about this:

Why are we even instigating this change in procedure at all? From what I understand from the existing accepted software release process set out for Math Libs, we are allowed and are supposed to target PRs directly into the release branches (as opposed to targeting develop and then subsequently cherry-picking them into the release branch). Then we merge back the PRs into develop as necessary. In my opinion, the existing method is less problematic (ie. the issue I brought up, which you did address, but it is still extra work compared to the existing workflow) and it would still be compatible with the requirements of updating the original public repo branches as outlined in this PR. Is there some technical reason why we're doing this change? What am I missing?

From my perspective the process being outlined here reflects the current recommended approach within math libraries: (i) merge to develop, (ii) cherry pick to release-staging or release, with merge for release being gated by CQE. We must have been given conflicting advice about this procedure. We've been using this pattern in Tensile and hipBLASLt for several releases. However, we are aware that the standard for this differs between components.

@bstefanuk
bstefanuk requested a review from samjwu June 18, 2025 17:52
@bstefanuk bstefanuk closed this Jun 18, 2025
@bstefanuk bstefanuk reopened this Jun 18, 2025
@stellaraccident

stellaraccident commented Jun 18, 2025 •

Copy link
Copy Markdown
Contributor

Apologies in advance if I'm missing something here, but I do have a fundamental question about this:

Why are we even instigating this change in procedure at all? From what I understand from the existing accepted software release process set out for Math Libs, we are allowed and are supposed to target PRs directly into the release branches (as opposed to targeting develop and then subsequently cherry-picking them into the release branch). Then we merge back the PRs into develop as necessary. In my opinion, the existing method is less problematic (ie. the issue I brought up, which you did address, but it is still extra work compared to the existing workflow) and it would still be compatible with the requirements of updating the original public repo branches as outlined in this PR. Is there some technical reason why we're doing this change? What am I missing?

No practices at any other eng shop of this scale agrees with the current ad-hoc approach. Most of them that I have been involved with have a strict policy that changes land on main and get cherry-picked to release branches. And then there is usually a high level/senior/central set of people who can override that in an emergency. It's kind of a foundational principle of CI/CD. If there are very short term needs based on our current "development process", then we can make exceptions, but everyone is going to start marching towards a unified CI/CD methodology.

@stellaraccident stellaraccident 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.

Let's land this. You can label it as DRAFT if people want to discuss more. But it is a step in the right direction.

@YvanMokwinski

Copy link
Copy Markdown
Contributor

@jsandham

@stanleytsang-amd

Copy link
Copy Markdown
Contributor

Apologies in advance if I'm missing something here, but I do have a fundamental question about this:
Why are we even instigating this change in procedure at all? From what I understand from the existing accepted software release process set out for Math Libs, we are allowed and are supposed to target PRs directly into the release branches (as opposed to targeting develop and then subsequently cherry-picking them into the release branch). Then we merge back the PRs into develop as necessary. In my opinion, the existing method is less problematic (ie. the issue I brought up, which you did address, but it is still extra work compared to the existing workflow) and it would still be compatible with the requirements of updating the original public repo branches as outlined in this PR. Is there some technical reason why we're doing this change? What am I missing?

No practices at any other eng shop of this scale agrees with the current ad-hoc approach. Most of them that I have been involved with have a strict policy that changes land on main and get cherry-picked to release branches. And then there is usually a high level/senior/central set of people who can override that in an emergency. It's kind of a foundational principle of CI/CD. If there are very short term needs based on our current "development process", then we can make exceptions, but everyone is going to start marching towards a unified CI/CD methodology.

If the order comes from the top I won't argue, but I just wanted to describe a scenario which is not uncommon at AMD, in which I hope would fall under the "emergency override category":

Let's say for some release (7.0 as an example), post creation of the release-staging/rocm-rel-7.0 branch, there is a bug somewhere in the ROCm stack, which results in say, a performance regression in one of our math libs (rocPRIM, for example). The ROCm stack bug is fixed in 7.1, but did not make it in time for 7.0. As such, to regain the lost performance in 7.0, a code workaround is required for rocPRIM.

In this scenario, it would make little to no sense to me to land this workaround in develop branch (which is now effectively for 7.1 work) since the ROCm stack bug does not exist in 7.1. In this case, are we allowed to submit the code workaround PR directly to the release-staging/rocm-rel-7.0 branch?

@bstefanuk
bstefanuk marked this pull request as ready for review June 18, 2025 19:59
@bstefanuk bstefanuk changed the title docs: how to cherry-pick to pre-monorepo branches [docs] how to cherry-pick to pre-monorepo branches Jun 18, 2025

@amd-jnovotny amd-jnovotny 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.

Skimmed for obvious errors. Looks good. Will do a more complete review of the final copy.

@bstefanuk

bstefanuk commented Jun 18, 2025 •

Copy link
Copy Markdown
Contributor Author

The document will be merged in a draft state. I have created a discussion issue to collect follow up thoughts, see: #234

@bstefanuk bstefanuk changed the title [docs] how to cherry-pick to pre-monorepo branches [docs] How to cherry-pick to pre-monorepo branches Jun 18, 2025
@bstefanuk
bstefanuk merged commit cd3e504 into ROCm:develop Jun 18, 2025
@bstefanuk
bstefanuk deleted the how-to-cherry-pick-for-rocm-70 branch June 18, 2025 21:39
ammallya pushed a commit that referenced this pull request Sep 24, 2025
ammallya pushed a commit that referenced this pull request Sep 24, 2025
ammallya pushed a commit that referenced this pull request Nov 5, 2025
* Modify permute backend implementation

* Remove duplicate instances

* Add comment

* Add combined operation
ammallya pushed a commit that referenced this pull request Nov 5, 2025
* Modify permute backend implementation

* Remove duplicate instances

* Add comment

* Add combined operation

[ROCm/hipTensor commit: dff3647]
evetsso pushed a commit to evetsso/rocm-libraries that referenced this pull request Dec 31, 2025
JP-Fernando pushed a commit to StreamHPC/rocm-libraries that referenced this pull request Feb 9, 2026
Created a unified Run<>() function which compiles.

I am making this commit as a backup,
before I modify the calls and test this solution.
JP-Fernando pushed a commit to StreamHPC/rocm-libraries that referenced this pull request Feb 9, 2026
Managed to integrate the new Run<<>() function
into the existing code.

As a partial solution, the old Run<>() functions
still exist but their bodies only call the new Run<>()
function with appropriate arguments and
template arguments.

Work will now focus on simplification.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:docs-only Docs only changes documentation NoCI Don't run CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.