Home

Awesome

Pocket

This repository contains source code and script files for the Pocket paper, which will be presented at Eurosys'23. Technical details and design decisions are available in the published paper.

A tag for submitted artifact: artifact-evaluation

(Bibtex for citation will be added once it gets available.)

Getting Started Instructions

<!-- 30 minutes https://docs.google.com/document/d/1pqzPtLVIvwLwJsZwCb2r7yzWMaifudHe1Xvn42T4CcA/edit -->

Prerequisite

Install Dependencies

cd scripts
# To install dependencies to run cpu-based applications
./install prerequisite --gpu=0 # --gpu=0 can be omitted. # if you're a root user
sudo --preserve-env=USER ./install prerequisite --gpu=0 # if you're using sudo privilege as a regular user.
# To install dependencies to run gpu-based applications, additionally cuda related dependencies have to be installed
./install prerequisite --gpu=1

Launch Hello-World Pocket

cd scripts
./install hello-world --gpu=0 # or --gpu=1 or omit # no root privilege required.
./launch hello-world

About Pocket

Source Tree

pocket
├── applications                    # Benchmark
│   ├── mobilenetv2
│   ├── resnet50
│   ├── smallbert
│   ├── ssdmobilenetv2_320x320
│   ├── ssdresnet50v1_640x640
│   └── talkingheads
├── firecracker-prep                # Scripts for generating FireCracker compatible filesystem images
├── pocket                          # Pocket binary
├── resources                       # input data and other artifacts
├── scripts                         # scripts for building and running Pocket
└── tfrpc                           # interface definition between Pocket FE and BE

Detailed Instructions

Build All Model Set

# Build all application binaries for CPU
./install all-pockets # `--gpu=0` can be added

# for GPU
./install all-pockets --gpu=1

@Todo: Run Pocket---Launch All Experiment

./launch latency # The most basic command to verify functionality. The others are for specific experiments.
./launch latency-gpu
./launch eval-policy
./launch exec-breakdown
<!-- ./launch hw-counters ./launch latency #sleep -->

System Requirement

ItemsSpecification
ProcessorsIntel(R) Xeon(R) CPU E5-2670 v3 @ 2.30GHz;<br>2 Processors; 24 cores; 48 threads
GPUNVIDIA K80 (only for GPU experiments)
Memory128MiB
Operating SystemUbuntu 18.04.3 LTS<br>GNU/Linux 4.15.0-76-generic x86_64
Runtime/LibraryTensorFlow:2.1.0; GCC 7.4.0 python 3.6.9<br>Docker version 20.10.8, build 3967b7d

Internal Operation

(1) Pocketizing: have your application separated into two pieces

(2) Run Pocket service backend

(3) Run Pocket application frontend


docker run \
    -d \
    --privileged \
    --name=$server_container_name \
    --workdir='/root' \
    --env YOLO_SERVER=1 \
    --ip=$server_ip \
    --ipc=shareable \
    --cpus=1.0 \
    --memory=1024mb \
    --volume=/sys/fs/cgroup/:/cg \
    $server_image \
    python server.py
pocket \
    run \
        --measure-latency $dir \
        -d \
        -b pocket-smallbert-application \
        -t ${container_name} \
        -s ${server_container_name} \
        --memory=$(bc <<< '1024 * 0.25')mb \
        --cpus=1.3 \
        --env POCKET_MEM_POLICY=${POCKET_MEM_POLICY} \
        --env POCKET_CPU_POLICY=${POCKET_CPU_POLICY} \
        --workdir='/root/smallbert' \
        -- python3 app.pocket.py &

Troubleshooting

Make Your Own Pocket

Potential Usage of Pocket

The design idea of Pocket can be introduced anywhere there are heavy complex runtimes, scarce computing resource, and multiple instances sharing the technically same resources.