Skip to content

[CK] Fix CI Failures for PR From Forks#6701

Merged
DDEle merged 1 commit into
ROCm:developfrom
DDEle:ck-fix-pr-from-forks
Apr 24, 2026
Merged

[CK] Fix CI Failures for PR From Forks#6701
DDEle merged 1 commit into
ROCm:developfrom
DDEle:ck-fix-pr-from-forks

Conversation

@DDEle
Copy link
Copy Markdown
Contributor

@DDEle DDEle commented Apr 23, 2026

Motivation

Fork PRs fail CI when RUN_AITER_TESTS or RUN_FA_TESTS is enabled. The docker scripts run git clone -b "$CK_*_BRANCH" https://github.com/ROCm/rocm-libraries.git, but a fork's branch doesn't exist upstream:

fatal: Remote branch <fork-branch> not found in upstream origin

Example: PR #6529 build #4.

Technical Details

Jenkinsfile — for PRs, use the upstream-visible PR ref instead of the head branch name:

CURRENT_BRANCH_NAME = env.CHANGE_ID
    ? "refs/pull/${env.CHANGE_ID}/head"
    : (env.CHANGE_BRANCH ? env.CHANGE_BRANCH : env.BRANCH_NAME)

Dockerfile.aiter / Dockerfile.fagit clone -b <ref> only accepts branches (refs/heads/*) and tags (refs/tags/*), so it can't resolve refs/pull/N/head. Switch to git fetch, which accepts any refspec (and still works for plain branch names):

mkdir rocm-libraries && cd rocm-libraries
git init -q
git remote add origin https://github.com/ROCm/rocm-libraries.git
git fetch --depth 1 --filter=blob:none origin "$CK_*_BRANCH"
git sparse-checkout init --cone
git sparse-checkout set projects/composablekernel
git checkout FETCH_HEAD

git checkout FETCH_HEAD lands in detached HEAD, which breaks the existing git branch -m "$CK_*_BRANCH" (and that name isn't a valid local branch anyway). Decouple the local branch name from the upstream ref:

  • Replace git init + git branch -m with git init -b "$LOCAL_BRANCH" (requires git ≥ 2.28, satisfied by base images)
  • LOCAL_BRANCH="ck-import-${ROCM_LIBRARIES_SHA}" in the rocm-libraries path; LOCAL_BRANCH="$CK_*_BRANCH" in the fallback
  • Downstream git clone -b ... ../ck uses $LOCAL_BRANCH

Test Plan

Manually trigger a build on this PR with RUN_AITER_TESTS=true and RUN_FA_TESTS=true; both docker images should build end-to-end.

Test Result

jenkins / rocm-libraries-folder/Composable Kernel / PR-6701 / #3

Submission Checklist

@DDEle DDEle force-pushed the ck-fix-pr-from-forks branch from 38a17bb to 271256d Compare April 23, 2026 06:24
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the Composable Kernel CI pipeline and related docker test images so fork-based PR builds can successfully fetch CK code by using an upstream-visible PR ref (refs/pull/<id>/head) rather than a fork-only branch name.

Changes:

  • Update CK branch selection in Jenkinsfile to default to refs/pull/<CHANGE_ID>/head for PR builds.
  • Adjust Dockerfile.aiter and Dockerfile.fa to avoid relying on git branch -m "$CK_*_BRANCH" when the upstream ref is a PR ref, by introducing a separate local branch name (LOCAL_BRANCH) and initializing repos with git init -b.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
projects/composablekernel/Jenkinsfile Uses the upstream PR ref for default CK branch parameters in PR builds to avoid fork branch lookup failures.
projects/composablekernel/Dockerfile.fa Decouples local branch naming from upstream ref and clones CK into flash-attention using a stable local branch.
projects/composablekernel/Dockerfile.aiter Decouples local branch naming from upstream ref and clones CK into aiter using a stable local branch.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@DDEle DDEle marked this pull request as ready for review April 23, 2026 06:30
@DDEle DDEle requested a review from a team as a code owner April 23, 2026 06:30
@DDEle DDEle merged commit f9a8d1c into ROCm:develop Apr 24, 2026
36 checks passed
assistant-librarian Bot pushed a commit to ROCm/composable_kernel that referenced this pull request Apr 24, 2026
[CK] Fix CI Failures for PR From Forks
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

## Motivation

Fork PRs fail CI when `RUN_AITER_TESTS` or `RUN_FA_TESTS` is enabled.
The docker scripts run `git clone -b "$CK_*_BRANCH"
https://github.com/ROCm/rocm-libraries.git`, but a fork's branch doesn't
exist upstream:

```
fatal: Remote branch <fork-branch> not found in upstream origin
```

Example: [PR #6529 build
#4](http://micimaster.amd.com/blue/organizations/jenkins/rocm-libraries-folder%2FComposable%20Kernel/detail/PR-6529/4/pipeline).

## Technical Details

**`Jenkinsfile`** — for PRs, use the upstream-visible PR ref instead of
the head branch name:

```groovy
CURRENT_BRANCH_NAME = env.CHANGE_ID
    ? "refs/pull/${env.CHANGE_ID}/head"
    : (env.CHANGE_BRANCH ? env.CHANGE_BRANCH : env.BRANCH_NAME)
```

**`Dockerfile.aiter` / `Dockerfile.fa`** — `git clone -b <ref>` only
accepts branches (`refs/heads/*`) and tags (`refs/tags/*`), so it can't
resolve `refs/pull/N/head`. Switch to `git fetch`, which accepts any
refspec (and still works for plain branch names):

```sh
mkdir rocm-libraries && cd rocm-libraries
git init -q
git remote add origin https://github.com/ROCm/rocm-libraries.git
git fetch --depth 1 --filter=blob:none origin "$CK_*_BRANCH"
git sparse-checkout init --cone
git sparse-checkout set projects/composablekernel
git checkout FETCH_HEAD
```

`git checkout FETCH_HEAD` lands in detached HEAD, which breaks the
existing `git branch -m "$CK_*_BRANCH"` (and that name isn't a valid
local branch anyway). Decouple the local branch name from the upstream
ref:

- Replace `git init` + `git branch -m` with `git init -b
"$LOCAL_BRANCH"` (requires git ≥ 2.28, satisfied by base images)
- `LOCAL_BRANCH="ck-import-${ROCM_LIBRARIES_SHA}"` in the rocm-libraries
path; `LOCAL_BRANCH="$CK_*_BRANCH"` in the fallback
- Downstream `git clone -b ... ../ck` uses `$LOCAL_BRANCH`

## Test Plan

Manually trigger a build on this PR with `RUN_AITER_TESTS=true` and
`RUN_FA_TESTS=true`; both docker images should build end-to-end.

## Test Result
[jenkins / rocm-libraries-folder/Composable Kernel / PR-6701 /
#3](http://micimaster.amd.com/blue/organizations/jenkins/rocm-libraries-folder%2FComposable%20Kernel/detail/PR-6701/3/pipeline/)

## Submission Checklist

- [x] Look over the contributing guidelines at
https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.
aledudek pushed a commit that referenced this pull request May 20, 2026
## Motivation

Fork PRs fail CI when `RUN_AITER_TESTS` or `RUN_FA_TESTS` is enabled.
The docker scripts run `git clone -b "$CK_*_BRANCH"
https://github.com/ROCm/rocm-libraries.git`, but a fork's branch doesn't
exist upstream:

```
fatal: Remote branch <fork-branch> not found in upstream origin
```

Example: [PR #6529 build
#4](http://micimaster.amd.com/blue/organizations/jenkins/rocm-libraries-folder%2FComposable%20Kernel/detail/PR-6529/4/pipeline).

## Technical Details

**`Jenkinsfile`** — for PRs, use the upstream-visible PR ref instead of
the head branch name:

```groovy
CURRENT_BRANCH_NAME = env.CHANGE_ID
    ? "refs/pull/${env.CHANGE_ID}/head"
    : (env.CHANGE_BRANCH ? env.CHANGE_BRANCH : env.BRANCH_NAME)
```

**`Dockerfile.aiter` / `Dockerfile.fa`** — `git clone -b <ref>` only
accepts branches (`refs/heads/*`) and tags (`refs/tags/*`), so it can't
resolve `refs/pull/N/head`. Switch to `git fetch`, which accepts any
refspec (and still works for plain branch names):

```sh
mkdir rocm-libraries && cd rocm-libraries
git init -q
git remote add origin https://github.com/ROCm/rocm-libraries.git
git fetch --depth 1 --filter=blob:none origin "$CK_*_BRANCH"
git sparse-checkout init --cone
git sparse-checkout set projects/composablekernel
git checkout FETCH_HEAD
```

`git checkout FETCH_HEAD` lands in detached HEAD, which breaks the
existing `git branch -m "$CK_*_BRANCH"` (and that name isn't a valid
local branch anyway). Decouple the local branch name from the upstream
ref:

- Replace `git init` + `git branch -m` with `git init -b
"$LOCAL_BRANCH"` (requires git ≥ 2.28, satisfied by base images)
- `LOCAL_BRANCH="ck-import-${ROCM_LIBRARIES_SHA}"` in the rocm-libraries
path; `LOCAL_BRANCH="$CK_*_BRANCH"` in the fallback
- Downstream `git clone -b ... ../ck` uses `$LOCAL_BRANCH`

## Test Plan

Manually trigger a build on this PR with `RUN_AITER_TESTS=true` and
`RUN_FA_TESTS=true`; both docker images should build end-to-end.

## Test Result
[jenkins / rocm-libraries-folder/Composable Kernel / PR-6701 /
#3](http://micimaster.amd.com/blue/organizations/jenkins/rocm-libraries-folder%2FComposable%20Kernel/detail/PR-6701/3/pipeline/)

## Submission Checklist

- [x] Look over the contributing guidelines at
https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants