Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/workflows/unsloth-pin-preflight.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,20 @@ jobs:
continue
fi
if git -c user.name=preflight -c user.email=preflight@local \
-c merge.conflictStyle=diff3 \
merge --no-ff --no-edit -m "probe ${SRC}#${NUM}" "$SHA" >/dev/null 2>&1; then
echo "ok ${SRC}#${NUM}"
continue
fi
# Mirror resolve: a pure add/add is what the nightly will merge
# automatically, so reporting it as a conflict here is a false
# alarm. Anything additive_merge.py refuses is still a conflict.
if python3 ../scripts/unsloth/additive_merge.py >/dev/null 2>&1 \
&& [ -z "$(git diff --name-only --diff-filter=U)" ]; then
git -c user.name=preflight -c user.email=preflight@local commit -q --no-edit
echo "ok ${SRC}#${NUM} (additive resolve)"
continue
fi
FILES="$(git diff --name-only --diff-filter=U | sed 's/^/ /')"
HUNKS="$(git diff --diff-filter=U -U0 2>/dev/null | grep -E '^\+|^-' | grep -vE '^(\+\+\+|---)' | head -20)"
git merge --abort 2>/dev/null
Expand Down
23 changes: 20 additions & 3 deletions .github/workflows/unsloth-prebuilt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -280,9 +280,26 @@ jobs:
if ! git rev-parse --verify -q "${SHA}^{commit}" >/dev/null; then
echo "fetched something for ${SRC}#${NUM} but ${SHA} is still missing" >&2; exit 1
fi
git -c user.name='github-actions[bot]' -c user.email='41898282+github-actions[bot]@users.noreply.github.com' \
merge --no-ff --no-edit -m "Merge ${SRC}#${NUM} @ ${SHA}" "$SHA" \
|| { echo "${SRC}#${NUM} (${SHA}) does not merge cleanly onto ${BASE} + the PRs listed before it; reorder or drop it in scripts/unsloth/pr-set.json" >&2; exit 1; }
# diff3 so additive_merge.py can see the merge base and refuse
# anything that is not a pure add/add.
if ! git -c user.name='github-actions[bot]' -c user.email='41898282+github-actions[bot]@users.noreply.github.com' \
-c merge.conflictStyle=diff3 \
merge --no-ff --no-edit -m "Merge ${SRC}#${NUM} @ ${SHA}" "$SHA"; then
# The recurring conflict is two PRs adding a line to the same
# architecture table, where the answer is always "keep both".
# additive_merge.py resolves only that, and refuses when
# either side edited existing text, so a real disagreement
# still hard-fails here rather than being papered over.
if python3 scripts/unsloth/additive_merge.py \

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Preserve the resolver before checking out the upstream tag

On every conflicted mix merge, this invocation cannot find the resolver: earlier the workflow runs git checkout --detach refs/tags/${BASE}, where BASE is fetched from ggml-org/llama.cpp, so the fork-only scripts/unsloth/additive_merge.py file is removed from the worktree. python3 therefore exits without resolving anything, the condition enters the abort branch, and the nightly still fails for the exact add/add conflicts this change intends to handle. Copy the resolver to a stable location such as RUNNER_TEMP before the upstream checkout, or retrieve it from the workflow commit explicitly.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve base-before-pin order when invoking the resolver

For an order-sensitive add/add conflict, this caller reverses the intended resolution order. Git's checkout -h defines --ours as the current side and --theirs as the merged side; here the accumulated base and earlier pins are therefore ours, while $SHA is theirs. However, additive_merge.py:112 emits theirs + ours because it was written for repin.py, which checks out the pin and merges upstream in the opposite direction. Once the resolver is made available, the nightly will consequently put the newest pin before upstream and earlier-pin additions, which can silently alter valid ordered tables or registration lists; pass the merge direction to the resolver or otherwise emit ours + theirs in this workflow.

Useful? React with 👍 / 👎.

&& [ -z "$(git diff --name-only --diff-filter=U)" ]; then
git -c user.name='github-actions[bot]' -c user.email='41898282+github-actions[bot]@users.noreply.github.com' \
commit -q --no-edit
echo "::warning::${SRC}#${NUM} needed an additive merge; every conflict was a pure add/add and both sides were kept"
else
git merge --abort 2>/dev/null
echo "${SRC}#${NUM} (${SHA}) does not merge cleanly onto ${BASE} + the PRs listed before it; reorder or drop it in scripts/unsloth/pr-set.json" >&2; exit 1
fi
fi
done < <(jq -r '.[] | "\(.repo) \(.number) \(.sha)"' <<<"$PRS")
else
# Plain build: only the base tree is needed. Shallow is fine -- the
Expand Down
7 changes: 3 additions & 4 deletions scripts/unsloth/pr-set.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
],
"prs": [
"https://github.com/ggml-org/llama.cpp/pull/24423/commits/c3fb97241295c196e09b783e705e84b96cd1bd74",
"https://github.com/ggml-org/llama.cpp/pull/25731/commits/1e6f9e4a59138004e7936b543464afad71024a74",
"https://github.com/unslothai/llama.cpp/pull/48/commits/daef2b3e1b5b1ac7b575f13b13a9450cb2d02862",
"https://github.com/ggml-org/llama.cpp/pull/26185/commits/04d6828b2b555ef300bae8096663c6e675afdd47"
"https://github.com/ggml-org/llama.cpp/pull/25731/commits/3fd7901cb40248fb4b959ce84f9be97e868e2e62",
"https://github.com/unslothai/llama.cpp/pull/70/commits/06d2326acbf515b10f8d6abeada09123d361acde"
]
}
}