강좌 목록으로 돌아가기
AI024 전문가

ROCm 및 HIP 프로그래밍 소개: 실용적인 튜토리얼

ROCm 및 HIP 프로그래밍에 대한 실용적이고 현대적인 안내서입니다. 전체 소프트웨어 스택, 설치, 빌드 워크플로우, 커널 프로그래밍, 메모리 관리, 성능 엔지니어링, 라이브러리 사용, CUDA 마이그레이션, 그리고 생산 환경에서의 디버깅 방법을 다룹니다.

5.0
30.0h
361 학생들
10 lessons
0 좋아요
인공지능
수강 시작하기

강좌 개요

📚 콘텐츠 요약

ROCm 및 HIP를 활용한 실용적이고 최신 기술 중심의 AMD GPU 프로그래밍 안내서입니다. 전체 소프트웨어 스택, 설치, 빌드 워크플로우, 커널 프로그래밍, 메모리 관리, 성능 엔지니어링, 라이브러리 사용, CUDA 포팅, 그리고 생산 환경에서의 디버깅 실천 방법을 다룹니다.

이 기술적 심층 분석을 통해 AMD GPU 프로그래밍과 CUDA에서 HIP로의 이식성을 완전히 마스터하세요.

저자: EvoClass

감사의 말: AMD 공식 ROCm 및 HIP 문서 기반(예: ROCm, HIP, ROCm LLVM 등)

🎯 학습 목표

  1. HIP와 그가 ROCm 생태계 내에서 맡는 역할을 한 문장으로 정의하라.
  2. ROCm(플랫폼), HIP(인터페이스), ROCm 라이브러리(구성 요소) 간의 차이점을 구분하라.
  3. 하드웨어부터 애플리케이션 프레임워크까지의 계층적 구조를 포함해 ROCm 아키텍처의 계층을 식별하라.
  4. 다양한 운영 체제에서 HIP SDK와 ROCm 플랫폼 간의 관계를 정의하라.
  5. 지원 매트릭스 확인 및 설치 후 경로 설정을 포함한 체계적인 설치 워크플로우를 실행하라.
  6. 일반적인 드라이버 및 환경 접근 문제를 진단하기 위한 최소한의 검증 프로그램을 컴파일하고 실행하라.
  7. 소스 코드 이식성과 아키텍처에 특화된 성능 간의 조화를 이루기 위해 견고한 빌드 전략이 필수적임을 이해하라.
  8. CUDA의 삼중 꺾쇠 괄호 구문 대신 hipLaunchKernelGGL 매크로를 사용하여 이식 가능한 커널 시작을 구현하라.
  9. 특정 ROCm 아키텍처를 타겟으로 하고 외부 라이브러리 종속성을 관리하는 생산 수준의 CMake 프로젝트를 구성하라.
  10. HIP 커널의 구조를 정의하고 스레드 인덱싱을 위한 기본 실행 공식을 적용하라.

수업

Lesson

This lesson introduces the ROCm platform and the HIP programming model as a bridge for porting CUDA applications to AMD hardware. Students will learn how to use automated tools like hipify to migrate code while understanding the importance of architecture-aware tuning to achieve optimal performance.

This lesson covers the essential steps for installing and configuring the ROCm software stack, including dependency management, environment variable setup, and user permission requirements. Students will learn how to verify their system environment and ensure successful hardware-software communication through diagnostic tools and proper configuration.

This lesson explores the distinction between source portability and binary performance in the ROCm ecosystem, emphasizing that while HIP code is functionally portable, achieving peak throughput requires architecture-specific compilation. Students will learn to utilize the hipcc toolchain and CMake to manage build configurations that optimize code for specific hardware instruction sets.

This lesson introduces the HIP programming model, focusing on the transition from sequential CPU iteration to spatial GPU parallelism using the Parallel Pivot approach. Students will learn to map independent data tasks to thread grids, manage memory, and implement kernel execution with proper boundary checks and error handling.

AI024: Memory Management and Data Patterns (Lesson 5) explores the memory-centric nature of GPU performance, focusing on the Roofline Model and the critical importance of minimizing data movement between host and device. Students will learn to distinguish between memory-bound and compute-bound kernels while mastering strategies to optimize data residence and bandwidth utilization.

This lesson explores the transition from synchronous to asynchronous GPU execution, focusing on how to use HIP streams to decouple CPU and GPU tasks. Students will learn to optimize performance by implementing non-blocking memory transfers and kernel launches to maximize hardware utilization and eliminate execution bottlenecks.

This lesson introduces a systematic, data-driven approach to performance engineering on AMD GPUs, emphasizing the use of tools like rocprofv3 to identify bottlenecks rather than relying on intuition. Students will learn to follow a six-step scientific workflow to optimize memory access, instruction throughput, and hardware utilization while avoiding common performance "superstitions."

This lesson introduces the Library-First Engineering Principle, which emphasizes using optimized ROCm libraries like rocBLAS and rocFFT to reduce technical debt and ensure hardware portability. Students will learn to prioritize these vendor-tuned solutions over custom kernel development to achieve better performance and easier maintenance across evolving GPU architectures.

AI024: Porting CUDA Applications to HIP (Lesson 9) covers the systematic, incremental migration of CUDA code to the HIP platform using tools like HIPIFY-Clang and HIPIFY-Perl. Students will learn to distinguish between mechanical API translations and architectural optimizations, such as adjusting for warp-size differences, to ensure functional and performance parity on AMD ROCm hardware.

This lesson explores the GPU Developer’s Creed, which prioritizes functional correctness and architectural isolation over raw performance when working with ROCm and HIP. Students will learn to implement systematic debugging, testing, and CI/CD practices to ensure stable, reproducible, and accurate GPU kernel deployments.