Skip to content
Draft
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
48 changes: 48 additions & 0 deletions packages/kumo-engine/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ The base package reads and writes local CSV and Parquet files. Optional extras a
| `text` | Encoding for free-text columns, such as descriptions or reviews, with GloVe 6B 50d word vectors |
| `mlflow` | MLflow run tracking and model registry |
| `sagemaker` | SageMaker managed MLflow |
| `cluster` | Ray for remote snapshot and training-table preparation |
| `pytorch` | (Experimental) `kumo.pytorch`, for training your own PyTorch models on your tables |

Kumo Engine defaults to CPU for training and model loading on native Windows; use WSL2 for NVIDIA GPU workloads. On other platforms it selects an NVIDIA GPU or an Apple silicon GPU when available, and CPU otherwise. To choose the device explicitly, pass `accelerator="gpu"`, `"mps"`, or `"cpu"` to `Trainer`.
Expand Down Expand Up @@ -106,6 +107,53 @@ preparation. To use another build, regenerate the table or reload exported rows
against the desired snapshot. Preparation reports ingestion errors immediately,
including native restrictions on temporal link-prediction evaluation stages.

## Prepare artifacts on Ray

Install the `cluster` extra and initialize a Ray cluster with a CPU-capable
node other than the driver. Configure shared artifact storage once:

```python
import kumo.engine as kumo
import ray

ray.init(address="auto")
cfg = kumo.MLOps("s3://my-bucket/kumo", on_error="raise")
kumo.configure(compute_cluster=kumo.ComputeClusterConfig(mlops=cfg))
snapshot = graph.snapshot()
table = pquery.generate_training_table(snapshot)
```

Preparation runs on one remote producer. Files replicate to every live node
as uploads finish; calls return after all targeted copies pass validation.
Matching concurrent calls share work, and compatible committed artifacts are
reused. Snapshot identity includes timestamp precision and `record_sources`.
Unknown source versions select fresh snapshots. Snapshot storage keeps the
existing export format. Training-table rows are exported through MLOps; the
same generation path ingests them once before the producer publishes and
replicates the extension for sampling.
Workers restore that extension without repeating row ingestion. Extensions are
bound to the exact snapshot build; invalid bindings or corrupt artifacts fail.
A pinned snapshot handle fails if its export generation has been replaced.

All workers need the same engine and native builds, access to source paths and
credential files, and a scratch directory shared by processes on each node.
Pass explicit identities to transport credentials; ambient authentication is
resolved on each worker. Trackers and registries stay outside preparation.
Use `mlops=` and `kumo.mlops` for model training as usual; cluster-routed
preparation rejects both.

For subsequent Ray tasks, pass `kumo.get_compute_cluster_handle()` and
`snapshot.artifact_handle` or `table.artifact_handle`. Inside a task,
`runtime.load(handle)` returns the artifact on that node, including nodes
that joined after publication. Call `kumo.shutdown_compute_cluster()` to stop
owned actors and clear configuration. Ray and stored artifacts are retained.

The opt-in smoke test starts a local Ray cluster with multiple logical nodes:

```bash
KUMO_RAY_INTEGRATION=1 .venv/bin/python -m pytest packages/kumo-engine/test/test_compute_cluster.py -k multinode
```

## Next Steps

### Use a Coding Agent
Expand Down
14 changes: 14 additions & 0 deletions packages/kumo-engine/docs/mlops.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,20 @@ table = kumo.TrainingTable.load_from_connector(cfg, path=f"training_tables/{tabl

`location=` loads the version an alias (or `version=`) names from the tracker's registry, one way on every platform. A loaded model is a `Trainer`; its `result` is the `TrainingResult` (`.id`, `.manifest`, `.metrics`, `.scoring_defaults`, `.holdout_df()`).

Snapshots use the existing `kumo_snapshot.json` export format, including its
native file manifest, checksums, provenance, and generation directory.
Training tables are stored as labeled Parquet rows with a `SPLIT` column and
provenance under `training_tables/<id>/`, just like explicit row exports.

[Ray preparation](../README.md#prepare-artifacts-on-ray) uses the same snapshot
publisher and exports training-table rows once through MLOps. Both local and
remote generation ingest each table against its exact snapshot build before
returning. The producer publishes the already-ingested native extension separately under `native_training_tables/<id>/`. Workers restore
the extension for sampling without loading the MLOps row export or repeating
ingestion. Only these cluster extensions use `kumo_artifact.json` and an inventory.
Cluster preparation propagates generation and transfer failures regardless of
`on_error`.

`TrainingTable.from_source_table()` and row-export loading also normalize and
ingest rows before returning. `fit()` reuses the resulting extension and requires
the same native snapshot build. Reload exported rows against another snapshot to
Expand Down
27 changes: 16 additions & 11 deletions packages/kumo-engine/kumo/engine/__init__.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
# SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES.
# All rights reserved.
# SPDX-License-Identifier: Apache-2.0
r"""Local, in-process relational deep learning with Kumo.
"""Relational deep learning with local training and optional Ray preparation.

No `Backend` protocol, no `set_backend`, no remote/hosted mode, no
hosted project.
There is nothing to call analogous to the cloud SDK's
`kumoai_studio.init(url=..., api_key=...)`: connectors and tables are constructed
and threaded through directly (`Table`, `Graph`, `Connector` subclasses), and
`Graph`/`Trainer` objects carry their own scratch-directory identity, so no
process-wide setup call is *required* before use. `configure(...)` is the one
*optional* one -- see `kumo.engine.config` -- for pointing the shared scratch-
directory root (DiskGraph ingest, GNN training) at, e.g., a local NVMe SSD
mount.
Construct connectors, graphs, and trainers directly. ``configure`` selects a
scratch root and, optionally, a compute cluster for preparing shared snapshots
and native training tables.
"""

import sys
Expand All @@ -35,6 +28,13 @@
from kumoapi.table import Column

from kumo.engine import _quiet # noqa: F401
from kumo.engine._artifact_repository import ArtifactHandle
from kumo.engine._compute_cluster import (
ComputeClusterConfig,
ComputeClusterHandle,
get_compute_cluster_handle,
shutdown_compute_cluster,
)
from kumo.engine._manifest import (
ModelManifest,
PredictionManifest,
Expand Down Expand Up @@ -92,6 +92,11 @@
"ADLSIdentity",
"__version__",
"configure",
"ArtifactHandle",
"ComputeClusterConfig",
"ComputeClusterHandle",
"get_compute_cluster_handle",
"shutdown_compute_cluster",
"install_skills",
"EvaluationResult",
"DriftReport",
Expand Down
Loading
Loading