เรียกใช้โมเดลภาษาขนาดใหญ่ที่บ้าน สไตล์ BitTorrent
การปรับแต่งและการอนุมานได้เร็วกว่าการถ่ายโอนข้อมูลถึง 10 เท่า
สร้างข้อความด้วยการกระจาย Llama 3.1 (สูงสุด 405B), Mixtral (8x22B), Falcon (40B+) หรือ BLOOM (176B) และปรับแต่งสำหรับงานของคุณเอง - จากคอมพิวเตอร์เดสก์ท็อปของคุณหรือ Google Colab:
from transformers import AutoTokenizer
from petals import AutoDistributedModelForCausalLM
# Choose any model available at https://health.petals.dev
model_name = "meta-llama/Meta-Llama-3.1-405B-Instruct"
# Connect to a distributed network hosting model layers
tokenizer = AutoTokenizer . from_pretrained ( model_name )
model = AutoDistributedModelForCausalLM . from_pretrained ( model_name )
# Run the model as if it were on your computer
inputs = tokenizer ( "A cat sat" , return_tensors = "pt" )[ "input_ids" ]
outputs = model . generate ( inputs , max_new_tokens = 5 )
print ( tokenizer . decode ( outputs [ 0 ])) # A cat sat on a mat...
ลองเลยใน Colab
- ต้องการที่จะเรียกใช้ลามะ? ขอสิทธิ์เข้าถึงน้ำหนัก จากนั้นเรียกใช้การเข้าสู่ huggingface-cli login
ในเทอร์มินัลก่อนโหลดโมเดล หรือลองใช้ในแอปแชทบอทของเรา
- ความเป็นส่วนตัว. ข้อมูลของคุณจะได้รับการประมวลผลโดยได้รับความช่วยเหลือจากบุคคลอื่นในที่สาธารณะ เรียนรู้เพิ่มเติมเกี่ยวกับความเป็นส่วนตัวที่นี่ สำหรับข้อมูลที่ละเอียดอ่อน คุณสามารถตั้งค่ากลุ่มส่วนตัวในหมู่คนที่คุณไว้วางใจได้
มีคำถามอะไรไหม? ปิงเราใน Discord ของเรา!
Petals เป็นระบบที่ดำเนินการโดยชุมชน — เราอาศัยผู้คนที่แชร์ GPU ของตน คุณสามารถช่วยให้บริการโมเดลที่มีอยู่หรือโฮสต์โมเดลใหม่ได้จาก ? โมเดลฮับ!
ตามตัวอย่าง ต่อไปนี้เป็นวิธีโฮสต์ส่วนหนึ่งของคำสั่ง Llama 3.1 (405B) บน GPU ของคุณ:
- อยากเลี้ยงลามะไหม? ขอสิทธิ์เข้าถึงน้ำหนัก จากนั้นเรียกใช้การเข้าสู่ huggingface-cli login
ในเทอร์มินัลก่อนโหลดโมเดล
- ลินุกซ์ + อนาคอนด้า รันคำสั่งเหล่านี้สำหรับ NVIDIA GPU (หรือทำตามนี้สำหรับ AMD):
conda install pytorch pytorch-cuda=11.7 -c pytorch -c nvidia
pip install git+https://github.com/bigscience-workshop/petals
python -m petals.cli.run_server meta-llama/Meta-Llama-3.1-405B-Instruct
- วินโดวส์ + WSL ปฏิบัติตามคำแนะนำนี้บน Wiki ของเรา
- นักเทียบท่า เรียกใช้อิมเมจ Docker ของเราสำหรับ NVIDIA GPU (หรือติดตามสิ่งนี้สำหรับ AMD):
sudo docker run -p 31330:31330 --ipc host --gpus all --volume petals-cache:/cache --rm
learningathome/petals:main
python -m petals.cli.run_server --port 31330 meta-llama/Meta-Llama-3.1-405B-Instruct
- macOS + GPU Apple M1/M2 ติดตั้ง Homebrew จากนั้นรันคำสั่งเหล่านี้:
brew install python
python3 -m pip install git+https://github.com/bigscience-workshop/petals
python3 -m petals.cli.run_server meta-llama/Meta-Llama-3.1-405B-Instruct
เรียนรู้เพิ่มเติม (วิธีใช้ GPU หลายตัว เริ่มต้นเซิร์ฟเวอร์ขณะบู๊ต ฯลฯ)
ความปลอดภัย. การโฮสต์เซิร์ฟเวอร์ไม่อนุญาตให้ผู้อื่นเรียกใช้โค้ดที่กำหนดเองบนคอมพิวเตอร์ของคุณ เรียนรู้เพิ่มเติมที่นี่
มีคำถามอะไรไหม? ปิงเราใน Discord ของเรา!
- ขอบคุณ! เมื่อคุณโหลดและโฮสต์มากกว่า 10 บล็อก เราจะสามารถแสดงชื่อหรือลิงก์ของคุณบน Swarm Monitor เพื่อเป็นการกล่าวขอบคุณ คุณสามารถระบุด้วย --public_name YOUR_NAME
อ่านบทความ ดูคำถามที่พบบ่อย
บทช่วยสอนพื้นฐาน:
เครื่องมือที่มีประโยชน์:
คำแนะนำขั้นสูง:
โปรดดู ส่วนที่ 3.3 ของรายงานของเรา
โปรดดูคำถามที่พบบ่อยของเราเกี่ยวกับการบริจาค
Alexander Borzunov, Dmitry Baranchuk, Tim Dettmers, Max Ryabinin, Younes Belkada, Artem Chumachenko, Pavel Samygin และ Colin Raffel กลีบดอกไม้: การอนุมานร่วมกันและการปรับแต่งแบบจำลองขนาดใหญ่อย่างละเอียด การดำเนินการประชุมประจำปีสมาคมภาษาศาสตร์คอมพิวเตอร์ ครั้งที่ 61 (เล่มที่ 3: การสาธิตระบบ) 2023.
@inproceedings { borzunov2023petals ,
title = { Petals: Collaborative Inference and Fine-tuning of Large Models } ,
author = { Borzunov, Alexander and Baranchuk, Dmitry and Dettmers, Tim and Riabinin, Maksim and Belkada, Younes and Chumachenko, Artem and Samygin, Pavel and Raffel, Colin } ,
booktitle = { Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (Volume 3: System Demonstrations) } ,
pages = { 558--568 } ,
year = { 2023 } ,
url = { https://arxiv.org/abs/2209.01188 }
}
อเล็กซานเดอร์ บอร์ซูนอฟ, แม็กซ์ ไรอาบินิน, อาร์เต็ม ชูมาเชนโก, มิทรี บารานชุก, ทิม เดตต์เมอร์ส, ยูเนส เบลคาดา, พาเวล ซามีจิน และโคลิน ราฟเฟล การอนุมานแบบกระจายและการปรับแต่งแบบจำลองภาษาขนาดใหญ่อย่างละเอียดผ่านทางอินเทอร์เน็ต ความก้าวหน้าในระบบประมวลผลสารสนเทศประสาท 36 (2023)
@inproceedings { borzunov2023distributed ,
title = { Distributed inference and fine-tuning of large language models over the {I}nternet } ,
author = { Borzunov, Alexander and Ryabinin, Max and Chumachenko, Artem and Baranchuk, Dmitry and Dettmers, Tim and Belkada, Younes and Samygin, Pavel and Raffel, Colin } ,
booktitle = { Advances in Neural Information Processing Systems } ,
volume = { 36 } ,
pages = { 12312--12331 } ,
year = { 2023 } ,
url = { https://arxiv.org/abs/2312.08361 }
}
โครงการนี้เป็นส่วนหนึ่งของการประชุมเชิงปฏิบัติการการวิจัย BigScience