Skip to main content

Run Keras models remotely on TPU seamlessly.

Project description

Kinetic

License Python

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. Switch to @kinetic.submit() 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.

Install

uv pip install keras-kinetic

This installs both the decorator and the kinetic CLI.

One-time setup

If nobody on your team has provisioned a Kinetic cluster yet, run:

kinetic up

This enables the required GCP APIs, creates an Artifact Registry repository, provisions a GKE cluster with an accelerator node pool, and configures local Docker / kubectl access. Run kinetic down when you're finished to tear everything back down.

Recommended first run

export KINETIC_PROJECT="your-gcp-project-id"
python examples/fashion_mnist.py

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 submit() 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

Kinetic reads KINETIC_PROJECT (required), KINETIC_ZONE, KINETIC_CLUSTER, and a handful of other environment variables. The short version:

export KINETIC_PROJECT="your-project-id"      # required
export KINETIC_ZONE="us-central1-a"           # optional
export KINETIC_CLUSTER="kinetic-cluster"      # optional

The full surface — every variable, every CLI flag, and how the precedence rules combine them — 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.2.tar.gz (259.6 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.2-py3-none-any.whl (202.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for keras_kinetic-0.0.2.tar.gz
Algorithm Hash digest
SHA256 274755fc8fcbe6cfefd05989849df583666b8f9f5af5bb43a948d115b47e9441
MD5 c12453bab7974b80cd1adf692e6126d7
BLAKE2b-256 ce1dab61f87f9fc284769bec8a50f0954087c16548dd641d2764db8b59c8c05a

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for keras_kinetic-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 55bb9764d5947d314d214a6dff23f5f98a8eeed4fa8b509ece5b47c2147654cf
MD5 64b4649f7952b595f3f6103669d2c211
BLAKE2b-256 90da24e290bfa86c446b4f72411b606db915fe5a7b8d2e7d4b2c3d0a4828f7e1

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