Kembali ke Kursus
AI024 Profesional

Pengantar Pemrograman ROCm dan HIP: Tutorial Praktis

Panduan praktis dan modern tentang pemrograman GPU AMD dengan ROCm dan HIP. Mencakup seluruh tumpukan perangkat lunak, instalasi, alur kerja pembuatan, pemrograman kernel, manajemen memori, insinyur kinerja, penggunaan perpustakaan, porting CUDA, serta praktik debugging produksi.

5.0
30.0h
361 siswa
10 lessons
0 suka
Kecerdasan Buatan
Mulai Belajar

Gambaran Umum Kursus

📚 Ringkasan Konten

Panduan praktis dan modern tentang pemrograman GPU AMD dengan ROCm dan HIP. Meliputi seluruh tumpukan perangkat lunak, instalasi, alur pembuatan (build), pemrograman kernel, manajemen memori, rekayasa kinerja, penggunaan pustaka, porting CUDA, serta praktik debugging produksi.

Kuasai pemrograman GPU AMD dan portabilitas CUDA ke HIP melalui eksplorasi teknis mendalam ini.

Penulis: EvoClass

Ucapan Terima Kasih: Dokumentasi resmi AMD untuk ROCm dan HIP, termasuk proyek-proyek seperti ROCm, HIP, dan ROCm LLVM.

🎯 Tujuan Pembelajaran

  1. Menjelaskan HIP dan perannya dalam ekosistem ROCm dalam satu kalimat singkat dan padat.
  2. Membedakan antara ROCm (platform), HIP (antarmuka), dan pustaka ROCm (komponen dasar).
  3. Mengidentifikasi lapisan hierarkis arsitektur ROCm dari perangkat keras hingga kerangka aplikasi.
  4. Menjelaskan hubungan antara SDK HIP dan platform ROCm di berbagai sistem operasi.
  5. Melaksanakan alur instalasi yang sistematis, termasuk verifikasi matriks dukungan dan konfigurasi path pasca-instalasi.
  6. Mengompilasi dan menjalankan program verifikasi minimal untuk menangani masalah umum terkait driver dan akses lingkungan.
  7. Memahami mengapa strategi pembuatan yang kuat sangat penting untuk menyelaraskan portabilitas sumber dengan kinerja khusus arsitektur.
  8. Menerapkan pemanggilan kernel portabel menggunakan makro hipLaunchKernelGGL sebagai alternatif dari sintaks triple-angle-bracket pada CUDA.
  9. Mengonfigurasi proyek CMake tingkat produksi yang menargetkan arsitektur ROCm tertentu dan mengelola dependensi pustaka eksternal.
  10. Mendefinisikan anatomi kernel HIP dan menerapkan rumus eksekusi dasar untuk indeks thread.

Pelajaran

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.