Skip to content

Package GLM MTP3 compute fixes and stream-ordered mesh transport - #219

Closed
FujitsuPolycom wants to merge 26 commits into
mainfrom
codex/glm53-mesh-nvfp4-mtp-head
Closed

Package GLM MTP3 compute fixes and stream-ordered mesh transport#219
FujitsuPolycom wants to merge 26 commits into
mainfrom
codex/glm53-mesh-nvfp4-mtp-head

Conversation

@FujitsuPolycom

@FujitsuPolycom FujitsuPolycom commented Sep 5, 2026

Copy link
Copy Markdown
Owner

Behavior

Status: research-only serving profile with qualified bounded native, GPU stream, serving, restart, and persistent-cache checks for the published image.

The GLM-5.3-Flash-NVFP4-Spark profile uses native MTP3 with an NVFP4/BF16 proposal head and a BF16 target/verifier head. It includes owned deferred weights, independent draft/rejection RNG, shared NVFP4 MoE scales, and the top-k-512 selector. The source lock binds 24 vLLM replacement files, B12X revision ef308bac with three selector overrides from PR316, CUDA 13.3 components, and compute-selection settings. Donor identities, licenses, a readable diff, and exact replacement archives are included.

RoCEnante orders shared staging across caller streams and preserves one-stream-per-capture admission. SIRCL, the hardware-forwarded ring, patched NCCL fallback, and SparkCache retain their documented routing roles. The cache namespace binds compute lock 139f3670 and transport manifest 69313e19.

The startup-memory gate from #222 is merged into main. This draft targets main and preserves those host controls. Compute verification rejects override paths outside the vLLM package and reads/writes JSON as UTF-8. Published image bytes are unchanged; these verifier-tool changes have offline coverage, not rebuilt-image qualification.

Published image

ghcr.io/fujitsupolycom/sparkring-glm53-sparkcache@sha256:67dc0ae453baaae6831ccec1d259b4ef8b236a8b0dc9f747d901b95c66ec1987

Config-image ID: sha256:2e41b1e934a85ff7c21b780532db2f0a0e978df081e52f4ae2bf11f8992fb24f.

Anonymous manifest/config verification and Docker pull passed. The pulled config-image ID is the exact image tested on all four Sparks. The README, quickstart, recipe, source pins, content receipt, registry receipt, and compute-equivalence record identify these artifacts consistently.

Validation

  • Profile CPU suite: 346 passed, three platform-dependent skips. Lint and 500 repository-relative documentation links pass.
  • All 4,891 vLLM, 385 B12X, and 150 SparkCache package files and selected environment values match the compute-tested image. The changed transport has separate GPU checks.
  • Native all-reduce at 4/20/28/64 token rows passes exact BF16 output checks, changed-input graph replay, and per-QP completion reconciliation.
  • GPU stream checks at 4 and 64 rows pass 16 alternating-stream calls with misaligned buffers, two changed-input graph replays, and second-stream capture rejection. run_native.py --mode streams reproduces these checks in a stopped-model test window.
  • An 18-cell 8K/32K/64K C1/C2/C4/C8/C12/C16 matrix and two four-cell repetitions completed cleanly. Results are mixed by cell; the two 64K prefill repetitions measured 2,770 and 2,767 tok/s. No universal speedup is claimed.
  • Deliberately stopping one idle model rank caused all four model ranks to stop within 10.063 seconds. Managed recovery, memory-gated startup, and four-rank readiness passed.
  • The identical 27,274-token recall request returned the correct phrase before and after restart. After restart, 26,624 tokens were external-cache hits, with corresponding restores on all four ranks. Full request time was 11.859 seconds cold and 2.922 seconds restored.

The exact-image record links per-rank and per-cell evidence. All four model containers were healthy at the end of the restore check; rollback artifacts are preserved.

Compatibility and scope

Use the image and source-bound cache namespace together; do not rename entries from another compute composition into it. Reinstall changed host controls while the four-rank model is stopped. Model weights are obtained separately and are not distributed in the image.

