제퍼넷 로고

이제 TII의 Falcon 180B 기반 모델을 Amazon SageMaker JumpStart | 아마존 웹 서비스

시간

오늘 TII(Technology Innovation Institute)에서 개발하고 Amazon SageMaker에서 교육한 Falcon 180B 기반 모델을 고객이 다음을 통해 사용할 수 있다는 소식을 발표하게 되어 기쁘게 생각합니다. Amazon SageMaker 점프스타트 추론 실행을 위해 원클릭으로 배포합니다. 180억 개의 매개변수 크기와 3.5조 180천억 개의 대규모 토큰 데이터세트로 훈련된 Falcon 180B는 공개적으로 접근 가능한 가중치를 갖춘 가장 크고 성능이 뛰어난 모델 중 하나입니다. ML을 빠르게 시작할 수 있도록 알고리즘, 모델 및 ML 솔루션에 대한 액세스를 제공하는 기계 학습(ML) 허브인 SageMaker JumpStart로 이 모델을 시험해 볼 수 있습니다. 이 게시물에서는 SageMaker JumpStart를 통해 Falcon XNUMXB 모델을 검색하고 배포하는 방법을 안내합니다.

팔콘 180B 란 무엇입니까?

Falcon 180B는 에서 출시한 모델입니다. IIT Falcon 제품군의 이전 릴리스를 따릅니다. Falcon 40B의 확장 버전이며 더 나은 확장성을 위해 다중 쿼리 Attention을 사용합니다. 최적화된 변환기 아키텍처를 사용하는 자동 회귀 언어 모델입니다. 주로 웹 데이터로 구성된 3.5조 XNUMX천억 개의 데이터 토큰에 대해 훈련되었습니다. 세련된웹 (약 85%). 이 모델에는 180B와 180B-Chat의 두 가지 버전이 있습니다. 180B는 사전 훈련된 원시 모델이므로 대부분의 사용 사례에 대해 추가로 미세 조정해야 합니다. 180B-Chat은 일반적인 지침을 받는 데 더 적합합니다. 채팅 모델은 여러 대규모 대화 데이터세트와 함께 채팅 및 지침 데이터세트에서 미세 조정되었습니다.

모델은 다음에서 사용할 수 있습니다. Falcon-180B TII 라이센스이용 정책.

Falcon 180B는 TII에서 다음과 같은 훈련을 받았습니다. 아마존 세이지 메이커, 약 4K A100 GPU 클러스터. ZeRO와 함께 3D 병렬 처리를 사용하는 Gigatron이라는 맞춤형 분산 교육 코드베이스와 맞춤형 고성능 Triton 커널을 사용했습니다. 사용된 분산 학습 아키텍처 아마존 단순 스토리지 서비스 (Amazon S3)은 데이터 로딩과 체크포인트 쓰기 및 읽기를 위한 유일한 통합 서비스로, 특히 워크로드 안정성과 운영 단순성에 기여했습니다.

SageMaker JumpStart란?

SageMaker JumpStart를 사용하면 ML 실무자는 점점 늘어나는 최고 성능의 기초 모델 목록에서 선택할 수 있습니다. ML 실무자는 네트워크 격리 환경 내의 전용 SageMaker 인스턴스에 기초 모델을 배포하고, 모델 교육 및 배포를 위해 Amazon SageMaker를 사용하여 모델을 사용자 지정할 수 있습니다.

이제 몇 번의 클릭만으로 Falcon 180B를 검색하고 배포할 수 있습니다. 아마존 세이지 메이커 스튜디오 또는 SageMaker Python SDK를 통해 프로그래밍 방식으로 다음과 같은 SageMaker 기능으로 모델 성능 및 MLOps 컨트롤을 파생할 수 있습니다. Amazon SageMaker 파이프 라인, Amazon SageMaker 디버거또는 컨테이너 로그. 이 모델은 AWS 보안 환경과 VPC 제어에 배포되어 데이터 보안을 보장합니다. Falcon 180B는 검색 가능하며 필수 인스턴스를 사용할 수 있는 지역에 배포할 수 있습니다. 현재 ml.p4de 인스턴스는 미국 동부(버지니아 북부) 및 미국 서부(오레곤)에서 사용할 수 있습니다.

모델 살펴보기

SageMaker Studio UI 및 SageMaker Python SDK에서 SageMaker JumpStart를 통해 기초 모델에 액세스할 수 있습니다. 이 섹션에서는 SageMaker Studio에서 모델을 검색하는 방법을 살펴봅니다.

SageMaker Studio는 데이터 준비에서 ML 모델 구축, 교육 및 배포에 이르기까지 모든 ML 개발 단계를 수행하기 위해 특별히 제작된 도구에 액세스할 수 있는 단일 웹 기반 시각적 인터페이스를 제공하는 통합 개발 환경(IDE)입니다. SageMaker Studio 시작 및 설정 방법에 대한 자세한 내용은 다음을 참조하십시오. 아마존 세이지 메이커 스튜디오.

SageMaker Studio에서는 사전 훈련된 모델, 노트북 및 사전 구축된 솔루션이 포함된 SageMaker JumpStart에 액세스할 수 있습니다. 사전 구축 및 자동화된 솔루션.

SageMaker JumpStart 랜딩 페이지에서 솔루션, 모델, 노트북 및 기타 리소스를 찾아볼 수 있습니다. Falcon 180B는 다음에서 찾을 수 있습니다. 기초 모델: 텍스트 생성 회전 목마

다음을 선택하여 다른 모델 변형을 찾을 수도 있습니다. 모든 텍스트 생성 모델 살펴보기 또는 검색 Falcon.

모델 카드를 선택하면 라이선스, 학습에 사용되는 데이터, 사용 방법 등 모델에 대한 세부 정보를 볼 수 있습니다. 두 개의 버튼도 찾을 수 있습니다. 배포노트북 열기, 이는 모델을 사용하는 데 도움이 됩니다(다음 스크린샷은 배포 선택권).

모델 배포

당신이 선택할 때 배포, 모델 배포가 시작됩니다. 또는 다음을 선택하여 표시되는 예제 노트북을 통해 배포할 수 있습니다. 노트북 열기. 예제 노트북은 추론을 위해 모델을 배포하고 리소스를 정리하는 방법에 대한 종단 간 지침을 제공합니다.

노트북을 사용하여 배포하려면 다음으로 지정된 적절한 모델을 선택하는 것으로 시작합니다. model_id. 다음 코드를 사용하여 SageMaker에서 선택한 모델을 배포할 수 있습니다.

from sagemaker.jumpstart.model import JumpStartModel my_model = JumpStartModel(model_id="huggingface-llm-falcon-180b-chat-bf16") predictor = my_model.deploy()

그러면 기본 인스턴스 유형 및 기본 VPC 구성을 포함한 기본 구성으로 SageMaker에 모델이 배포됩니다. 기본값이 아닌 값을 지정하여 이러한 구성을 변경할 수 있습니다. JumpStartModel. 자세한 내용은 다음을 참조하세요. API 문서. 배포된 후에는 SageMaker 예측기를 통해 배포된 엔드포인트에 대해 추론을 실행할 수 있습니다. 다음 코드를 참조하세요.

payload = { "inputs": "User: Hello!nFalcon: ", "parameters": {"max_new_tokens": 256, "top_p": 0.9, "temperature": 0.6}
}
response = predictor.predict(payload)

추론 매개변수는 엔드포인트에서 텍스트 생성 프로세스를 제어합니다. 최대 새 토큰 컨트롤은 모델에서 생성된 출력의 크기를 나타냅니다. 모델의 어휘가 영어 어휘와 동일하지 않고 각 토큰이 영어 단어가 아닐 수 있으므로 이는 단어 수와 동일하지 않습니다. 온도는 출력의 무작위성을 제어합니다. 온도가 높을수록 더 창의적이고 환각적인 출력이 생성됩니다. 모든 추론 매개변수는 선택사항입니다.

이 180B 매개변수 모델은 335GB이며 16비트 정밀도로 추론을 충분히 수행하려면 더 많은 GPU 메모리가 필요합니다. 현재 JumpStart는 ml.p4de.24xlarge 인스턴스에서만 이 모델을 지원합니다. 다음을 제공하여 ml.p8d.4xlarge 인스턴스에 24비트 양자화 모델을 배포할 수 있습니다. env={"HF_MODEL_QUANTIZE": "bitsandbytes"} 에 대한 키워드 인수 JumpStartModel 생성자 및 지정 instance_type="ml.p4d.24xlarge" 배포 방법에. 그러나 이 양자화된 구성에서는 토큰당 대기 시간이 약 5배 더 느리다는 점에 유의하세요.

다음 표에는 모델 ID, 기본 인스턴스 유형, 지원되는 최대 총 토큰 수(입력 토큰 수와 생성된 토큰 수의 합계) 및 토큰당 일반적인 응답 지연 시간과 함께 SageMaker JumpStart에서 사용할 수 있는 모든 Falcon 모델이 나열되어 있습니다. 이 모델 각각에 대해.

모델 이름 모델 ID 기본 인스턴스 유형 최대 총 토큰 토큰당 지연 시간*
팔콘 7B huggingface-llm-falcon-7b-bf16 ml.g5.2xlarge 2048 34 MS
팔콘 7B 지시 huggingface-llm-falcon-7b-instruct-bf16 ml.g5.2xlarge 2048 34 MS
팔콘 40B huggingface-llm-falcon-40b-bf16 ml.g5.12xlarge 2048 57 MS
팔콘 40B 지시 huggingface-llm-falcon-40b-instruct-bf16 ml.g5.12xlarge 2048 57 MS
팔콘 180B huggingface-llm-falcon-180b-bf16 ml.p4de.24xlarge 2048 45 MS
팔콘 180B 채팅 huggingface-llm-falcon-180b-chat-bf16 ml.p4de.24xlarge 2048 45 MS

*토큰별 대기 시간은 이 블로그에 제공된 예시 프롬프트의 중앙값 응답 시간으로 제공됩니다. 이 값은 입력 및 출력 시퀀스의 길이에 따라 달라집니다.

Falcon 180B에 대한 추론 및 예시 프롬프트

Falcon 모델은 모든 텍스트의 텍스트 완성에 사용할 수 있습니다. 텍스트 생성을 통해 질문에 답하기, 언어 번역, 감정 분석 등과 같은 다양한 작업을 수행할 수 있습니다. 엔드포인트는 다음 입력 페이로드 스키마를 허용합니다.

payload = { "inputs": str, (optional)"parameters": { "do_sample": bool, "max_new_tokens": int, "repetition_penalty": float, "return_full_text": bool, "stop": List[str], "seed": int, "temperature": float, "top_k": int, "top_p": float, "truncate": int, "typical_p": float, "best_of": int, "watermark": bool, "details": bool, "decoder_input_details": bool, }
}

이러한 정의를 탐색할 수 있습니다. 클라이언트 매개변수 텍스트 생성 추론 저장소 내의 기본값입니다.

다음은 몇 가지 샘플 예시 프롬프트와 모델에서 생성된 텍스트입니다. 여기의 모든 출력은 추론 매개변수를 사용하여 생성됩니다. {"max_new_tokens": 768, "stop": ["<|endoftext|>", "###"]}.

웹사이트 구축은 간단한 10단계로 완료할 수 있습니다:

Input Building a website can be done in 10 simple steps: Output
- Choose a domain name
- Register your domain name
- Choose a web host
- Choose a website builder
- Create your website
- Add content to your website
- Add pages to your website
- Add images to your website
- Add videos to your website
- Add social media to your website
1. Choose a domain name
A domain name is the address of your website. It is what people will type into their browser to find your website. For example, the domain name of this website is.
When choosing a domain name, you should choose something that is easy to remember and that represents your business or website. You should also make sure that the domain name is available. You can check if a domain name is available by using a domain name search tool.
2. Register your domain name
Once you have chosen a domain name, you need to register it. This can be done through a domain name registrar. A domain name registrar is a company that manages the registration of domain names.
When registering your domain name, you will need to provide your contact information and choose a payment method. You will also need to choose a domain name extension. The most common domain name extensions are .com, .net, and .org.
3. Choose a web host
A web host is a company that provides space on a server for your website. When choosing a web host, you should choose one that is reliable and that offers good customer support. You should also make sure that the web host offers the features that you need for your website.
4. Choose a website builder
A website builder is a tool that allows you to create a website without having to learn how to code. There are many different website builders available, so you should choose one that is easy to use and that offers the features that you need.
5. Create your website
Once you have chosen a website builder, you can start creating your website. You will need to choose a template for your website and then add content to your website.
6. Add content to your website
The content of your website is what will make your website unique. You should add content that is relevant to your business or website. You can add text, images, videos, and other types of content to your website.
7. Add pages to your website
A website is made up of pages. You can add as many pages as you want to your website. Each page should have a different purpose. For example, you might have a page for your home page, a page for your about page, and a page for your contact page.
8. Add images to your website
Images can make your website more visually appealing. You can add images to your website by uploading them to your website or by using a image hosting service.
9. Add videos to your website
Videos can also make your website more visually appealing. You can add videos to your website by uploading them to your website or by using a video hosting service.
10. Add social media to your website
Social media can help you promote your website. You can add social media buttons to your website so that people can share your website on social media. You can also add social media feeds to your website so that people can see your latest social media posts.

이 사전 학습된 모델은 대화 상자 사용 사례에 꼭 적합하지 않은 긴 텍스트 시퀀스를 생성한다는 것을 알 수 있습니다. 미세 조정된 채팅 모델이 대규모 대화 기반 프롬프트 세트에 대해 어떻게 작동하는지 보여주기 전에 다음 두 가지 예에서는 모델에 사용할 수 있는 훈련 샘플을 제공하는 상황 내 학습이 포함된 Falcon 모델을 사용하는 방법을 보여줍니다. "퓨샷 학습"은 모델 가중치를 조정하지 않습니다. 우리는 길드 모델 출력을 돕기 위해 입력 컨텍스트 내에서 몇 가지 예를 제공하면서 이 프로세스 동안 배포된 모델에 대해서만 추론을 수행합니다.

Input
Tweet: "I hate it when my phone battery dies."
Sentiment: Negative
###
Tweet: "My day has been :+1:"
Sentiment: Positive
###
Tweet: "This is the link to the article"
Sentiment: Neutral
###
Tweet: "This new music video was incredible"
Sentiment: Output Positive
###

Input
Translate English to French:
sea otter => loutre de mer
###
peppermint => menthe poivrée
###
plush girafe => girafe peluche
###
cheese => Output fromage
###

Falcon 180B-Chat에 대한 추론 및 예시 프롬프트

대화 사용 사례에 최적화된 Falcon 180B-Chat 모델을 사용하면 채팅 모델 엔드포인트에 대한 입력에 채팅 도우미와 사용자 간의 이전 기록이 포함될 수 있습니다. 지금까지 진행된 대화의 맥락에 맞는 질문을 할 수 있습니다. 채팅 도우미의 동작을 정의하는 페르소나와 같은 시스템 구성을 제공할 수도 있습니다. 엔드포인트에 대한 입력 페이로드는 Falcon 180B 모델과 동일합니다. inputs 문자열 값은 다음 형식을 사용해야 합니다.

System: <An optional system prompt>
User: <Optional user message history>
Falcon: <Optional chat history Falcon response>
User: <Current user message>
Falcon:

다음은 몇 가지 샘플 예제 프롬프트와 모델에서 생성된 텍스트입니다. 모든 출력은 추론 매개변수로 생성됩니다. {"max_new_tokens":256, "stop": ["nUser:", "<|endoftext|>", " User:", "###"]}.

Input
System: You are a helpful assistant
User: What is Amazon SageMaker JumpStart?
Falcon: Output Amazon SageMaker JumpStart is a capability of Amazon SageMaker that provides a set of solutions to common machine learning problems. These solutions include pre-built machine learning models, algorithms, and pre-configured model training and deployment settings. JumpStart also provides sample notebooks that demonstrate how to use these solutions for various use cases. The goal of JumpStart is to help users get started with machine learning quickly and easily, without the need for extensive machine learning expertise.
User:

Input
User: Simply put, the theory of relativity states that
Falcon: Output 1. The laws of physics are the same for all observers in uniform motion relative to one another.
2. The speed of light in a vacuum is the same for all observers, regardless of their motion or the motion of the light source.
3. Time and space are relative, meaning that they can vary depending on the observer's frame of reference.
4. Mass and energy are interchangeable, as expressed by the famous equation E=mc².
User:

Input
User: Building a website can be done in 10 simple steps:
Falcon: Output
1. Determine the purpose and goals of your website.
2. Choose a domain name and register it.
3. Select a web hosting provider and sign up for a plan.
4. Choose a website builder or content management system (CMS) to use.
5. Select a theme or template for your website.
6. Customize the design and layout of your website.
7. Add content to your website, including text, images, and videos.
8. Set up navigation menus and links to make your website easy to navigate.
9. Test your website to ensure it is functioning properly and is mobile-friendly.
10. Launch your website and promote it to attract visitors.
User:

Input
System: Always answer with a Haiku.
User: I am deploying a large language model on Amazon SageMaker JumpStart. What should I do?
Falcon: Output "JumpStart" your dreams,
Deploy with ease, scale with glee,
SageMaker awaits.

Input
System: Generate a table summarizing the options outlined in this email.
User: Team, we have to make a decision on the product plan for Goocrux v2. The first option will take us 3 weeks of development, and will achieve performance of 80ms, but means that the UI has to change. The second option will take us 4 weeks of development, and will achieve performance of 60ms, without any UI change. The third option will take the longest -- 6 weeks of development, will achieve performance of 30ms, without any UI change. A markdown table with four columns: (1) Option ID, (2) Development time, (3) Performance, (4) UI Change.
Falcon: Output
| Option ID | Development time | Performance | UI Change |
| --- | --- | --- | --- |
| 1 | 3 weeks | 80ms | Yes |
| 2 | 4 weeks | 60ms | No |
| 3 | 6 weeks | 30ms | No |

Input
System: You always translate English to French.
User: sea otter => loutre de mer
peppermint => menthe poivrée
plush girafe => girafe peluche
cheese =>
Falcon: Output
=> fromage

Input
System: Classify the user prompt as Negative, Positive, or Neutral sentiment. Use a short response.
User: Tweet: "This new music video was awesome" Falcon: Output "Positive"

Input
User: What is the recipe of mayonnaise?
Falcon: Output 1. In a mixing bowl, whisk together 1 egg yolk, 1 tablespoon of Dijon mustard, and 1 tablespoon of lemon juice until well combined.
2. While whisking continuously, slowly drizzle in 1 cup of vegetable oil until the mixture thickens and emulsifies.
3. Season with salt and pepper to taste.
4. Store in an airtight container in the refrigerator for up to one week.
User:

