All Projects → uber → Fiber

uber / Fiber

Licence: apache-2.0
Distributed Computing for AI Made Simple

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Fiber

distex
Distributed process pool for Python
Stars: ✭ 101 (-88.34%)
Mutual labels:  multiprocessing, distributed-computing
Construct
JavaScript Digital Organisms simulator
Stars: ✭ 17 (-98.04%)
Mutual labels:  distributed-computing
Hvpp
hvpp is a lightweight Intel x64/VT-x hypervisor written in C++ focused primarily on virtualization of already running operating system
Stars: ✭ 637 (-26.44%)
Mutual labels:  sandbox
See
Sandboxed Execution Environment
Stars: ✭ 770 (-11.09%)
Mutual labels:  sandbox
Judge Server
Judging backend server for the DMOJ online judge.
Stars: ✭ 648 (-25.17%)
Mutual labels:  sandbox
Lizardfs
LizardFS is an Open Source Distributed File System licensed under GPLv3.
Stars: ✭ 793 (-8.43%)
Mutual labels:  distributed-computing
Hydra
A light-weight library for building distributed applications such as microservices
Stars: ✭ 611 (-29.45%)
Mutual labels:  distributed-computing
Sqliv
massive SQL injection vulnerability scanner
Stars: ✭ 840 (-3%)
Mutual labels:  multiprocessing
Hashtopolis
A Hashcat wrapper for distributed hashcracking
Stars: ✭ 835 (-3.58%)
Mutual labels:  distributed-computing
Imgp
📸 High-performance cli batch image resizer and rotator
Stars: ✭ 744 (-14.09%)
Mutual labels:  multiprocessing
Future
🚀 R package: future: Unified Parallel and Distributed Processing in R for Everyone
Stars: ✭ 735 (-15.13%)
Mutual labels:  distributed-computing
Ksm
A fast, hackable and simple x64 VT-x hypervisor for Windows and Linux. Builtin userspace sandbox and introspection engine.
Stars: ✭ 673 (-22.29%)
Mutual labels:  sandbox
Distributed Consensus Reading List
A long list of academic papers on the topic of distributed consensus
Stars: ✭ 803 (-7.27%)
Mutual labels:  distributed-computing
Rain
Framework for large distributed pipelines
Stars: ✭ 645 (-25.52%)
Mutual labels:  distributed-computing
Stagy
Stagy is a tool for quick deployment of staging environments.
Stars: ✭ 19 (-97.81%)
Mutual labels:  sandbox
Transient
A full stack, reactive architecture for general purpose programming. Algebraic and monadically composable primitives for concurrency, parallelism, event handling, transactions, multithreading, Web, and distributed computing with complete de-inversion of control (No callbacks, no blocking, pure state)
Stars: ✭ 617 (-28.75%)
Mutual labels:  distributed-computing
Complex Yolov4 Pytorch
The PyTorch Implementation based on YOLOv4 of the paper: "Complex-YOLO: Real-time 3D Object Detection on Point Clouds"
Stars: ✭ 691 (-20.21%)
Mutual labels:  multiprocessing
Smartsql
SmartSql = MyBatis in C# + .NET Core+ Cache(Memory | Redis) + R/W Splitting + PropertyChangedTrack +Dynamic Repository + InvokeSync + Diagnostics
Stars: ✭ 775 (-10.51%)
Mutual labels:  distributed-computing
Emofishes
Emofishes is a collection of proof of concepts that help improve, bypass or detect virtualized execution environments (focusing on the ones setup for malware analysis).
Stars: ✭ 11 (-98.73%)
Mutual labels:  sandbox
Deer Executor
An executor for online judge —— 基于Go语言实现的代码评测工具
Stars: ✭ 23 (-97.34%)
Mutual labels:  sandbox

build

drawing

Project Home   Blog   Documents   Paper   Media Coverage

Join Fiber users email list [email protected]

Fiber

Distributed Computing for AI Made Simple

This project is experimental and the APIs are not considered stable.