Idle rank-loss containment does not establish in-flight stalled-collective containment or resolve upstream RoCEnante issue #313. One persistent recall fixture is not general model-accuracy or all-boundary cache qualification. This change does not enable RoCEnante all-gather, MXFP8 verifier-head quantization, or additional research optimizations.

Saolence and others added 2 commits September 3, 2026 09:47
… bind in the cycle launcher

The four-Spark cycle launcher currently hardcodes --served-model-name
deepseek-v4-flash-0731 and mounts only MODEL_HOST_PATH. Two operator-facing
extensions, both backward compatible:

* SERVED_MODEL_NAME: when set in the per-rank environment (or exported), it
  overrides the model name vLLM advertises and accepts; the default still
  reproduces recipes/deepseek-v4-flash-0731.json. The environment template
  documents the new key next to the other serving values, and the --check
  summary prints the effective name.

* HF hub snapshot model directory: when MODEL_HOST_PATH points into an HF
  hub cache at <repo>/snapshots/<revision>/, every model file is a symlink
  whose relative target ../../blobs/<sha> resolves above the mounted
  snapshot tree. The launcher now requires the sibling blobs directory and
  binds it read-only at /blobs so those targets land on the real weight
  payloads. Plain checkpoint directories are unaffected.

Offline contract tests cover the default name, the override reaching the
rendered command, the snapshot blob bind, the plain-directory no-op, and the
fail-closed missing-blobs path.
Package the tested CUDA 13.3 and B12X compute composition with exact source verification, retain the BF16 verifier head, and isolate its persistent-cache namespace. Publish the immutable image reference with quickstart and repeated benchmark evidence. Validation: 318 CPU tests passed, 3 skipped; ARM64 image verification, exact installed-package parity, and anonymous registry access passed.
@FujitsuPolycom
FujitsuPolycom marked this pull request as ready for review September 5, 2026 18:11
@FujitsuPolycom
FujitsuPolycom requested a lite review from Copilot September 5, 2026 18:34

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

It introduces a new pinned compute supply chain (CUDA/tooling + source archives + offline install) and verification surface where small encoding/path-handling issues and provenance expectations warrant final human review.

Pull request overview

Updates the GLM-5.3 Flash NVFP4-Spark native-MTP3 mesh (research-only) profile to default to a separate runtime NVFP4 proposal head (BF16 activations), and introduces a manifest-bound compute composition (CUDA 13.3 + vLLM overrides + full B12X tree) with stronger in-image verification and reproducible build inputs.

Changes:

  • Add a pinned, offline-installable compute payload (CUDA 13.3 + vLLM override set + B12X b58f34ea) and verify it inside the mesh image.
  • Extend image verification/tests to validate layered vLLM overrides, complete B12X file sets, and required compute-selection environment.
  • Update contracts/docs/records to reflect the NVFP4/BF16 proposal-head behavior, image identity, cache namespace separation, and measurement linkage.
