Skip to main content

Run Keras models remotely on TPU seamlessly.

Project description

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.

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_remote-0.0.1.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

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

keras_remote-0.0.1-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file keras_remote-0.0.1.tar.gz.

File metadata

  • Download URL: keras_remote-0.0.1.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for keras_remote-0.0.1.tar.gz
Algorithm Hash digest
SHA256 44d3d546043a7899ff133c2150caa28fdae18de3750ddabdb5a5cf6f450ef182
MD5 a13b7ee74b7a0da516b1b106e6c9af81
BLAKE2b-256 55d76142555dc355410a8a9027bc5d0af70d058accab6d0d11a4ee286963bbff

See more details on using hashes here.

File details

Details for the file keras_remote-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: keras_remote-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for keras_remote-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 62bb3237d82bdee6af58be00aada3be3e6c0d397a698daaa8706a2c7597bac53
MD5 7880c44d8230aae59cb18ceaa58499fb
BLAKE2b-256 73b6c2a216d67b37ffd5645715b750fe34d2ccca747d8ba87fe6c1d2a17ffd3b

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