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)

제13장. PyTorch자질 , 튜닝 및 확장

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

AI 훈련 및 추론 파이프라인은 Python 인터프리터 오버헤드, CPU 호스트 측 데이터 로딩 지연, CUDA 커널 활용도 저하, GPU 장치 메모리 경합 등 모든 계층에서 성능 병목 현상이 발생할 수 있습니다. 효과적인 최적화를 위해서는 전체 시스템을 포괄하는 여러 도구를 사용하여 스택의 여러 수준에서 자질을 확인해야 합니다.

이 장에서는 최신 NVIDIA GPU에서 실행되는 PyTorch 워크로드의 자질, 디버깅 및 시스템 수준 튜닝에 중점을 둡니다. PyTorch 내장 프로파일러, NVIDIA Nsight 도구, Linux 기반 CPU 프로파일링( perf)을 활용하여 병목 현상을 식별하고 해결하는 방법을 살펴봅니다. 또한 PyTorch 메모리 프로파일링 및 메모리 할당기 튜닝, PyTorch가 동시성 처리를 위해 CUDA 스트림을 활용하는 방식, 커널 실행 오버헤드 감소를 위한 CUDA 그래프 사용법도 논의합니다.

다음으로 PyTorch 분산 데이터 병렬(DDP), 완전 분할 데이터 병렬(FSDP) 및 기타 모델 병렬화 전략을 활용해 데이터 파이프라인을 최적화하고 다중 GPU로 확장하는 방법을 보여드립니다. 이후 홀리스틱 트레이스 분석(HTA)과 퍼페토(Perfetto)를 포함한 다중 GPU 및 다중 노드 환경 자질 방법을 시연합니다.

본 장 전반에 걸쳐 커널 실행 시간, 하드웨어 활용도 지표, 메모리 사용량, 데이터 로딩 효율성, 확장 시 전반적인 비용 효율성에 초점을 맞춘 성능 상의 절충점과 정량적 사례를 강조합니다. 본 장을 마치면 전체 스택에 걸쳐 PyTorch 워크로드를 자질하고 튜닝하는 효과적이고 종합적인 접근 방식을 구현하는 방법을 이해하게 될 것입니다.

NVTX 마커와 자질 도구

성능에 대한 종합적인 관점을 확보하려면 여러 수준에서 자질을 확인하고 전체 시스템을 포괄하는 도구를 사용하는 것이 중요합니다. 실무자와 성능 엔지니어가 시스템 스택의 모든 계층에 걸쳐 종합적인 자질을 수행하기 위해 사용하는 공통 도구 및 모범 사례 세트가 존재합니다.

도구를 살펴보기 전에 NVIDIA Tools Extension(NVTX)과 NVTX 마커를 강조할 필요가 있습니다. 이 마커는 프로파일러의 타임라인 뷰에서 시간 범위를 표시하며, 서로 다른 프로파일러가 동일한 단계에서 이벤트를 상호 연관시킬 수 있게 합니다.

예를 들어, "forward" 에 대한 NVTX 범위는 PyTorch 자질 추적 기록과 Nsight Systems의 타임라인 모두에 표시됩니다. 이는 스택의 서로 다른 계층에서 도구 간 분석을 훨씬 용이하게 합니다. NVTX 마커는 PyTorch 및 CUDA 생태계 관련 모든 것을 포함하여 대부분의 최신 AI 프레임워크와 라이브러리에서 지원됩니다.

NVTX 마커는 CUDA C++, PyTorch 또는 NVIDIA GPU를 지원하는 모든 ...

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