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
15 changes: 14 additions & 1 deletion app/serve.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1051,12 +1051,21 @@ Launch launch_for(const Options& o, const std::string& device, int child_port) {
if (arch == "qwen35" || arch == "qwen35moe" || arch == "qwen3next") argv.insert(argv.end(), {"-np", "1"});
}
} else if (device == "ds4") {
#ifndef ONEBIT_DS4_SERVER
// Owner decision 2026-11-01: DwarfStar is out of the shipped builds (ONEBIT_DS4=OFF) - it runs antirez's
// CUDA kernels through a HIP shim plus hipBLAS, not our HIP kernels. A build without it must say so here,
// not go looking for a `ds4-server` on PATH and fail with "no such file".
throw std::runtime_error(
"--device ds4: this build has no DwarfStar route (built with ONEBIT_DS4=OFF). DeepSeek V4.x, GLM 5.x and "
"Qwen3.8-Flash-Next run on --device hrx (docs/dwarfstar.md)");
#else
// DwarfStar: its own GGUF layouts only; it opens its port after the model has loaded
argv = {o.ds4.empty() ? default_ds4() : o.ds4, "-m", o.model,
"--host", "127.0.0.1", "--port", std::to_string(child_port)};
if (o.ctx_size > 0) { argv.push_back("--ctx"); argv.push_back(std::to_string(o.ctx_size)); }
if (o.ssd_streaming) argv.push_back("--ssd-streaming");
l.ready_path = "/v1/models";
#endif
} else {
refuse_removed_device(device);
throw std::runtime_error("--device " + device + " cannot run a .gguf (hrx, cpu or ds4)");
Expand Down Expand Up @@ -1626,7 +1635,11 @@ int serve_child(const Options& given) {
std::fprintf(stderr, "1bit serve: %s is Hadamard-folded (prism.hadamard): HRX route\n", o.model.c_str());
}
if (onebp_file(o.model)) {
// DwarfStar (our fork) is the engine's 1BP reader
// DwarfStar (our fork) is the engine's 1BP reader; without it, a 1BP package has no route in this build
#ifndef ONEBIT_DS4_SERVER
throw std::runtime_error(o.model + " is a 1BP package: this build has no DwarfStar route (ONEBIT_DS4=OFF). "
"Use a GGUF on --device hrx instead (docs/dwarfstar.md)");
#endif
if (o.device == "auto") o.device = "ds4";
if (o.device != "ds4")
throw std::runtime_error(o.model + " is a 1BP package: it runs on --device ds4 (docs/dwarfstar.md)");
Expand Down
40 changes: 25 additions & 15 deletions scripts/weekly.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ DRY=${WEEKLY_DRY_RUN:-0}
# the box is shared: a capped build leaves room for whatever else runs on Sunday
JOBS=${WEEKLY_JOBS:-4}
export CMAKE_BUILD_PARALLEL_LEVEL=$JOBS
# DwarfStar is out of the release (owner decision 2026-11-01): the build below defaults ONEBIT_DS4 to OFF, the
# preflight reads ${ONEBIT_DS4:-OFF} and scripts/package-linux.sh requires the ds4 tools only when it is not OFF.
# Exported here so all three read the same value from one place - a plain run (no ONEBIT_DS4 in the environment)
# otherwise builds a no-DS4 engine and then fails at packaging looking for ds4 tools that were never built.
export ONEBIT_DS4=${ONEBIT_DS4:-OFF}
# the submodules the packages are built from (laya only on its bump)
# (not xdna-driver: it pins the amdxdna kernel driver, which the release does not build)
SUBMODULES=(hrx-system llama.cpp lemonade ds4 tokenizers)
Expand Down Expand Up @@ -146,14 +151,13 @@ build() {
extra+=(-DONEBIT_NPU_PRIVATE="$W/npu-kernels" -DONEBIT_NPU_RELEASE=ON)
say "NPU kernels $(git -C "$W/npu-kernels" rev-parse --short HEAD): $(ls "$BUILD/npu/kernels" | wc -l) sealed sets"
fi
# ONEBIT_DS4=OFF builds without DwarfStar (third_party/ds4, `1bit serve --device ds4`). It is ON by
# default because the release ships that backend; the knob exists because the target needs hipCUB,
# hipBLAS, hipBLASLt and rocWMMA headers from ROCm, and a machine whose ROCm install lacks them
# cannot build it at all - better a declared, explicit build than a release that silently ships
# without the backend (2026-11-01: the rebuilt box's ROCm has no hipCUB headers).
# ONEBIT_DS4=OFF is the default since 2026-11-01: the release ships HIP kernels only (owner decision - the ds4
# route is antirez's CUDA kernels through a HIP shim plus hipBLAS, not our kernels), and the target needs
# hipCUB/hipBLAS/hipBLASLt/rocWMMA headers that a given ROCm install may not carry. ONEBIT_DS4=ON still builds
# it for the reference fork.
cmake -S "$SRC" -B "$BUILD" -G Ninja -DCMAKE_BUILD_TYPE=Release \
-DONEBIT_HRX=ON -DONEBIT_GPU_PRIVATE="$W/gpu-kernels" \
-DONEBIT_DS4=${ONEBIT_DS4:-ON} -DONEBIT_HF_TOKENIZERS=ON \
-DONEBIT_DS4=${ONEBIT_DS4:-OFF} -DONEBIT_HF_TOKENIZERS=ON \
-DONEBIT_NPU=ON -DONEBIT_NPU_RUNTIME=own -DONEBIT_NPU_RT_DIR="$npurt" \
-DONEBIT_SERVE_TEST_GGUF="$GGUF" "${extra[@]}" > "$LOGS/configure.log" 2>&1
guard cmake --build "$BUILD" > "$LOGS/build.log" 2>&1
Expand Down Expand Up @@ -199,6 +203,9 @@ bump_check() { # bump_check <branch>
bump-laya/*)
"$SRC/scripts/fetch-laya.sh" "$W/laya" > "$LOGS/laya.log" 2>&1
"$SRC/tests/laya_route_e2e.sh" "$BUILD/1bit" "$W/laya" >> "$LOGS/laya.log" 2>&1 ;;
# DwarfStar is out of the shipped build since 2026-11-01 (ONEBIT_DS4 defaults to OFF); this arm stays for
# the reference fork (1bit-MONSTER/ds4). It needs hipCUB/hipBLAS/hipBLASLt/rocWMMA headers, which a given
# ROCm install may not carry - the release build no longer touches it.
bump-ds4/*) DS4_TEST=1 guard "$SRC/scripts/build-ds4.sh" "$W/ds4-test" > "$LOGS/ds4.log" 2>&1 ;;
*) : ;; # xdna (the kernel driver pin), tokenizers: covered by build + ctest
esac
Expand Down Expand Up @@ -613,15 +620,18 @@ preflight() {
echo "preflight: cannot fetch the pinned HRX toolchain (config/hrx-toolchain.config): see $LOGS/hrx-toolchain.log"; bad=1
fi ;;
esac
# DwarfStar (-DONEBIT_DS4=ON) builds with hipcc, found the way scripts/build-ds4.sh finds it
rocm=${ROCM_PATH:-}
if [ -z "$rocm" ]; then
for d in ${HRX_TOOLCHAIN:-} ${HRX_TOOLCHAIN:+"$HRX_TOOLCHAIN"/lib/python3*/site-packages/_rocm_sdk_core} /opt/rocm-therock/lib/python3*/site-packages/_rocm_sdk_devel /opt/rocm; do
[ -x "$d/bin/hipcc" ] && { rocm=$d; break; }
done
fi
[ -n "$rocm" ] && [ -x "$rocm/bin/hipcc" ] ||
{ echo "preflight: no ROCm with bin/hipcc for the DwarfStar build (scripts/build-ds4.sh): set ROCM_PATH"; bad=1; } ;;
# DwarfStar needs hipcc, but only when it is being built: since 2026-11-01 the release ships HIP
# kernels only, so a box without hipcc must still be able to build a release.
if [ "${ONEBIT_DS4:-OFF}" != OFF ]; then
rocm=${ROCM_PATH:-}
if [ -z "$rocm" ]; then
for d in ${HRX_TOOLCHAIN:-} ${HRX_TOOLCHAIN:+"$HRX_TOOLCHAIN"/lib/python3*/site-packages/_rocm_sdk_core} /opt/rocm-therock/lib/python3*/site-packages/_rocm_sdk_devel /opt/rocm; do
[ -x "$d/bin/hipcc" ] && { rocm=$d; break; }
done
fi
[ -n "$rocm" ] && [ -x "$rocm/bin/hipcc" ] ||
{ echo "preflight: no ROCm with bin/hipcc for the DwarfStar build (scripts/build-ds4.sh): set ROCM_PATH, or build with ONEBIT_DS4=OFF (the release default)"; bad=1; }
fi ;;
package)
# scripts/package-linux.sh rewrites RPATHs with patchelf
command -v patchelf > /dev/null ||
Expand Down
Loading