feat(profiles): resolve vllm nightly pins
This commit is contained in:
@@ -5,7 +5,7 @@ type: vllm
|
||||
stability: experimental
|
||||
install:
|
||||
method: docker_image
|
||||
spec: ghcr.io/noonghunna/vllm-club3090:latest
|
||||
spec: vllm/vllm-openai:nightly-e47c98ef7a38792996e452ef53914e21e41928e9
|
||||
min_sm: 7.5
|
||||
supported_model_families:
|
||||
- dense
|
||||
@@ -52,5 +52,4 @@ vendored_overlays:
|
||||
purpose: "DFlash serving support for local experimental composes."
|
||||
required_genesis: true
|
||||
genesis_pin: v7.72.2
|
||||
notes: "Experimental DFlash path. Does not claim INT8 PTH support."
|
||||
|
||||
notes: "Experimental DFlash path. Does not claim INT8 PTH support. Launch exports this SHA as VLLM_NIGHTLY_SHA; VLLM_IMAGE can override the full image ref."
|
||||
|
||||
@@ -5,7 +5,7 @@ type: vllm
|
||||
stability: experimental
|
||||
install:
|
||||
method: docker_image
|
||||
spec: ghcr.io/noonghunna/vllm-club3090:nightly-stable
|
||||
spec: vllm/vllm-openai:nightly-e47c98ef7a38792996e452ef53914e21e41928e9
|
||||
min_sm: 7.5
|
||||
supported_model_families:
|
||||
- dense
|
||||
@@ -63,5 +63,4 @@ vendored_overlays:
|
||||
purpose: "Respect configured Qwen3 Coder tool parser for required tool choice."
|
||||
required_genesis: true
|
||||
genesis_pin: v7.72.2
|
||||
notes: "Full experimental overlay surface for Gemma INT8 PTH and Qwen tool-parser experiments."
|
||||
|
||||
notes: "Full experimental overlay surface for Gemma INT8 PTH and Qwen tool-parser experiments. Launch exports this SHA as VLLM_NIGHTLY_SHA; VLLM_IMAGE can override the full image ref."
|
||||
|
||||
@@ -5,7 +5,7 @@ type: vllm
|
||||
stability: nightly
|
||||
install:
|
||||
method: docker_image
|
||||
spec: ghcr.io/noonghunna/vllm-club3090:latest
|
||||
spec: vllm/vllm-openai:nightly-1acd67a795ebccdf9b9db7697ae9082058301657
|
||||
min_sm: 7.5
|
||||
supported_model_families:
|
||||
- dense
|
||||
@@ -40,5 +40,4 @@ required_overlays: []
|
||||
vendored_overlays: []
|
||||
required_genesis: true
|
||||
genesis_pin: v7.72.2
|
||||
notes: "Production nightly path for Qwen MTP and Gemma MTP without DFlash or INT8 PTH overlays."
|
||||
|
||||
notes: "Production nightly path for Qwen MTP and Gemma MTP without DFlash or INT8 PTH overlays. Launch exports this SHA as VLLM_NIGHTLY_SHA; VLLM_IMAGE can override the full image ref."
|
||||
|
||||
@@ -19,7 +19,7 @@ if str(REPO_ROOT) not in sys.path:
|
||||
|
||||
os.environ.setdefault("CLUB3090_LOG_LEVEL", "ERROR")
|
||||
|
||||
from scripts.lib.profiles.compat import FitsResult, fits, load_profiles, to_compose_name # noqa: E402
|
||||
from scripts.lib.profiles.compat import FitsResult, ProfileError, fits, load_profiles, to_compose_name # noqa: E402
|
||||
from scripts.lib.profiles.compose_registry import COMPOSE_REGISTRY # noqa: E402
|
||||
|
||||
|
||||
@@ -117,6 +117,44 @@ def _entry_objects(entry: dict, profiles):
|
||||
)
|
||||
|
||||
|
||||
def resolve_engine_pin(profiles, engine_id: str) -> dict[str, str]:
|
||||
"""Resolve EngineProfile.install into compose environment exports."""
|
||||
try:
|
||||
engine = profiles.engines[engine_id]
|
||||
except KeyError as exc:
|
||||
raise ProfileError(f"unknown engine profile `{engine_id}`") from exc
|
||||
|
||||
spec = str(engine.install.get("spec", ""))
|
||||
if engine.install.get("method") != "docker_image" or engine.type != "vllm":
|
||||
raise ProfileError(f"engine {engine_id!r} install.spec is not a docker nightly image: {spec!r}")
|
||||
if ":nightly-" not in spec:
|
||||
raise ProfileError(f"engine {engine_id!r} install.spec is not a docker nightly image: {spec!r}")
|
||||
|
||||
sha = spec.rsplit(":nightly-", 1)[1].strip()
|
||||
if not sha or any(char.isspace() for char in sha):
|
||||
raise ProfileError(f"engine {engine_id!r} has an invalid nightly SHA in install.spec: {spec!r}")
|
||||
return {"VLLM_NIGHTLY_SHA": sha}
|
||||
|
||||
|
||||
def resolve_variant_pin(profiles, variant: str) -> dict[str, str]:
|
||||
entry = COMPOSE_REGISTRY.get(variant)
|
||||
if not entry:
|
||||
raise ProfileError(f"unknown compose variant `{variant}`")
|
||||
return resolve_engine_pin(profiles, entry["engine"])
|
||||
|
||||
|
||||
def _print_env(exports: dict[str, str], fmt: str) -> None:
|
||||
if fmt == "value":
|
||||
print(exports["VLLM_NIGHTLY_SHA"])
|
||||
elif fmt == "json":
|
||||
import json
|
||||
|
||||
print(json.dumps(exports, sort_keys=True))
|
||||
else:
|
||||
for key, value in exports.items():
|
||||
print(f"{key}={value}")
|
||||
|
||||
|
||||
def _run_fits_for_entry(
|
||||
entry: dict,
|
||||
profiles,
|
||||
@@ -312,6 +350,20 @@ def command_validate_variant(args: argparse.Namespace) -> int:
|
||||
return 0
|
||||
|
||||
|
||||
def command_resolve_engine_pin(args: argparse.Namespace) -> int:
|
||||
_quiet_compat_logger()
|
||||
profiles = load_profiles()
|
||||
_print_env(resolve_engine_pin(profiles, args.engine_id), args.format)
|
||||
return 0
|
||||
|
||||
|
||||
def command_resolve_variant_pin(args: argparse.Namespace) -> int:
|
||||
_quiet_compat_logger()
|
||||
profiles = load_profiles()
|
||||
_print_env(resolve_variant_pin(profiles, args.variant), args.format)
|
||||
return 0
|
||||
|
||||
|
||||
def build_parser() -> argparse.ArgumentParser:
|
||||
parser = argparse.ArgumentParser(description="Profile bridge for scripts/launch.sh")
|
||||
sub = parser.add_subparsers(dest="command", required=True)
|
||||
@@ -342,6 +394,16 @@ def build_parser() -> argparse.ArgumentParser:
|
||||
validate.add_argument("--verbose", action="store_true")
|
||||
validate.set_defaults(func=command_validate_variant)
|
||||
|
||||
engine_pin = sub.add_parser("resolve-engine-pin")
|
||||
engine_pin.add_argument("--engine-id", required=True)
|
||||
engine_pin.add_argument("--format", choices=("shell", "json", "value"), default="shell")
|
||||
engine_pin.set_defaults(func=command_resolve_engine_pin)
|
||||
|
||||
variant_pin = sub.add_parser("resolve-variant-pin")
|
||||
variant_pin.add_argument("--variant", required=True)
|
||||
variant_pin.add_argument("--format", choices=("shell", "json", "value"), default="shell")
|
||||
variant_pin.set_defaults(func=command_resolve_variant_pin)
|
||||
|
||||
return parser
|
||||
|
||||
|
||||
@@ -350,7 +412,7 @@ def main(argv: list[str] | None = None) -> int:
|
||||
args = parser.parse_args(argv)
|
||||
try:
|
||||
return int(args.func(args))
|
||||
except LaunchCompatError as exc:
|
||||
except (LaunchCompatError, ProfileError) as exc:
|
||||
print(f"[launch] ERROR: {exc}", file=sys.stderr)
|
||||
return 2
|
||||
|
||||
|
||||
@@ -4,6 +4,8 @@ set -euo pipefail
|
||||
ROOT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/../.." && pwd)"
|
||||
HELPER="${ROOT_DIR}/scripts/lib/profiles/launch_compat.py"
|
||||
GPU_3090='0|RTX_3090|24576|8.6'
|
||||
MTP_SHA="1acd67a795ebccdf9b9db7697ae9082058301657"
|
||||
DFLASH_SHA="e47c98ef7a38792996e452ef53914e21e41928e9"
|
||||
|
||||
assert_contains() {
|
||||
local haystack="$1"
|
||||
@@ -72,4 +74,41 @@ assert_contains "$out" "Pass 1 fits()"
|
||||
assert_contains "$out" "Resolved compose: vllm/long-text"
|
||||
assert_contains "$out" "Pass 2 fits()"
|
||||
|
||||
out="$(python3 "$HELPER" resolve-engine-pin --engine-id vllm-nightly-mtp --format shell)"
|
||||
assert_contains "$out" "VLLM_NIGHTLY_SHA=${MTP_SHA}"
|
||||
|
||||
if out="$(python3 "$HELPER" resolve-engine-pin --engine-id vllm-stable --format shell 2>&1)"; then
|
||||
echo "ASSERTION FAILED: pip-only vllm-stable unexpectedly resolved as a docker nightly" >&2
|
||||
echo "$out" >&2
|
||||
exit 1
|
||||
fi
|
||||
assert_contains "$out" "install.spec is not a docker nightly image"
|
||||
|
||||
out="$(python3 "$HELPER" resolve-variant-pin --variant vllm/dual --format shell)"
|
||||
assert_contains "$out" "VLLM_NIGHTLY_SHA=${MTP_SHA}"
|
||||
|
||||
out="$(python3 "$HELPER" resolve-variant-pin --variant vllm/gemma-dflash --format shell)"
|
||||
assert_contains "$out" "VLLM_NIGHTLY_SHA=${DFLASH_SHA}"
|
||||
|
||||
if command -v docker >/dev/null 2>&1 && docker compose version >/dev/null 2>&1; then
|
||||
out="$(VLLM_NIGHTLY_SHA="$MTP_SHA" docker compose -f "$ROOT_DIR/models/qwen3.6-27b/vllm/compose/dual/docker-compose.yml" config 2>/dev/null)"
|
||||
assert_contains "$out" "image: vllm/vllm-openai:nightly-${MTP_SHA}"
|
||||
|
||||
out="$(VLLM_NIGHTLY_SHA="$MTP_SHA" VLLM_IMAGE=ghcr.io/noonghunna/vllm-club3090:latest docker compose -f "$ROOT_DIR/models/qwen3.6-27b/vllm/compose/dual/docker-compose.yml" config 2>/dev/null)"
|
||||
assert_contains "$out" "image: ghcr.io/noonghunna/vllm-club3090:latest"
|
||||
fi
|
||||
|
||||
out="$(python3 - <<'PY'
|
||||
from scripts.lib.profiles.compat import InstanceSpec
|
||||
from scripts.lib.profiles.estate_cli import compose_env
|
||||
|
||||
mtp = compose_env(InstanceSpec(name="qwen", compose_name="vllm/dual", gpu_indices=(0, 1), port=8010))
|
||||
dflash = compose_env(InstanceSpec(name="gemma", compose_name="vllm/gemma-dflash", gpu_indices=(0, 1), port=8032))
|
||||
print(mtp["VLLM_NIGHTLY_SHA"])
|
||||
print(dflash["VLLM_NIGHTLY_SHA"])
|
||||
PY
|
||||
)"
|
||||
assert_contains "$out" "$MTP_SHA"
|
||||
assert_contains "$out" "$DFLASH_SHA"
|
||||
|
||||
echo "test-launch-compat: ok"
|
||||
|
||||
Reference in New Issue
Block a user