본문 바로가기
AI Image

Meta llama-3 소개 및 다운로드 및 설치

by 도승이 2024. 4. 30.

llama 소개

메타의 LLM(Large Language Model) 인 llama는

llama-1에서 학계에공개

llama-2에서 상업적공개

llama-3에서 오픈소스공개 로 점점 공개 범위를 늘려왔다.

 

 

 

GitHub - meta-llama/codellama: Inference code for CodeLlama models

Inference code for CodeLlama models. Contribute to meta-llama/codellama development by creating an account on GitHub.

github.com

 

유명한 경쟁모델로는

OpenAI - ChatGPT

Google - Geminai

Microsoft - Copilot

이런 흐름을 따라가는 국내기업으로는

네이버나 카카오가 있다. (하이퍼클로바X , 코GPT..)

https://www.topdaily.kr/articles/96999

 

'쩐의 전쟁' 생성형 AI...네이버·카카오, 서비스 특화 전략 통할까

오픈AI 등 자금력 앞세운 글로벌 빅테크, 차세대 LLM 예고 네이버·카카오, 조직 개편 등 통해 생성형 AI 서비스 적용 집중

www.topdaily.kr

 

메타의 경우 AI 시장의 생태계를 넓히기위해 오픈소스로 공개했는데

잠시 이 대규모 모델을 오픈소스로 공개한것이 얼마나 대단한 일인지 알아보자

1. 위 모델을 훈련하기 위하여 쓰인 그래픽카드는 Nvidia Tesla H100-80G 이다 (그래픽 카드 한장에 약 5000만원..?)

2. 해당 그래픽카드로 8B - 130만시간 70B - 640만시간 합 770만시간을 훈련에 사용하였다 (소모전력 약 700W)

해당 그래픽카드 1000장을 모아서 사용했다고해도 훈련에만 7700시간이 필요하다 (약 320일 소요)

 

다시 돌아와서

llama-3 의 경우 세부 모델로는

8B, 8B_instruct

70B , 70B_instruct 가 있다.

뒤에 instruct가 붙은 모델은 사람의 지시에 잘 따르게 미세조정한 모델이라고 한다

원문(Both instruct models were fine-tuned to better follow human directions, so they're more suited to use as a chatbot than the raw Llama models.)

 

70B 모델의 경우 실행시키는데 VRAM을 너무너무 많이 사용해서
4090 3장을 SLI로 엮어야 로컬 실행이 가능하다는 루머가.. (모델 용량만 약 131GB,  8B는 약 15GB)

 

 

설치방법 1. Conda

(설치실패, 스킵할사람은 설치방법2. Ollama 참조)

라이센스 접근

https://llama.meta.com/llama-downloads/

 

Download Llama

Request access to Llama.

llama.meta.com

1. 메타의 라마 다운로드 사이트에 들어가서 본인 간략한 개인정보 및 이메일을 적어서 모델에대한 접근권한을 받는다.

2. 라이센스 및 약관에 동의하면 아래와 같이 해당 모델에 접근 가능한 링크를 준다.

다운로드 링크를 준다. (일부 가림)

해당 링크는 이메일로도 발송되니 페이지를 닫았다면 이메일로 확인하면된다.

 

 

설치 하기위해서는 Git 메뉴얼을 따라

Conda 가상환경에서 실행하기 위해 Anaconda 를 설치하였고, (anaconda 또는 anaconda navigator 설치)

https://www.anaconda.com/

 

Unleash AI Innovation and Value | Anaconda

Accelerate growth efficiently for everyone with the AI and data science experts.

www.anaconda.com

git bash 를 설치하여

1. wget (파일 다운로드 유틸리티)

https://gist.github.com/evanwill/0207876c3243bbb6863e65ec5dc3f058

 

how to add more utilities to git bash for windows, wget, make

how to add more utilities to git bash for windows, wget, make - gitBash_windows.md

gist.github.com

2. md5sum (파일이 제대로 받아졌는지 체크섬 확인하는 유틸리티)

위 두개를 git bash에 넣어줬다. 설치 되어있는지 확인하는 방법 -  which wget , which md5sum

또는 wget --version , md5sum --version

완료 되었다면 bash download.sh 명령어를 친다.

Enter the URL from email :

이렇게 항목이 뜨면 아까 받은 설치 URL을 붙여넣어준다. (우클릭 - Paste 또는 Shift + Insert)

한번으로 안되면 여러번 해주어야한다..

 

 

Issue 1. torchrun script

https://github.com/meta-llama/llama/issues/694

 

failed to create process · Issue #694 · meta-llama/llama

Hi, I am using Windows 10, with a conda env, and have CUDA and everything else setup and working as per the instructions. When I try to run my first example I get a failed to start process ` (llama...

github.com

 

'failed to create process' 본인도 동일한 문제가 발생했다.

왼쪽을 오른쪽으로 (경로 설정)

 

해결방법 -> 본인의 torchrun script를 (D:\git\Conda\Scripts\torchrun-script.py)

찾아서 열고 맨첫줄 환경변수부분을 본인의 conda python 경로(D:\git\Conda\python.exe)로 잡아준다.

(본인의 파이썬 경로 확인하는 방법  conda prompt에서 python -m site)

 

issue 2.

https://github.com/meta-llama/llama/issues/347

 

Issue with Redirects Not Supported Error in Windows and macOS. When running torchrun, a RuntimeError is encountered with the mes

Description: When running the command, a RuntimeError is encountered with the message "unmatched '}' in format string." Run command torchrun --nproc_per_node 1 -- rd example.py --ckpt_dir ./models/...

github.com

리디렉션 문제

torch\distributed\elastic\multiprocessing\redirects.py:27] NOTE: Redirects are currently not supported in Windows or MacOs.
[W socket.cpp:697] [c10d] The client socket has failed to connect to []:29500 (system error: 10049 - 요청한 주소는 해당 컨텍스트에서 유효하지 않습니다.).

 

Conda 문제가 해결이 되지않는다...

 

ㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡ

설치방법 2. Ollama

Ollama 를 이용해서 설치하는것을 추천한다.

https://ollama.com/

 

Ollama

Get up and running with large language models.

ollama.com

 

 

Ollama Windows 버전 파일(.exe)을 다운로드 한 뒤, 설치 한다.

이후 Cmd창 (Window버튼 + R) 을 실행 한 후

 

8B 모델 실행 시 (권장)

> ollama run llama3

 

대형 70B 모델 실행 시 (권장X)

> ollama run llama3:70b

 

위 명령어만 써주면 설치 끝

'AI Image' 카테고리의 다른 글

Perplexity AI  (0) 2024.05.09
ComfyUI X UnrealEngine - ComfyTexture 개발 일지 (1)  (0) 2024.05.07
ComfyUI X UnrealEngine  (0) 2024.04.17
ComfyUI 3D 생성형 AI (SV3D, TripoSR)  (0) 2024.04.09
ComfyUI를 이용한 모양 및 스타일 변경  (0) 2024.04.08

댓글