Spinach Forest

Jul 9, 2025 11:07

Creating custom kernels for the AMD MI300

ROCm のカーネルってどう書くんだろうなと GitHub の repo をひやかす

GitHub - huggingface/hf-rocm-kernels

しかし .cu しか見当たらない。

hf-rocm-kernels/csrc/op_src/residual_rms at main · huggingface/hf-rocm-kernels · GitHub

CMake 関係のディレクトリをみると hipify なるものを発見

hf-rocm-kernels/cmake/hipify.py at main · huggingface/hf-rocm-kernels · GitHub

GitHub - ROCm/hipify_torch

hipify_torch is a python utility to convert CUDA C/C++ code into HIP C/C++ code. It is NOT a parser; it does a smart but basic search-and-replace based on CUDA-to-HIP mappings which are specified in the hipify_torch module. It can also “hipify” the header include statements in your source code to ensure that it’s the hipified header files that are included.

“MI300 のためにカスタムカーネル書くぞ!” というプロジェクトがこんなのに頼っている現状をみると、AMD の戦いの先は長そうである。