File summaries
File Description
runtime/glm53-spark-mtp3-mesh/verify_mesh_image.py Adds compute composition verification (vLLM layered overrides, complete B12X map, CUDA component + ptxas checks) to device-free image verification.
runtime/glm53-spark-mtp3-mesh/test_image.py Adds unit tests for new verifier helpers and profile pin assertions for compute lock/environment.
runtime/glm53-spark-mtp3-mesh/README.md Documents the NVFP4/BF16 proposal head, updated benchmark linkage, and updated contract scope for the new image composition.
runtime/glm53-spark-mtp3-mesh/public-image.json Updates public image identity/metadata and links compute-equivalence + proposal-head record.
runtime/glm53-spark-mtp3-mesh/pins.json Adds compute pin block and updates cache namespace/compatibility text for the new compute+proposal-head composition.
runtime/glm53-spark-mtp3-mesh/image-receipt.json Updates the content receipt to include compute verification outputs and the new image identity/limitations.
runtime/glm53-spark-mtp3-mesh/IMAGE_BUILD.md Updates build/reproduction flow to include prepared compute context and clarifies proposal-head memory impact and equivalence limits.
runtime/glm53-spark-mtp3-mesh/Dockerfile Installs offline compute payload during build; sets required environment and emits additional labels for compute/proposal-head identity.
runtime/glm53-spark-mtp3-mesh/compute/verify_compute.py Adds a standalone verifier for installed compute state vs. receipt/source lock.
runtime/glm53-spark-mtp3-mesh/compute/test_compute.py Adds CPU tests for compute source-lock invariants, package mapping behavior, and installer failure cases.
runtime/glm53-spark-mtp3-mesh/compute/source-lock.json Introduces the authoritative compute source lock binding vLLM override hashes, B12X identity/file-map hash, CUDA component hashes, and env contract.
runtime/glm53-spark-mtp3-mesh/compute/README.md Documents compute source composition, provenance, offline preparation/install model, and line-ending normalization rationale.
runtime/glm53-spark-mtp3-mesh/compute/prepare_compute_source.py Adds tool to fetch+verify CUDA/B12X inputs and build a prepared, checksum-bound compute context for offline Docker builds.
runtime/glm53-spark-mtp3-mesh/compute/apply_compute.py Adds offline installer that lays down CUDA, patches vLLM via replacement archive, installs B12X, and writes an installed receipt.
runtime/glm53-spark-mtp3-mesh/compute-image-equivalence.json Records compute-equivalence assertion between tested private image and published public image for package files + selected environment.
runtime/glm53-spark-mtp3-mesh/build_image.py Extends context preparation to require and embed a prepared compute directory, and passes compute lock hash into the build.
recipes/glm53-spark-mtp3-managed-mesh-tp4.json Updates recipe to bind compute contract/sha, proposal-head metadata, cache namespace, and evidence status/scope language.
README.md Updates top-level profile descriptions and results table rows to reflect proposal-head configuration and revised record linkage.
performance/records/glm53-flash/spark-mtp3-nvfp4-proposal-head-20260905.md Adds the proposal-head comparison record describing conditions/results/limitations and identities.
performance/records/glm53-flash/spark-mtp3-nvfp4-proposal-head-20260905.json Adds machine-readable proposal-head comparison results and bound identities/receipt hashes.
docs/GLM53_SPARK_MTP3_MESH_QUICKSTART.md Updates quickstart to reflect proposal-head behavior, revised evidence transfer limits, and new image IDs/links.
.gitattributes Adds attributes to preserve binary archive bytes and patch whitespace handling for compute artifacts.
Review details

Suppressed comments (2)

runtime/glm53-spark-mtp3-mesh/compute/prepare_compute_source.py:143

  • prepared-manifest.json is written without an explicit encoding/newline policy. For reproducible receipts (and consistency with other runtime receipts), write it as UTF-8 with \n newlines.
    manifest = destination / "prepared-manifest.json"
    manifest.write_text(json.dumps(prepared, indent=2, sort_keys=True) + "\n")
    return manifest

runtime/glm53-spark-mtp3-mesh/compute/apply_compute.py:149

  • The installed compute receipt is written without an explicit encoding/newline policy. Since downstream verification compares raw bytes and other receipts are written as UTF-8 with \n newlines, this should be made explicit here too.
    receipt.parent.mkdir(parents=True, exist_ok=True)
    receipt.write_text(json.dumps(output, indent=2, sort_keys=True) + "\n")
    return receipt
  • Files reviewed: 22/24 changed files
  • Comments generated: 3
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +8 to +32
from pathlib import Path


def _sha256(path: Path) -> str:
return hashlib.sha256(path.read_bytes()).hexdigest()


def _map_sha256(files: dict[str, str]) -> str:
payload = json.dumps(files, sort_keys=True, separators=(",", ":")).encode()
return hashlib.sha256(payload).hexdigest()


