Skip to main content

Kedro-Accelerator

Kedro pipelines consist of nodes, where an output from one node A can be an input to another node B. The Data Catalog defines where and how Kedro loads and saves these inputs and outputs, respectively. By default, a sequential Kedro pipeline:

  1. runs node A
  2. persists the output of A, often to remote storage like Amazon S3
  3. potentially runs other nodes
  4. fetches the output of A, loading it back into memory
  5. runs node B

Persisting intermediate data sets enables partial pipeline runs (e.g. running node B without rerunning node A) and analysis/debugging of these data sets. However, the I/O in steps 2 and 4 above was not necessary to run node B, given the requisite data was already in memory after step 1. Kedro-Accelerator speeds up pipelines by parallelizing this I/O in the background.

How do I install Kedro-Accelerator?

Kedro-Accelerator is a Python plugin. To install it:

pip install kedro-accelerator

How do I use Kedro-Accelerator?

As of Kedro 0.16.4, TeePlugin—the core of Kedro-Accelerator—will be auto-discovered upon installation. In older versions, hook implementations should be registered with Kedro through the ProjectContext. Hooks were introduced in Kedro 0.16.0.

Prerequisites

The following conditions must be true for Kedro-Accelerator to speed up your pipeline:

  • Your project must use either SequentialRunner or ParallelRunner.

Example

The Kedro-Accelerator repository includes the Iris data set example pipeline generated using Kedro 0.16.1. Intermediate data sets have been replaced with custom SlowDataSet instances to simulate a slow filesystem. You can try different load and save delays by modifying catalog.yml.

To get started, create and activate a new virtual environment. Then, clone the repository and pip install requirements:

git clone https://github.com/deepyaman/kedro-accelerator.git
cd kedro-accelerator
KEDRO_VERSION=0.17.4 pip install -r src/requirements.txt  # Specify your desired Kedro version.

You can compare pipeline execution times with and without TeePlugin. Kedro-Accelerator also provides CachePlugin so that you can test performance using CachedDataSet in asynchronous mode. Assuming parametrized load and save delays of 10 seconds for intermediate datasets, you should see the following results:

Strategy Command Total time Log
Baseline (i.e. no caching/plugins) kedro run 2 minutes Log
TeePlugin kedro run --hooks kedro_accelerator.plugins.TeePlugin 10 seconds (saving all outputs) Log
CachePlugin (i.e. CachedDataSet) with is_async=True kedro run --async --hooks kedro_accelerator.plugins.CachePlugin 30 seconds (saving split_data, train_model, and predict node outputs) Log

Prior to Kedro version 0.17.0, prefix extra hooks passed to kedro run with src. (e.g. src.kedro_accelerator.plugins.TeePlugin).

For a more complete discussion of the above benchmarks, see quantumblacklabs/kedro#420 (comment).

What license do you use?

Kedro-Accelerator is licensed under the MIT License.

Metadata

Release files for kedro-accelerator 0.3.0

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

Source distribution (sdist)

Source distribution for kedro-accelerator 0.3.0
File Size Uploaded
kedro-accelerator-0.3.0.tar.gz 5.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for kedro-accelerator 0.3.0
File Interpreter ABI Platform
kedro_accelerator-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 10.7 kB

Release files / kedro-accelerator-0.3.0.tar.gz

Download URL kedro-accelerator-0.3.0.tar.gz
Size 5.6 kB
Tags Source
SHA-256 checksum
How to use checksums
5d50c5dc19a989e3f743182a73e8c5fab236071d2f664e0582ddf5d49616099e
BLAKE2b-256 checksum
How to use checksums
9ac364f4109214021b3e26d78201577fc5fdaa657fde8b1e212cc18c479df045
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.8.10

Release files / kedro_accelerator-0.3.0-py3-none-any.whl

Download URL kedro_accelerator-0.3.0-py3-none-any.whl
Size 5.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
818761bceff67c85d691decd2d2b9b639e46871763b21a07ded4858f14c94628
BLAKE2b-256 checksum
How to use checksums
34bc31746e9594a4af77c693fcdc08e90dbc0e01bffbe970c6ac33b17614721f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.8.10

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

0.2.0

2 release files

0.1.0

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