Coder Social home page Coder Social logo

rheehot / haiku-scalable-example Goto Github PK

View Code? Open in Web Editor NEW

This project forked from chris-chris/haiku-scalable-example

0.0 1.0 0.0 285 KB

Scalable distributed reinforcement learning agents on kubernetes

Starlark 3.11% Python 95.33% Dockerfile 0.86% Shell 0.70%

haiku-scalable-example's Introduction

haiku-scalable-example

Scalable reinforcement learning agents on container orchestration

chris-chris Coverage Status

1. Purpose of the project

Implement scalable reinforcement learning agent on the container orchestraion system like k8s.

2. Container Orchestraion

  • Kubernetes
  • Google Cloud Platform

3. Reinforcement Learning Algorithms

  • IMPALA
  • A3C
  • TBD

4. Architecture

This example will introduce a clear way to deploy scalable reinforcement learning agents to the computing clusters.

alt text

5. Install

$ git clone https://github.com/chris-chris/haiku-scalable-example
$ cd haiku-scalable-example
$ pip install -r requirements.txt

6. Execute

v1. Learner + Multi Actor IMPALA wiring through gRPC.

$ python learner_server.py
$ GRPC_HOST=localhost:50051 python actor_client.py &
$ GRPC_HOST=localhost:50051 python actor_client.py &

v2. 1 Learner + Multi Actor IMPALA wiring through gRPC on docker VMs.

prepare

$ docker pull chrisai/haiku-scalable-example-learner:test
$ docker pull chrisai/haiku-scalable-example-actor:test

$ docker network create --subnet 172.20.0.0/16 --ip-range 172.20.240.0/20 multi-host-network

run

$ docker run -d -p 127.0.0.1:50051:50051 --network=multi-host-network --ip=172.20.240.1 chrisai/haiku-scalable-example-learner:test
$ docker run -d --env GRPC_HOST=172.20.240.1:50051 --network=multi-host-network chrisai/haiku-scalable-example-actor:test

wanna see logs?

$ docker ps
$ docker attach [CONTAINER ID]

v3. 1 Learner + Multi Actor IMPALA wiring through gRPC on k8s.

  • Install minikube

https://kubernetes.io/docs/tasks/tools/install-minikube/

  • Run
$ kubectl apply -f impala.yml
  • Wanna see logs?
$ kubectl logs -f impala learner
$ kubectl logs -f impala actor

7. To-dos

  • v1. 1 Learner + Multi Actor IMPALA wiring through gRPC.
  • v2. 1 Learner + Multi Actor IMPALA wiring through gRPC on docker VMs.
  • v3. 1 Learner + Multi Actor IMPALA wiring through gRPC on k8s.
  • Optimize the model weight serialization for the performance.
  • v4. Multi Learner + Multi Actor IMPALA wiring through gRPC on k8s.
  • Implement other distributed RL algorithms
  • Asynchronous Processing via Queue
  • Monitor the computing resource usages

8. Reference

I used Deepmind's open sources haiku, rlax, and google jax

haiku-scalable-example's People

Contributors

chris-chris avatar

Watchers

 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.