Repository navigation
Conversation
TensorFold's native ranks must be listening before rank 0 starts serving,
which deadlocks the historical head-first native path. Add a runtime hook
native_start_order() ("head_first" by default, unchanged for every existing
runtime) and a native_rendezvous_port_span() hook so an engine that also opens
port+1 gets a contiguous reservation instead of a single free port.
The native orchestrator's exec blocks are split into helpers used by both
orders; the default path keeps the head-first gate and its logging. Tests cover
the unchanged path, workers-first ordering, contiguous port spans and the
existing no-rendezvous case.
… lane Add two runtimes for the TensorFold Zig/CUDA engine: * tensorfold: upstream release (pinned image) solo on one GB10, NFS/pre-placed checkpoints through the existing absolute-model mechanism, and native TP2 for the engine families that place their own ranks (glm and nemotron) via TF_*_RANK/TF_*_WORLD + NCCL_COMM_ID. Workers start before rank 0; a recipe command template is refused for TP because the follower ranks take different argv. * tensorfold-dsv41: experimental DeepSeek-V4.1-Flash TP2/TP4 on the community fork (bertholomus/TensorFold @ 3ff3b2a + the tonyd2wild patches). Rank 0 runs tensorfold-native; followers run tf-dsv41-lanes from a prepared bundle with per-rank caches, kernel kit and Engram tables. Ship the pinned image definitions and build workflows for both runtimes, the one-time bundle preparation script, example recipes (solo, GLM/Nemotron TP2, DeepSeek TP2/TP4), a drift guard between the image pins and the platform defaults, and docs/TENSORFOLD.md with the NFS/TP limits and a hardware validation checklist. The monitor colorizer alias covers tensorfold-dsv41 too.
validate_recipe returns list[str | RecipeIssue] in the base contract; annotate both new runtimes accordingly. Also add the upstream image README.
The blanket *.env ignore silently excluded docker/tensorfold{, -dsv41}/image.env
from the branch, so the image workflows could not source their pins. Add explicit
negations next to the RDMA test image exception and add the missing files.
|
Thanks for the PR. Happy to add runtimes and tensorflow seems like it could be relevant to add. Some obvious items that I noticed pretty much immediately:
|
The TP2 and TP4 deployments use different fork branches and patch sets. The shared Dockerfile now takes TF_SHA/PATCH_SET, image.env pins both (3ff3b2a/tp2 and 5940208/tp4), the build script and CI matrix build both, and the TP4 recipe names its image explicitly because the platform default stays on the TP2 tag. The TP4 environment also needs TF_RDMA_GID (the TP2 branch spells it TF_RDMA_GID_INDEX), TF_DS_SERVED_K=solo, and the 2D sampling/pool settings; those are covered by the recipe's tf_env and the runtime defaults. Both image variants were built locally on x86_64 (Zig+CUDA compile ~193 s each) and their binaries/venv inspected.
A DGX Spark's Docker Engine may not ship the buildx plugin. For a native local build the classic docker builder is enough; keep buildx for push/cross builds and pass every pin through --build-arg in the fallback.
Address review feedback: - Remove the Dockerfile/build-script/workflow definitions and the example recipes from this repository. Runtime images are built outside sparkrun, like the other first-party runtime images; the platform default still names the upstream image tag and the DeepSeek fork requires an explicit container: (built externally) that validation enforces. - Collapse tensorfold-dsv41 into the single tensorfold runtime. The DeepSeek-V4.1 fork is now tf_family: dsv41 inside the same plugin: only its command shape, bundle validation and follower binary differ. No duplicate RuntimePlugin class, no second platform entry, no alias. Docs, tests, changelog and the recipes table are updated for the single runtime; the deep bundle/preparation details and the hardware checklist stay in docs/TENSORFOLD.md.
|
Thanks for the review — both points are addressed in
The native orchestration hook ( One open question: the DGX Spark platform default still names I have no GB10 hardware in this environment, so this is still awaiting a hardware run (solo → NFS → TP2 → DeepSeek TP2/TP4). Tests/lint/pyright pass locally; the latest commit's GitHub workflows likely need approval for the fork PR. Happy to adjust the split/scope further. |
The shared launcher calls generate_command() even for native clusters and only requires a non-empty string; rank argv still comes from generate_node_command(). The dsv41 family raised there, so every multi-node DeepSeek launch failed before distribution. Return the rank-0 serve shape for is_cluster=True and keep solo dsv41 refused. Found while dry-running a real TP2 launch on two DGX Sparks.
When an image exists only on the targets, disable container distribution so the launcher does not try to pull/save it from the control machine; each target's local tag is still probed before serving.
The runtime already drives _run_native_cluster, but inherited cluster_strategy() returned 'ray'. That made get_head_container_name() look for <id>_head while the native launcher names the ranks <id>_node_N: the engine came up cleanly but the readiness observer inspected a container that does not exist, so a healthy TP2 launch still exited non-zero. Declaring 'native' fixes readiness and selects the file-backed log tail used by the sleep-infinity + exec path. Verified on two GB10 Sparks: readiness now reports TTR 76.6s and the run exits 0.
Hardware validation: DeepSeek-V4.1-Flash TP2 on 2× DGX SparkThis PR is not just dry-run tested anymore. I ran the Environment
No packages were installed on either Spark. Everything ran through Docker and a control-side Python venv; the hosts' apt history is untouched. Launch.venv/bin/sparkrun -v run tensorfold-dsv41-flash-tp2.yaml --cluster default --no-follow
# RUN_RC=0Recipe shape: Results
Bugs found and fixed during the run
Caveats / follow-ups
Checklist
|
The dsv41 loader already accepted cache_dir/kit_dir/engram_dir/token_map, but they were not in known_config_keys(), so every split bundle printed a 'defaults the runtime does not understand' warning. List them and document the latency-motivated split: Engram on each node's local NVMe, model/rank caches/kit on the shared NFS bundle, with an executor identity mount.
--metrics-open and the new --dashboard flag belong to the serving rank: the workers have no HTTP listener and the DeepSeek follower binary takes a different argv. Emit both only when bind=True, map dashboard from the recipe, and document it. Verified /metrics on the live TP2 server; enables /dashboard and /stats.
The PR targets develop-next; without this merge GitHub reports the branch as conflicting. Only the Unreleased CHANGELOG block conflicted (both sides add entries); keep both. Targeted runtime/orchestrator/monitor tests pass after the merge.
The image definitions are intentionally not part of this PR, so the docker/tensorfold*/image.env exceptions and their test reference no longer exist; keep only the pre-existing RDMA pin exception.
|
Status after resolving the
So the remaining blockers are (a) that pre-existing |
Pick up the latest develop-next tip (rdma-test, model-cache and monitor fixes); keep the TensorFold CHANGELOG entries alongside the base ones. Only CHANGELOG.md conflicted.
Add a jayleaton engine variant to the existing TensorFold runtime. It targets the Jayleaton Zig fork (tensorfold-dsv41 / tf-dsv41-m1), TP=2 only, with its own TF_DSV41 serving profile, rank order, assets and per-rank Engram/prepared/cache layout. The model pack stays pre-placed (NFS or an HF-cache path); the engine image and AOT assets remain external to sparkrun. The family keeps the existing served-model name/port contract and is covered by command, env, validation and startup-order tests plus a docs section and changelog entry.
|
Jayleaton Zig engine family validated on the two DGX Sparks (commit 1705127).
The runtime unit tests ( |
The current Jayleaton pin installs tf-dsv41 (not tf-dsv41-m1) and its rank-1 entry point is 'tf-dsv41 follow PACK ASSETS'. Point the jayleaton family at the new binary and update the version probe/test. Verified by rebuilding the latest pin on the Spark and serving DeepSeek-V4.1 through sparkrun.
Drop tf_family, the dsv41 prepared-bundle path, and the Jayleaton engine family. TensorFold is now one upstream runtime: solo, NFS/pre-placed checkpoints, and native TP via the engine's own --tp/--rank/--master flags. Add the runtime.tensorfold feature gate and rewrite the tests/docs around the upstream launch contract.
|
Upstream-only refactor is ready for review. What changed:
Validation:
CI:
|
TensorFold runtime (upstream-only)
Adds a first-class
tensorfoldruntime for the upstream TensorFold native CUDA server.tensorfold-native serve <model> --host ... --port ....model:andcluster_config.resolved_model_pathpath — no download or distribution, identity-mounted into the container.--tp/--rank/--master/--master-portflags: one rank per host, followers start before rank 0, and the engine remains the authority on which worlds a model supports.container:or use the platform default.runtime.tensorfoldfeature flag and keeps the upstream API/readiness surface (Chat/Completions, Responses, Anthropic Messages,/health).The runtime is deliberately upstream-only: there is no
tf_family, no per-model family layer, and no out-of-tree DeepSeek/Jayleaton bundle path in this PR.Validation
pytest tests/test_runtime_tensorfold.py tests/test_features.py tests/test_platforms.py tests/test_launch_env.py tests/test_recipe.py tests/test_recipe_validation.py— 584 passed.ruff checkclean.