Fiber is a Python distributed computing library for modern computer clusters.

  • It is easy to use. Fiber allows you to write programs that run on a computer cluster level without the need to dive into the details of computer cluster.
  • It is easy to learn. Fiber provides the same API as Python's standard multiprocessing library that you are familiar with. If you know how to use multiprocessing, you can program a computer cluster with Fiber.
  • It is fast. Fiber's communication backbone is built on top of Nanomsg which is a high-performance asynchronous messaging library to allow fast and reliable communication.
  • It doesn't need deployment. You run it as the same way as running a normal application on a computer cluster and Fiber handles the rest for you.
  • It it reliable. Fiber has built-in error handling when you are running a pool of workers. Users can focus on writing the actual application code instead of dealing with crashed workers.

Originally, it was developed to power large scale parallel scientific computation projects like POET and it has been used to power similar projects within Uber.

Installation

pip install fiber

Check here for details.

Quick Start

Hello Fiber

To use Fiber, simply import it in your code and it works very similar to multiprocessing.

import fiber

if __name__ == '__main__':
    fiber.Process(target=print, args=('Hello, Fiber!',)).start()

Note that if __name__ == '__main__': is necessary because Fiber uses spawn method to start new processes. Check here for details.

Let's take look at another more complex example:

Estimating Pi

import fiber
import random

@fiber.meta(cpu=1)
def inside(p):
    x, y = random.random(), random.random()
    return x * x + y * y < 1

def main():
    NUM_SAMPLES = int(1e6)
    pool = fiber.Pool(processes=4)
    count = sum(pool.map(inside, range(0, NUM_SAMPLES)))
    print("Pi is roughly {}".format(4.0 * count / NUM_SAMPLES))

if __name__ == '__main__':
    main()

Fiber implements most of multiprocessing's API including Process, SimpleQueue, Pool, Pipe, Manager and it has its own extension to the multiprocessing's API to make it easy to compose large scale distributed applications. For the detailed API guild, check out here.

Running on a Kubernetes cluster

Fiber also has native support for computer clusters. To run the above example on Kubernetes, fiber provided a convenient command line tool to manage the workflow.

Assume you have a working docker environment locally and have finished configuring Google Cloud SDK. Both gcloud and kubectl are available locally. Then you can start by writing a Dockerfile which describes the running environment. An example Dockerfile looks like this:

# example.docker
FROM python:3.6-buster
ADD examples/pi_estimation.py /root/pi_estimation.py
RUN pip install fiber

Build an image and launch your job

fiber run -a python3 /root/pi_estimation.py

This command will look for local Dockerfile and build a docker image and push it to your Google Container Registry . It then launches the main job which contains your code and runs the command python3 /root/pi_estimation.py inside your job. Once the main job is running, it will start 4 subsequent jobs on the cluster and each of them is a Pool worker.

Supported platforms

  • Operating system: Linux
  • Python: 3.6+
  • Supported cluster management systems:
    • Kubernetes (Tested with Google Kubernetes Engine on Google cloud)

We are interested in supporting other cluster management systems like Slurm, if you want to contribute to it please let us know.

Check here for details.

Documentation

The documentation, including method/API references, can be found here.

Testing

Install test dependencies. You'll also need to make sure docker is available on the testing machine.

$ pip install -e .[test]

Run tests

$ make test

Contributing

Please read our code of conduct before you contribute! You can find details for submitting pull requests in the CONTRIBUTING.md file. Issue template.

Versioning

We document versions and changes in our changelog - see the CHANGELOG.md file for details.

License

This project is licensed under the Apache 2.0 License - see the LICENSE file for details.

Cite Fiber

@misc{zhi2020fiber,
    title={Fiber: A Platform for Efficient Development and Distributed Training for Reinforcement Learning and Population-Based Methods},
    author={Jiale Zhi and Rui Wang and Jeff Clune and Kenneth O. Stanley},
    year={2020},
    eprint={2003.11164},
    archivePrefix={arXiv},
    primaryClass={cs.LG}
}

Acknowledgments

  • Special thanks to Piero Molino for designing the logo for Fiber
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].