def verify(site_packages: Path, receipt: Path, source_lock: Path) -> dict:
lock = json.loads(source_lock.read_text())
installed = json.loads(receipt.read_text())
lock_hash = _sha256(source_lock)
if installed["source_lock_sha256"] != lock_hash:
raise ValueError("installed receipt uses a different compute source lock")
expected_vllm = {path: result for path, _, result in lock["vllm"]["files"]}
if installed["vllm_overrides"] != expected_vllm:
raise ValueError("installed receipt omits or changes vLLM overrides")
for relative, expected in expected_vllm.items():
actual = _sha256(site_packages / relative)
if actual != expected:
raise ValueError(f"installed vLLM hash mismatch for {relative}: {actual}")
Comment thread runtime/glm53-spark-mtp3-mesh/compute/apply_compute.py
Comment on lines +14 to +16
HERE = Path(__file__).resolve().parent
LOCK = json.loads((HERE / "source-lock.json").read_text())

Preserve per-capture stream admission, sequence shared staging and output copies, and reject images without the pinned compute configuration. Record per-run benchmark variability and bundled vLLM provenance. Validation: 372 CPU tests passed, 21 skipped; ARM64 image content checks and anonymous publication passed. GPU stream/fault validation remains separate from these CPU checks.
@FujitsuPolycom
FujitsuPolycom marked this pull request as draft September 5, 2026 22:55
@FujitsuPolycom FujitsuPolycom changed the title Use NVFP4 MTP proposal heads in the GLM mesh profile Package GLM MTP3 compute fixes and stream-ordered mesh transport Sep 6, 2026
@FujitsuPolycom
FujitsuPolycom changed the base branch from main to codex/managed-launch-memory-gate September 6, 2026 01:05
The cycle launcher retains configured API model names and read-only Hugging Face blob mounts alongside the supported runtime profiles. Validation: 18 offline launcher tests pass.
Managed startup requires sufficient available RAM and contiguous allocator capacity on every rank. Memory preparation refuses active workloads and shares a host-local authorization lock with model startup. Direct managed starts check capacity without compacting memory. Validation: required CI checks pass; 324 local CPU tests pass with three documented skips. The bounded hardware evidence records refusal below threshold and successful four-rank startup after operator-authorized recovery.
The four-Spark launcher accepts a configured API model name and mounts readable sibling blob storage for Hugging Face snapshot checkpoints. Default vLLM arguments are preserved, and the effective model name is printed during input checks. Validation: 18 offline launcher tests and all required CI checks pass. No serving or GPU qualification is claimed.
The operator image builder synchronizes B12X histogram publication before block arrival and increments the kernel compile revision. Rank-zero readiness exercises stochastic sampling and reasoning; liveness detects sustained running requests without output progress. The published child image and checked receipts preserve native-library identities. Validation: required CI checks pass; bounded GB10 publication probes, installed-module tests, numerical checks, and graph replay evidence are recorded. Full-model soak and cold-cache specialization qualification are not claimed. Fixes #224.
Reject absolute, traversing, non-vLLM, and symlinked override paths before reading package bytes. Read JSON as UTF-8 and write receipts as UTF-8 with LF endings. Cache and compute source-lock identities are unchanged; published images are not rebuilt. Validation: five failing path regressions now pass; 16 compute tests and 353 mesh tests pass with one optional native-bundle skip.
@FujitsuPolycom
FujitsuPolycom changed the base branch from codex/managed-launch-memory-gate to main September 6, 2026 18:41
@FujitsuPolycom

Copy link
Copy Markdown
Owner Author

Status: implemented in SparkRing main through merged #236. The GLM MTP3 compute and stream-ordering changes in this PR are incorporated; this PR is closed as superseded by that integration.

The component head 50d46f703c39bdce929a9dccb5cd3cbe534ede99 is an ancestor of #236's tested head 22c8d48522712508de9898a273408993a7410ee9. The squash merge 60910cc6161fb44003bd3e3708c63a1569ecd0c7 has the identical Git tree, 768a6ff65ca25121a016ea355fa0a7c1080c760c. Squashing preserved the complete source tree without marking this component PR merged automatically.

The native-MTP3 cache/checkpoint guide selects the integrated image and deployment inputs. Closing this component PR does not broaden the profile's research-only hardware qualification.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants