• Stars
    star
    137
  • Rank 266,121 (Top 6 %)
  • Language
    Python
  • License
    BSD 3-Clause "New...
  • Created over 9 years ago
  • Updated almost 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Caching based on computation time and storage space

Caching for Analytic Computations

Humans repeat stuff. Caching helps.

Normal caching policies like LRU aren't well suited for analytic computations where both the cost of recomputation and the cost of storage routinely vary by one million or more. Consider the following computations

# Want this
np.std(x)        # tiny result, costly to recompute

# Don't want this
np.transpose(x)  # huge result, cheap to recompute

Cachey tries to hold on to values that have the following characteristics

  1. Expensive to recompute (in seconds)
  2. Cheap to store (in bytes)
  3. Frequently used
  4. Recenty used

It accomplishes this by adding the following to each items score on each access

score += compute_time / num_bytes * (1 + eps) ** tick_time

For some small value of epsilon (which determines the memory halflife.) This has units of inverse bandwidth, has exponential decay of old results and roughly linear amplification of repeated results.

Example

>>> from cachey import Cache
>>> c = Cache(1e9, 1)  # 1 GB, cut off anything with cost 1 or less

>>> c.put('x', 'some value', cost=3)
>>> c.put('y', 'other value', cost=2)

>>> c.get('x')
'some value'

This also has a memoize method

>>> memo_f = c.memoize(f)

Install

Cachey is on PyPI and Conda-forge:

$ pip install cachey  # option 1
$ conda install cachey -c conda-forge  # option 2

Or install from source

$ python setup.py install  # option 1
$ pip install -e .  # option 2 (best for development)

Status

Cachey is new and not robust.

More Repositories

1

dask

Parallel computing with task scheduling
Python
12,531
star
2

dask-tutorial

Dask tutorial
Jupyter Notebook
1,832
star
3

distributed

A distributed task scheduler for Dask
Python
1,576
star
4

dask-ml

Scalable Machine Learning with Dask
Python
898
star
5

dask-examples

Easy-to-run example notebooks for Dask
Jupyter Notebook
373
star
6

dask-kubernetes

Native Kubernetes integration for Dask
Python
311
star
7

dask-labextension

JupyterLab extension for Dask
TypeScript
311
star
8

dask-searchcv

dask-searchcv is now part of dask-ml: https://github.com/dask/dask-ml
Python
240
star
9

dask-jobqueue

Deploy Dask on job schedulers like PBS, SLURM, and SGE
Python
234
star
10

dask-docker

Docker images for dask
Jupyter Notebook
231
star
11

dask-image

Distributed image processing
Python
210
star
12

dask-xgboost

Python
162
star
13

hdfs3

A wrapper for libhdfs3 to interact with HDFS from Python
Python
136
star
14

dask-gateway

A multi-tenant server for securely deploying and managing Dask clusters.
Python
136
star
15

dask-cloudprovider

Cloud provider cluster managers for Dask. Supports AWS, Google Cloud Azure and more...
Python
134
star
16

dask-ec2

Start a cluster in EC2 for dask.distributed
Python
106
star
17

partd

Concurrent appendable key-value storage
Python
105
star
18

dask-tensorflow

Python
93
star
19

helm-chart

Helm charts for Dask
YAML
91
star
20

dask-expr

Python
86
star
21

dask-lightgbm

Python
79
star
22

dask-glm

Python
76
star
23

zict

Useful Mutable Mappings
Python
69
star
24

dask-yarn

Deploy dask on YARN clusters
Python
69
star
25

dask-gke

kubernetes setup to bootstrap distributed on google container engine
Python
67
star
26

old-dask-examples

Collection of dask example notebooks
Jupyter Notebook
57
star
27

knit

Deprecated, please use https://github.com/jcrist/skein or https://github.com/dask/dask-yarn instead
Python
53
star
28

dask-mpi

Deploy Dask using MPI4Py
Python
52
star
29

dask-stories

Python
40
star
30

dask-drmaa

Deploy Dask on DRMAA clusters
Python
40
star
31

dask-blog

Dask development blog
HTML
30
star
32

crick

Streaming and approximate algorithms. WIP, use at own risk.
Python
24
star
33

community

For general discussion and community planning. Discussion issues welcome.
20
star
34

mtprof

Thread-aware Python profiler hack
Python
17
star
35

dask-benchmarks

asv benchmarks for dask projects
Python
17
star
36

pandas-streaming

Python
16
star
37

dask-tutorial-infrastructure

Cluster for the Dask Tutorial.
Dockerfile
11
star
38

old-dask-yarn

Deprecated, please use https://github.com/jcrist/skein or https://github.com/dask/dask-yarn instead
Python
7
star
39

governance

The governance process and model for Dask
7
star
40

dask-sphinx-theme

Sphinx theme for Dask documentation
Python
6
star
41

dask-ml-benchmarks

Python
5
star
42

dask.github.io

Dask Website
HTML
5
star
43

scipy-tutorials-2018

5
star
44

design-docs

Experimental repo for proposals of future work
2
star
45

.github

2
star
46

dask-org

General dask resources that aren't code
Jupyter Notebook
2
star
47

marketing

Resources and guidelines for marketing Dask
Python
1
star
48

dask-gateway-helm-repo

Repository holding published dask-gateway helm charts
1
star
49

parquet-integration

Integration tests for various parquet readers and writers
Python
1
star