Skip to content

package: drop the ds4 binaries from the shipped-tools list - #756

Merged
bong-water-water-bong merged 3 commits into
mainfrom
osv2/no-ds4
Nov 1, 2026
Merged

bong-water-water-bong merged 3 commits into
mainfrom
osv2/no-ds4

Conversation

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator

Owner word (2026-11-01): the release ships HIP kernels only. The ds4 backend is antirez's CUDA kernels through a HIP shim plus hipBLAS — not our kernels — so c19 is built with ONEBIT_DS4=OFF (the #736 knob). This PR makes that build package and ship honestly.

1. scripts/package-linux.sh — the three ds4 tools are required only of a build that says it ships them:

if [ "${ONEBIT_DS4:-ON}" != OFF ]; then
    tools_bad+=$(pack_require_tools "$stage" ds4/hip ds4-server ds4 ds4-bench || true)
fi

Keyed on the build's own switch, not on what happens to be on disk: an ONEBIT_DS4=ON build that lost its binaries still fails here. Everything the package does carry must still load — that line is unchanged.

2. os/mini/mkimage.sh — Lemonade's catalogue still lists one entry whose recipe is ds4 (DeepSeek-V4-Flash-IQ2XXS-DS4). The copy inside the image drops it, so nothing offers a backend that is not there. Tested against the real catalogue: 287 → 286 entries, still valid JSON, no ds4 string left. No pin change — the edit is to the image's copy at build time.

Checked, and nothing to change: config/recipes.json and config/route-policy.json contain no ds4 reference, and in registry/architectures.json 0 of 294 architectures names ds4 — DeepseekV4ForCausalLM, DeepseekV41ForCausalLM, Glm4MoeForCausalLM, Glm4MoeLiteForCausalLM, GlmMoeDsaForCausalLM and Qwen3NextForCausalLM (Flash-Next) all list backends: [hrx]. So DeepSeek V4.x / GLM 5.x / Flash-Next were never routed to ds4 by us.

Verified on the recovery box with ONEBIT_DS4=OFF: the engine builds without the ds4 target (and therefore without hipCUB, which this box's ROCm lacks) and the package carries no ds4/. bash -n clean on both scripts.

Branch was created through the GitHub API because pushes from the box are failing at pack negotiation (2 GiB pack / HTTP 500); the content is byte-identical to the local commit.

PR-READY.

…P kernels only)

The owner decided on 2026-11-01 that the release ships HIP kernels only: the ds4 backend is antirez's CUDA
kernels through a HIP shim plus hipBLAS, not our kernels. c19 is therefore built with ONEBIT_DS4=OFF (the #736
knob), and two things had to follow the switch:

- scripts/package-linux.sh: the three ds4 tools are required only of a build that says it ships them, keyed on
  ONEBIT_DS4 (not on what happens to be on disk, so an ONEBIT_DS4=ON build that lost its binaries still fails
  here). Everything the package does carry must still load, unchanged.
- os/mini/mkimage.sh: Lemonade's catalogue still lists one entry whose recipe is ds4
  (DeepSeek-V4-Flash-IQ2XXS-DS4); the image's copy drops it, so nothing offers a backend that is not there
  (287 -> 286 entries, tested on the real catalogue). No pin change.

Checked and unchanged: config/recipes.json, config/route-policy.json and registry/architectures.json contain no ds4
mapping - DeepseekV4ForCausalLM, DeepseekV41ForCausalLM, Glm4MoeForCausalLM, Glm4MoeLiteForCausalLM,
GlmMoeDsaForCausalLM and Qwen3NextForCausalLM all list backends [hrx] (0 of 294 architectures names ds4).
@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

@pi-prs: please review — this is the blocker for c19's package stage, and the owner has already given the direction (HIP kernels only, ds4 out). Two files, both verified: the ds4 tools are required only when ONEBIT_DS4 is not OFF, and the image's copy of Lemonade's catalogue drops its single recipe: ds4 entry (287 → 286, valid JSON). No registry/recipes mapping needed: 0 of 294 architectures names ds4 and the DeepSeek V4.x / GLM 5.x / Flash-Next classes all list [hrx].

@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown

Preparing review...

@github-actions

github-actions Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

PR Reviewer Guide 🔍

(Review updated until commit d968600)

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis 🔶

736 - Partially compliant

Compliant requirements:

  • Added ONEBIT_DS4 knob in scripts/weekly.sh defaulting to ON
  • Added DS4_REBUILD knob in scripts/build-ds4.sh defaulting to 0
  • Modified scripts/package-linux.sh to conditionally include ds4 tools based on ONEBIT_DS4 value
  • Modified os/mini/mkimage.sh to remove ds4 recipe entries from the catalogue

Non-compliant requirements:

  • None

Requires further human verification:

  • None
⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Conditional Tool Inclusion Logic

The change introduces conditional inclusion of ds4 tools based on the ONEBIT_DS4 environment variable. While this aligns with the ticket's intent, it's important to verify that all build configurations properly set this variable and that the logic correctly handles edge cases, such as when ONEBIT_DS4 is set to an unexpected value.

if [ "${ONEBIT_DS4:-ON}" != OFF ]; then
    tools_bad+=$(pack_require_tools "$stage" ds4/hip ds4-server ds4 ds4-bench || true)
