Skip to navigation

Compute Sessions

View as Markdown

kumoai.Session(compute=None) is a no-op context manager: it creates no backend session. The Kumo service does not currently support shared backend compute sessions.

The SDK still defines ComputeType.DATABRICKS_JOB_CLUSTER, but current Kumo deployments do not support starting shared-cluster sessions.

Do not pass ComputeType.DATABRICKS_JOB_CLUSTER expecting the service to create or reuse a Databricks job cluster. The current service rejects shared-cluster session creation.

Use the no-op context manager

Session() defaults to compute=None. You can keep it in shared notebooks or scripts without changing how the enclosed SDK operations run.

import kumoai as kumo
kumo.init(url="https://<customer_id>.kumoai.cloud/api", api_key="<api_key>")
with kumo.Session():
training_table = pquery.generate_training_table(non_blocking=False)
training_job = trainer.fit(
graph=graph,
train_table=training_table,
non_blocking=False,
)

Entering this context does not create a backend session. Each enclosed operation uses its normal compute lifecycle.

No-op behavior

With compute=None, the context manager:

  • does not request a backend session;
  • does not create, reuse, release, or auto-expire shared compute;
  • does not attach a shared session ID to SDK requests;
  • returns control to the enclosed SDK operations without changing their behavior.

This keeps code portable across environments or future deployments that support shared-session compute.

Unsupported shared compute type

ComputeType.DATABRICKS_JOB_CLUSTER remains available in the SDK API, but it does not indicate that the active Kumo deployment can provide shared compute.

Passing this compute type causes the SDK to request a backend session. Current deployments reject that request because Databricks shared job-cluster sessions are no longer supported, and the SDK surfaces the failure as a RuntimeError.

# This compute type is defined by the SDK but unsupported by current deployments.
compute = kumo.ComputeType.DATABRICKS_JOB_CLUSTER

Keep compute=None unless Kumo documents shared-session support for your deployment.

Migrating existing session code

If an existing workflow passes DATABRICKS_JOB_CLUSTER, remove that compute argument:

# Current supported behavior: a no-op context manager.
with kumo.Session():
trainer.fit(graph=graph, train_table=training_table)

Removing the compute argument does not make the enclosed operations share a cluster. It only allows them to run with their normal independent compute lifecycle.

  • kumo.Session(compute=None): no-op context manager that does not create a backend session.
  • kumo.ComputeType.DATABRICKS_JOB_CLUSTER: SDK enum value retained even though current deployments do not support shared-cluster sessions.