This repository has been archived by the owner on Mar 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
Initial draft - How to Deploy your Petals Private Swarm #69
Draft
filopedraz
wants to merge
1
commit into
premAI-io:main
Choose a base branch
from
filopedraz:feat/petals-blog-post
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
--- | ||
slug: petals-private-swarm | ||
title: How to Deploy your Petals Private Swarm | ||
authors: [filopedraz] | ||
tags: [llms, petals, swarm, private, prem] | ||
description: "Get your own Petals Private Swarm up and running in 5 minutes" | ||
--- | ||
|
||
<!--truncate--> | ||
|
||
## Introduction to Petals | ||
|
||
### What is Petals? | ||
|
||
### Some Definitions and Concepts | ||
|
||
- **DHT**: Distributed Hash Table | ||
- **Torrent**: A torrent is a file sent via the BitTorrent protocol. It can be just about any type of file, such as a movie, song, game, or application. | ||
- **Swarm**: A swarm is a group of peers that share a torrent and are both uploading and downloading the torrent's content. | ||
- **Peer**: A peer is one instance of a BitTorrent client running on a computer on the Internet to which other clients connect and transfer data. | ||
- **Tracker**: A tracker is a server that keeps track of which seeds and peers are in the swarm. | ||
- **Seed**: A seed is a client that has a complete copy of the data of a certain torrent. Once your BitTorrent client finishes downloading, it will remain open until you click the Finish button (or otherwise close it). This is known as being a seed or seeding. | ||
|
||
### How does Petals work? | ||
|
||
## Deploy your Petals Private Swarm | ||
|
||
### 1. Run a Backbone Server | ||
|
||
Create a DO Machine with at least 2GiB of RAM and 1 CPU and Install all the necessary dependencies (Docker). | ||
|
||
```bash | ||
docker run -d --net host --ipc host --volume petals-cache-backbone:/cache --name backbone --rm learningathome/petals:main python -m petals.cli.run_dht --host_maddrs /ip4/0.0.0.0/tcp/31337 --identity_path bootstrap1.id | ||
``` | ||
|
||
Check the logs of the `backbone` containers in order to get the IPs. | ||
|
||
### 2. Contribute to the Swarm | ||
|
||
#### Cloud GPU Instance (NVIDIA) | ||
|
||
Create a Machine on `Paperspace` or `DataCrunch` and run the following command in order to join the Swarm | ||
|
||
```bash | ||
docker run -d --net host --ipc host --gpus all --volume petals-cache-node1:/cache --name node1 --rm learningathome/petals:main python -m petals.cli.run_server --port 31330 --num_blocks 20 petals-team/StableBeluga2 --initial_peers /ip4/209.38.217.30/tcp/31337/p2p/QmecL18cmRaDdAcRmA7Ctj1gyAeUYG433WppA1UWTHTew6 /ip4/127.0.0.1/tcp/31337/p2p/QmecL18cmRaDdAcRmA7Ctj1gyAeUYG433WppA1UWTHTew6 | ||
``` | ||
|
||
Where the `--initial_peers` variable should be filled with the logs you get from the `backbone` peer. | ||
|
||
#### Mac | ||
|
||
```bash | ||
brew install python | ||
python3 -m pip install git+https://github.com/bigscience-workshop/petals | ||
python3 -m petals.cli.run_server --public_name prem-app petals-team/StableBeluga2 --initial_peers /ip4/209.38.217.30/tcp/31337/p2p/QmecL18cmRaDdAcRmA7Ctj1gyAeUYG433WppA1UWTHTew6 /ip4/127.0.0.1/tcp/31337/p2p/QmecL18cmRaDdAcRmA7Ctj1gyAeUYG433WppA1UWTHTew6 | ||
``` | ||
|
||
#### Prem | ||
|
||
- Install Prem Desktop App | ||
- Go to `Settings` | ||
- Enable `Swarm Mode` | ||
|
||
### 3. Monitor your Private Swarm | ||
|
||
- Run Prem Explorer | ||
|
||
### 4. Consume your Private Swarm | ||
|
||
- Run Prem App and connect to your Private Swarm | ||
|
||
## Conclusion |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why we do have --rm here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can remove