Skip to main content

Keras Remote

Run Keras models remotely on TPU as seamlessly as running the same code locally.

Prerequisites

  1. Google Cloud SDK: Install the gcloud CLI.
  2. Authentication: Run gcloud auth login and gcloud auth application-default login.
  3. Permissions: Ensure your GCP user has permissions to create and manage TPU VMs.

Installation

pip install -r requirements.txt

Running the Demo

The demo_train.py script demonstrates how to run a Keras model on a remote TPU.

# Optional: Set your GCP project and zone
export KERAS_REMOTE_PROJECT="your-project-id"
export KERAS_REMOTE_ZONE="us-central1-f"  # or other zones like europe-west4-a

python demo_train.py

Note: TPU availability varies by zone. If you encounter a RESOURCE_EXHAUSTED error, try a different zone or accelerator type (e.g., v2-8 vs v3-8).

The @keras_remote.run decorator handles:

  1. Packaging your local code.
  2. Provisioning (or finding) a TPU VM.
  3. Uploading your code and dependencies.
  4. Executing the function inside a Docker container on the TPU VM.

Metadata

Release files for keras-remote 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for keras-remote 0.0.1
File Size Uploaded
keras_remote-0.0.1.tar.gz 11.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for keras-remote 0.0.1
File Interpreter ABI Platform
keras_remote-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 18.6 kB

Release files / keras_remote-0.0.1.tar.gz

Download URL keras_remote-0.0.1.tar.gz
Size 11.7 kB
Tags Source
SHA-256 checksum
How to use checksums
44d3d546043a7899ff133c2150caa28fdae18de3750ddabdb5a5cf6f450ef182
BLAKE2b-256 checksum
How to use checksums
55d76142555dc355410a8a9027bc5d0af70d058accab6d0d11a4ee286963bbff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.7

Release files / keras_remote-0.0.1-py3-none-any.whl

Download URL keras_remote-0.0.1-py3-none-any.whl
Size 6.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
62bb3237d82bdee6af58be00aada3be3e6c0d397a698daaa8706a2c7597bac53
BLAKE2b-256 checksum
How to use checksums
73b6c2a216d67b37ffd5645715b750fe34d2ccca747d8ba87fe6c1d2a17ffd3b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.7

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page