Skip to main content

Run Keras models remotely on TPU seamlessly.

Project description

Kinetic

License Python PyPI - Version

Run Keras and JAX workloads on cloud TPUs and GPUs with a simple decorator. No infrastructure management required.

import kinetic

@kinetic.run(accelerator="tpu-v5e-1")
def train_model():
    import keras
    model = keras.Sequential([...])
    model.fit(x_train, y_train)
    return model.history.history["loss"][-1]

# Executes on a TPU v5e-1 slice, returns the result locally
final_loss = train_model()

Why Kinetic

  • Simple remote execution. A @kinetic.run() decorator runs the function on the accelerator you ask for and returns the result. Nothing else changes about your code.
  • Detached jobs. Use func.run_async() for long runs. You get a JobHandle back — poll status, tail logs, collect the result later, or reattach from another machine entirely.
  • Data and checkpoint support. Wrap inputs in kinetic.Data(...) to ship local files (or stream from GCS) into the job. Write durable outputs and resumable checkpoints under KINETIC_OUTPUT_DIR.

Documentation

Comprehensive documentation is available at: https://kinetic.readthedocs.io

Install

uv pip install "keras-kinetic[cli]"

The base keras-kinetic package installs the @kinetic.run() decorator. The [cli] extra adds the dependencies the kinetic CLI needs to provision and manage infrastructure. Drop the [cli] extra only if you just need to submit jobs against an already-provisioned cluster.

One-time setup

kinetic init

This detects your local environment, then either joins an existing Kinetic cluster in the project (your own or a teammate's — discovery goes through the shared state bucket) or walks you through creating a new one. It ends by saving a profile that becomes your active context — subsequent commands pick up project, zone, and cluster automatically.

Behind the scenes, the Create path runs kinetic up to enable APIs, provision a GKE cluster with an accelerator node pool, and configure local Docker / kubectl access. Run kinetic down when you're done.

Recommended first run

python examples/fashion_mnist.py

No environment variables needed — kinetic init set an active profile. The first run takes ~5 minutes (it builds a container image with your dependencies via Cloud Build). Subsequent runs with unchanged dependencies start in under a minute.

For the full first-run walkthrough, see the Getting Started guide.

Where to go next

Question Where to look
How do I get my first job running? Getting Started
When should I use run_async() instead of run()? Detached Jobs
How do I ship data and persist outputs? Data and Checkpointing
Bundled vs prebuilt vs custom image — which one? Execution Modes
Something's broken; where do I start? Troubleshooting

Configuration

The recommended way to configure Kinetic is via a profile — the named context that kinetic init creates and kinetic profile ls | use manages. For ad-hoc overrides, every profile field also has a KINETIC_* env-var equivalent (KINETIC_PROJECT, KINETIC_ZONE, KINETIC_CLUSTER, KINETIC_NAMESPACE) and a matching CLI flag.

Precedence is: CLI flag > KINETIC_* env var > active profile > built-in default.

The full surface — every variable, every CLI flag, and the profile model — lives in the Configuration reference.

Contributing

See the Contributing guide.

License

Apache 2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

keras_kinetic-0.0.3.tar.gz (308.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

keras_kinetic-0.0.3-py3-none-any.whl (242.9 kB view details)

Uploaded Python 3

File details

Details for the file keras_kinetic-0.0.3.tar.gz.

File metadata

  • Download URL: keras_kinetic-0.0.3.tar.gz
  • Upload date:
  • Size: 308.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.5

File hashes

Hashes for keras_kinetic-0.0.3.tar.gz
Algorithm Hash digest
SHA256 5d3d076f39a853234f3a2de0a598f86adc47c80b10b7c7802b9bba4f6aed6ac5
MD5 f39b3dcc2379fe8ec255be642bcfd08a
BLAKE2b-256 c1ec2055b77b08463886d60c79e8fa1e44c8b75869f1cbf49408dd6b575d1cff

See more details on using hashes here.

File details

Details for the file keras_kinetic-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: keras_kinetic-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 242.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.5

File hashes

Hashes for keras_kinetic-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 05ca65aa5fd0ff8556cce7ab211a321415973da132d7b85ac3083ad59d87bece
MD5 58980c6a8a68f49927b636ecf0ff2d84
BLAKE2b-256 18c57805bf6f5cc210bcc0bf8ebf295455dffb288f4fb499b5c5611c0ae64e11

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page