집에서 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를 공유하는 사람들에 의존합니다. 사용 가능한 모델 중 하나를 제공하는 데 도움을 주거나 ?에서 새 모델을 호스팅할 수 있습니다. 모델 허브!
예를 들어, GPU에서 Llama 3.1(405B) Instruct의 일부를 호스팅하는 방법은 다음과 같습니다.
? 라마를 호스팅하고 싶으신가요? 해당 가중치에 대한 액세스를 요청한 다음, 모델을 로드하기 전에 터미널에서 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에서 이 가이드를 따르세요.
? 도커. NVIDIA GPU용 Docker 이미지를 실행합니다(또는 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 + Apple M1/M2 GPU. 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개 이상의 블록을 로드하고 호스팅하면 감사의 표시로 스웜 모니터에 귀하의 이름이나 링크를 표시할 수 있습니다. --public_name YOUR_NAME
으로 지정할 수 있습니다.
논문 읽기 FAQ 보기
기본 튜토리얼:
유용한 도구:
고급 가이드:
우리 논문의 섹션 3.3을 참조하세요.
기여에 대한 FAQ를 참조하세요.
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 }
}
Alexander Borzunov, Max Ryabinin, Artem Chumachenko, Dmitry Baranchuk, Tim Dettmers, Younes Belkada, Pavel Samygin 및 Colin Raffel. 인터넷을 통한 대규모 언어 모델의 분산 추론 및 미세 조정. 신경 정보 처리 시스템의 발전 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 연구 워크숍의 일부입니다.