Skip to main content

Simple, high-speed batch data reader for ML applications.

Project description

Faucet ML

Faucet ML is a Python package that enables high speed mini-batch data reading & preprocessing from BigQuery for machine learning model training.

Faucet ML is designed for cases where:

  • Datasets are too large to fit into memory
  • Model training requires mini-batches of data (SGD based algorithms)


  • High speed batch data reading from BigQuery
  • Automatic feature identification and preprocessing via. PyTorch
  • Integration with Feast feature store (coming soon)


pip install faucetml

More about Faucet

Many training datasets are too large to fit in memory, but model training would benefit from using all of the training data. Naively issuing 1 query per mini-batch of data is unnecessarily expensive due round-trip network costs. Faucet is a library that solves these issues by:

  • Fetching large "chunks" of data in non-blocking background threads
    • where chunks are much larger than mini-batches, but still fit in memory
  • Caching chunks locally
  • Returning mini-batches from cached chunks in O(1) time


See examples for detailed ipython notebook examples on how to use Faucet.

# initialize the client
fml = get_client(
    chunk_size=1024 * 10000,
# train & test
for epoch in range(2):

    # training loop
    batch = fml.get_batch()
    while batch is not None:
        batch = fml.get_batch()

    # evaluation loop
    batch = fml.get_batch(eval=True)
    while batch is not None:
        batch = fml.get_batch(eval=True)

Future features

  • Support more data warehouses (redshift, hive, etc.)
  • Support reading features & preprocessing specs from Feast

Suggestions for other features? Open an issue and let us know.

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

faucetml-0.0.2.tar.gz (14.7 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page