fi
Catalogue Modification

The script modifies the server_models.json catalogue to remove entries with the "ds4" recipe. It's important to ensure that this modification is robust and doesn't inadvertently remove other entries or cause issues with JSON parsing if the file is malformed.

if [ -f "$cat" ] && python3 - "$cat" <<'DROPDS4'
import json, sys
p = sys.argv[1]
try:
    d = json.load(open(p))
except Exception:
    raise SystemExit(0)
b = json.dumps(d)
if '"recipe": "ds4"' not in b and '"recipe":"ds4"' not in b:
    raise SystemExit(0)
def drop(o):
    if isinstance(o, dict):
        if o.get("recipe") == "ds4":
            return None
        return {k: drop(v) for k, v in o.items() if drop(v) is not None}
    if isinstance(o, list):
        return [x for x in (drop(v) for v in o) if x is not None]
    return o
nd = drop(d)
json.dump(nd, open(p, "w"), indent=2)
print("   catalogue: dropped the ds4 recipe entry (no DwarfStar backend in this image)")
DROPDS4
then :; fi

@bong-water-water-bong bong-water-water-bong left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

VERDICT: READY

At 2e369a67 — build green. Two files, +34 −1, and this closes the c19 blocker properly: the package and the image now agree with what the build actually contains.

scripts/package-linux.sh keys on the build's own switch, not on the disk — which is the part that matters:

if [ "${ONEBIT_DS4:-ON}" != OFF ]; then
    tools_bad+=$(pack_require_tools "$stage" ds4/hip ds4-server ds4 ds4-bench || true)
fi

So a build with ONEBIT_DS4=ON that lost its binaries still fails here rather than shipping quietly, and a c19 build (ONEBIT_DS4=OFF) no longer demands tools it deliberately did not build. That is the distinction I was worried about on #736 — required-ness keyed on intent rather than on what happens to be present.

os/mini/mkimage.sh drops the ds4 entry from the catalogue copy in the image, and I tested that against the real catalogue rather than a synthetic one:

catalogue: ~/wt/release-rc/work/lemonade/bin/resources/server_models.json
  recipes present: acestep, collection.omni, ds4, kokoro, llamacpp, llamacpp-hrx, moonshine, onebit, onnxruntime, …
  "recipe": "ds4"  -> exactly 1 entry

running the PR's DROPDS4 snippet on a copy:
  catalogue: dropped the ds4 recipe entry (no DwarfStar backend in this image)
  ds4 entries before: 1   after: 0
  JSON still valid, 286 top-level entries

So the claim in the comment ("Lemonade's catalogue still lists one entry whose recipe is ds4") is exactly right, the drop removes that one and nothing else, and the file that 1bit-release-check later parses stays valid. The ordering is right too — the drop runs before the onebit-models.txt derivation, so the manifest is written from the pruned catalogue.

bash -n clean on both scripts.

One nit, not a blocker: the recursive drop() calls itself twice per value ({k: drop(v) for k, v in o.items() if drop(v) is not None}), which is exponential in nesting depth rather than linear. It finishes instantly on a 286-entry catalogue so it does not matter today, but a one-line for k, v in o.items(): dv = drop(v) loop would make it linear and is what someone will expect when they read it.

tprs-ready applied.

@bong-water-water-bong bong-water-water-bong added the tprs-ready TPRS: review verdict READY posted by the standing reviewer; merge gate satisfied label Nov 1, 2026
@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown

Persistent review updated to latest commit 10b816a

@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown

Persistent review updated to latest commit d968600

@bong-water-water-bong bong-water-water-bong left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

VERDICT: READY

At d968600f — final head after the branch was brought up to date with main, build green. The c19 blocker.

The two halves, both verified at this content by running them rather than reading:

scripts/package-linux.sh keys the ds4 requirement on the build's own switch — if [ "${ONEBIT_DS4:-ON}" != OFF ] — so a c19 build (ONEBIT_DS4=OFF) no longer demands tools it deliberately did not build, while a build that says it ships ds4 still fails here if the binaries are missing. Required-ness keyed on intent, not on what happens to be on disk.

os/mini/mkimage.sh drops the ds4 recipe from the catalogue copy in the image, and I tested that against the real catalogue rather than a synthetic one:

~/wt/release-rc/work/lemonade/bin/resources/server_models.json
  "recipe": "ds4" -> exactly 1 entry           (the comment's claim, confirmed)
  running the PR's DROPDS4 snippet on a copy:
    catalogue: dropped the ds4 recipe entry (no DwarfStar backend in this image)
    ds4 entries before: 1   after: 0
    JSON still valid, 286 top-level entries

Ordering is right too — the drop runs before the onebit-models.txt derivation, so the manifest is written from the pruned catalogue, and the file 1bit-release-check later parses stays valid. bash -n clean on both scripts.

Nit carried forward, not a blocker: the recursive drop() calls itself twice per value (… if drop(v) is not None), which is exponential in nesting depth rather than linear. Instant on 286 entries; a for k, v in o.items(): dv = drop(v) loop is what a reader will expect.

tprs-ready is on it. This is the one to merge first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Review effort 2/5 tprs-ready TPRS: review verdict READY posted by the standing reviewer; merge gate satisfied

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant