Skip to Content
AI 시스템 성능 엔지니어링 (Korean Edition)
book

AI 시스템 성능 엔지니어링 (Korean Edition)

by Chris Fregly
November 2025
Beginner to intermediate
1060 pages
20h 15m
Korean
O'Reilly Media, Inc.
Content preview from AI 시스템 성능 엔지니어링 (Korean Edition)

제19장. 동적 및 적응형 추론 엔진 최적화

이 작품은 AI를 사용하여 번역되었습니다. 여러분의 피드백과 의견을 환영합니다: translation-feedback@oreilly.com

현대 하드웨어에서 초대형 언어 모델(LLM) 추론 은 다양한 조건에서 높은 처리량과 낮은 지연 시간을 동시에 달성하기 위해 동적 런타임 적응이 필요합니다. 모델 서빙 최적화에 대한 정적인 "일률적" 접근 방식은 더 이상 충분하지 않습니다.

대신 최첨단 모델 서비스 시스템은 병렬 처리, 수치 정밀도, CUDA 커널 스케줄링, 메모리 사용량을 실시간으로 조정하는 적응형 전략을 사용합니다. 본 장에서는 동적 병렬 처리 전환, 정밀도 스케일링, 실시간 캐시 관리, 강화 학습(RL) 기반 튜닝 등 이러한 고급 기법을 탐구합니다.

본 장은 초대규모 LLM 추론을 위한 모범 사례를 제시하며, 자체 성능을 모니터링하고 실시간으로 적응하여 효율성을 극대화하는 엔진을 구성하는 방법을 가르칩니다.

적응형 병렬 처리 전략 (TP 대 PP 대 하이브리드)

대규모 LLMs은 텐서 병렬 처리( ), 파이프라인 병렬 처리(PIPE parallelism) 또는 하이브리드 접근법과 같은 모델 병렬 처리를 통해 여러 GPU에 걸쳐 계산을 분산해야 합니다. 각 접근법에는 장단점이 있습니다. 표 19-1은 특정 추론 트래픽 패턴에 권장되는 병렬 처리 전략을 요약합니다.

표 19-1. 권장 병렬 처리 전략에 매핑된 일반적인 추론 트래픽 패턴요약
추론 트래픽 p 권장 병렬 처리 이유
짧은 요청 다수(256 토큰 미만, 높은 RPS) 데이터 병렬/복제본 확장 GPU 간 통신 최소화; 각 GPU는 독립적인 요청을 처리하는 복제본을 실행함 (모델이 단일 GPU 메모리에 들어간다고 가정)
긴 요청이 적음 (≥ 8k 토큰, 낮은 동시성) 파이프라인 병렬 처리(마이크로배치 사용) GPU 간 레이어 분할로 요청당 지연 시간 감소
혼합 부하(짧은 + 일부 긴) 하이브리드 동적(자동 전환) 단일 GPU에서 소규모 채팅 처리, 지연 시간 SLA 충족을 위한 대규모 채팅 파이프라인 처리
초대형 모델(GPU 메모리 초과) 텐서 + 파이프라인 하이브리드 모델 적합성을 위해 필요함; 두 차원 모두에서 컴퓨팅과 메모리 균형 유지
MoE 모델 추론 (스파스 전문가 선택) 전문가 병렬 처리 개별 전문가를 GPU에 분산; 각 요청은 전문가의 하위 집합만 호출하여 장치당 메모리 및 컴퓨팅 부하 감소

데이터 병렬 및 복제 스케일링 전략은 전체 모델을 각 GPU에 복제하고 들어오는 요청을 이러한 복제본들 간에 부하 분산합니다. 각 GPU가 별도의 요청을 독립적으로 처리하므로 개별 추론에 대한 GPU 간 동기화가 필요하지 않습니다.

이는 최소한의 통신 오버헤드로 많은 소규모 또는 중간 규모 입력에 대한 처리량을 극대화합니다. 그러나 모델이 단일 GPU 메모리에 들어가지 않는 경우 데이터 병렬화는 선택할 수 없습니다.

텐서 병렬 처리(TP)는 모델 병렬 처리의 한 형태(데이터 병렬 처리와 대조)로, ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

PostgreSQL로 데이터 및 AI 플랫폼 구축하기 (Korean Edition)

PostgreSQL로 데이터 및 AI 플랫폼 구축하기 (Korean Edition)

Tom Taulli, Benjamin Anderson, Jozef de Vries
도메인 중심 혁신 (Korean Edition)

도메인 중심 혁신 (Korean Edition)

Carola Lilienthal, Henning Schwentner
AI 에이전트를 위한 메모리 관리

AI 에이전트를 위한 메모리 관리

Benjamin Labaschin, Jim Allen Wallace, Andrew Brookins, Manvinder Singh

Publisher Resources

ISBN: 0642572281533