다음 예에서 사용자는 파리의 관광지에 대해 어시스턴트와 대화를 나눴습니다. 다음으로 사용자는 채팅 도우미가 추천하는 첫 번째 옵션에 대해 문의합니다.

Input
System: You are a helpful trip planner.
User: I am going to Paris, what should I see?
Falcon: 1. Eiffel Tower: No trip to Paris is complete without a visit to the iconic Eiffel Tower.
2. Louvre Museum: Home to some of the world's most famous art, including the Mona Lisa.
3. Notre-Dame Cathedral: A stunning example of Gothic architecture and a must-see for history buffs.
4. Champs-Élysées: One of the most famous avenues in the world, lined with shops, cafes, and theaters.
5. Montmartre: A charming neighborhood known for its bohemian vibe, street art, and stunning views of the city.
6. Palace of Versailles: A short train ride from Paris, this opulent palace was once the seat of French royalty.
7. Musée d'Orsay: Housed in a former train station, this museum boasts an impressive collection of Impressionist and Post-Impressionist art.
8. Sainte-Chapelle: A hidden gem in the heart of Paris, this medieval chapel is famous for its stunning stained glass windows.
9. Luxembourg Gardens: A beautiful park in the heart of the city, perfect for a picnic or a leisurely stroll.
User: What is so great about #1?
Falcon: Output
#1 is the Eiffel Tower, which is one of the most famous landmarks in the world. It is a symbol of Paris and a must-see attraction for many visitors. The tower offers stunning views of the city from its observation decks, and it is especially beautiful when lit up at night. Additionally, the Eiffel Tower has a rich history and is an engineering marvel, making it a fascinating destination for anyone interested in architecture or history.
User:

정리

노트북 실행을 마친 후에는 청구가 중지되도록 프로세스에서 생성한 모든 리소스를 삭제해야 합니다. 다음 코드를 사용하세요.

predictor.delete_model()
predictor.delete_endpoint()

결론

이 게시물에서는 SageMaker Studio에서 Falcon 180B를 시작하고 추론을 위해 모델을 배포하는 방법을 보여주었습니다. 기초 모델은 사전 훈련되어 있으므로 훈련 및 인프라 비용을 낮추고 사용 사례에 맞게 사용자 정의할 수 있습니다. 지금 SageMaker Studio에서 SageMaker JumpStart를 방문하여 시작하세요.

자료


저자에 관하여

카일 울리히 박사 Amazon SageMaker JumpStart 팀의 응용 과학자입니다. 그의 연구 관심사는 확장 가능한 기계 학습 알고리즘, 컴퓨터 비전, 시계열, 베이지안 비모수 및 가우시안 프로세스를 포함합니다. Duke University에서 박사 학위를 받았으며 NeurIPS, Cell 및 Neuron에 논문을 발표했습니다.

Ashish Khetan 박사 Amazon SageMaker JumpStart의 수석 응용 과학자이며 기계 학습 알고리즘 개발을 돕습니다. 그는 University of Illinois Urbana-Champaign에서 박사 학위를 받았습니다. 그는 기계 학습 및 통계적 추론 분야에서 활동적인 연구원이며 NeurIPS, ICML, ICLR, JMLR, ACL 및 EMNLP 컨퍼런스에서 많은 논문을 발표했습니다.

올리비에 크루샹t는 프랑스에 본사를 둔 AWS의 수석 기계 학습 전문가 솔루션 아키텍트입니다. Olivier는 소규모 스타트업부터 대기업까지 AWS 고객이 프로덕션 수준의 기계 학습 애플리케이션을 개발하고 배포하도록 돕습니다. 여가 시간에는 연구 논문을 읽고 친구, 가족과 함께 자연을 탐험하는 것을 즐깁니다.

칼 알베르센 Amazon SageMaker의 기반 모델 허브, 알고리즘 및 파트너십 팀을 이끌고 있습니다.

spot_img

최신 인텔리전스

spot_img