คู่มือการเขียนโปรแกรม AMD HIP
คู่มือทางเทคนิคที่ครอบคลุมสำหรับการใช้งาน Heterogeneous-compute Interface for Portability (HIP) โดยให้ API รันไทม์แบบ C++ และภาษาเคอร์เนลที่ช่วยให้นักพัฒนาสามารถสร้างแอปพลิเคชันที่ใช้งานได้กับ GPU ของ AMD และ NVIDIA จากโค้ดเดียว คู่มือนี้ครอบคลุมหัวข้อตั้งแต่การติดตั้ง การตั้งค่าสภาพแวดล้อม โมเดลการเขียนโปรแกรม การจัดสรรหน่วยความจำ และเครื่องมือในการย้ายโค้ด CUDA ไปยัง HIP
ภาพรวมคอร์สเรียน
📚 สรุปเนื้อหา
คู่มือเทคนิคที่ครอบคลุมสำหรับ Heterogeneous-compute Interface for Portability (HIP) ซึ่งให้ API รันไทม์แบบ C++ และภาษาเคอร์เนลที่ช่วยให้นักพัฒนาสามารถสร้างแอปพลิเคชันที่สามารถใช้งานได้กับ GPU ของ AMD และ NVIDIA จากโค้ดเดียวเท่านั้น คู่มือนี้ครอบคลุมหัวข้อต่างๆ เช่น การติดตั้ง การตั้งค่าสภาพแวดล้อม โมเดลการเขียนโปรแกรม การจัดสรรหน่วยความจำ และเครื่องมือในการย้ายโค้ด CUDA ไปยัง HIP
เชี่ยวชาญการเขียนโปรแกรม GPU ที่สามารถนำพาได้: โค้ดเดียวกันใช้ได้ทั้งแพลตฟอร์ม AMD และ NVIDIA
ผู้เขียน: Advanced Micro Devices, Inc. (AMD)
คำขอบคุณ: AMD, โลโก้ลูกศรของ AMD, AMD Instinct, Radeon, ROCm และรูปแบบการรวมกันของพวกมัน เป็นเครื่องหมายการค้าของ Advanced Micro Devices, Inc. Linux เป็นเครื่องหมายการค้าจดทะเบียนของ Linus Torvalds. PCIe เป็นเครื่องหมายการค้าจดทะเบียนของ PCI-SIG Corporation
🎯 เป้าหมายการเรียนรู้
- นิยามคุณสมบัติหลักและประโยชน์ที่สำคัญของเฟรมเวิร์ก HIP
- แสดงวิธีการเข้าถึงและสอบถามสภาพแวดล้อม HIP โดยใช้เครื่องมือระบบ
- อธิบายความสัมพันธ์ทางสถาปัตยกรรมระหว่างความสามารถในการนำพาของ HIP กับเทคโนโลยีคอมไพเลอร์
- ดำเนินการติดตั้งเฉพาะแพลตฟอร์มสำหรับสภาพแวดล้อม NVIDIA และ AMD
- ประสานกระบวนการสร้างหลายรีพอซิทอรีเพื่อคอมไพล์ HIP จากแหล่งรหัส
- ตรวจสอบการติดตั้งที่สำเร็จโดยใช้เครื่องมือตรวจสอบและการกำหนดค่าระบบ
- ตั้งค่าและจัดการหน่วยความจำ GPU โดยใช้การจัดสรรแบบ HIP ควบคุมความสอดคล้อง และการมองเห็นหน่วยความจำโฮสต์แบบ zero-copy
- พัฒนาเคอร์เนลประสิทธิภาพสูงโดยใช้คุณสมบัติเฉพาะของ HIP เช่น คุณสมบัติฟังก์ชัน/ตัวแปร ประเภทเวกเตอร์ และเครื่องมือสังเกตสถานะ
- นำไปใช้ในอัลกอริธึมขนานขั้นสูงโดยใช้ฟังก์ชันระดับ warp shuffle, vote, ballot และกลุ่มการทำงานร่วมกัน
- ใช้เครื่องมือ HIPIFY เพื่อแปลงโค้ด CUDA ไปเป็น HIP โดยอัตโนมัติ และจัดการการเปลี่ยนแปลงโปรเจกต์แบบในสถานที่
บทเรียน 共 4 课时 · 预计 12.0h
บทเรียน
Lesson
This lesson introduces the multi-vendor dilemma in high-performance computing, where hardware heterogeneity and proprietary APIs create software fragmentation and maintenance debt. Students will learn how the HIP framework addresses these challenges by enabling performance portability and simplifying the transition between different GPU architectures.
This lesson covers the installation and configuration of the Heterogeneous-compute Interface for Portability (HIP) environment, focusing on the single-source paradigm for cross-platform GPU development. Students will learn how to manage environment variables like CUDA_PATH and HIP_PATH to enable the hipcc compiler to route code effectively across NVIDIA and AMD hardware architectures.
AI022: HIP Programming Model and API Deep Dive (Lesson 3) explores the architectural foundations of the HIP ecosystem, focusing on the ROCm stack, hardware discovery, and the porting workflow from CUDA to AMD architectures. Students will learn to utilize the hipify-perl and hipcc toolchains, manage low-level HSA runtime initialization, and implement effective memory mapping for GPU resource orchestration.
This lesson explores the Heterogeneous-compute Interface for Portability (HIP), a C++ runtime API designed to enable cross-platform GPU development by abstracting hardware layers for both NVIDIA and AMD systems. Students will learn how to configure the HIP environment, utilize the hipcc compiler, and apply functional mappings to migrate legacy CUDA applications to a unified, portable codebase.