Giter VIP home page Giter VIP logo

deeplake-test's Introduction

Benchmarking DeepLake

This repository contains some simple Python functions to measure the performance of the DeepLake dataloader in PyTorch and Tensorflow.

Building and running the Docker container

PyTorch

The example files can be easily executed within a Docker container:

$ docker build -t deeplake-test:pytorch -f Dockerfile.pytorch .
$ docker run --rm -it --cap-add=sys_admin deeplake-test:pytorch

Tensorflow

Similarly:

$ docker build -t deeplake-test:tensorflow -f Dockerfile.tensorflow .
$ docker run --rm -it --cap-add=sys_admin deeplake-test:tensorflow

Preparing the dataset

Locally in the filesystem

To generate a DeepLake dataset in /data/deeplake-imagenet/train/ from the ImageNet dataset stored in /data/imagenet/train/, go to the src/ directory and execute the following command:

python3 ingest_data.py /data/imagenet/train/ /data/deeplake-imagenet/train/

Ingesting ImageNet dataset in MinIO

If you have a MinIO server listening at http://your_minio_server:9000/, you can store the DeepLake dataset there by executing the following command:

python3 ingest_data.py /data/imagenet/train/ s3://imagenet/train \
  --endpoint-url=http://your_minio_server:9000/ \
  --aws-access-key-id=user --aws-secret-access-key=password

Performance testing with PyTorch

Tests

We have implemented three simple stress tests that try to read as many images as possible from the DeepLake dataset.

  1. loop_read_raw Reads the raw dataset, without decoding the images, straight from the DeepLake dataset variable.
  2. loop_read_pytorch Reads the raw dataset, without decoding the images, via the PyTorch Dataloader, with a configurable number of workers.
  3. loop_read_tensors Reads the dataset via the PyTorch Dataloader, with a configurable number of workers, decodes the images and applies some standard preprocessing steps for the ImageNet dataset (i.e., resize, crop, flip and normalize).

From the local filesystem

Run the tests using the following command:

python3 test_pytorch.py /data/deeplake-imagenet/train/ \
  --epochs=3 --shuffle=True --torch-workers=16 --tens-workers=32

The --torch-workers and --tens-workers parameters adjust the number of workers for the loop_read_pytorch and loop_read_tensors functions, respectively.

From MinIO

Run the tests using the following command:

python3 test_pytorch.py s3://imagenet/train \
  --endpoint-url=http://your_minio_server:9000/ \
  --aws-access-key-id=user --aws-secret-access-key=password \
  --epochs=3 --shuffle=True --torch-workers=16 --tens-workers=32

Performance testing with Tensorflow

Tests

We have implemented two simple stress tests that try to read as many images as possible from the DeepLake dataset.

  1. loop_read_raw Reads the raw dataset, without decoding the images, straight from the DeepLake dataset variable (same as the PyTorch test).
  2. loop_read_tensorflow Reads the raw dataset, without decoding the images, via the Tensorflow Dataloader.
  3. loop_read_tensors Reads the dataset via the Tensorflow Dataloader, decodes the images and applies some standard preprocessing steps for the ImageNet dataset (i.e., random crop, flip and normalize).

From the local filesystem

Run the tests using the following command:

python3 test_tensorflow.py /data/deeplake-imagenet/train/ \
  --epochs=3 --shuffle=True 

From MinIO

Run the tests using the following command:

python3 test_pytorch.py s3://imagenet/train \
  --endpoint-url=http://your_minio_server:9000/ \
  --aws-access-key-id=user --aws-secret-access-key=password \
  --epochs=3 --shuffle=True

License

This repository is licensed under the under the Apache License, Version 2.0. See LICENSE for further details.

deeplake-test's People

Contributors

fversaci avatar

Watchers

 avatar Kostas Georgiou avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.