From 5a7f0cc67642e55be4ba31d047b593851a2830a1 Mon Sep 17 00:00:00 2001 From: Donato Capitella Date: Mon, 23 Feb 2026 09:49:42 +0000 Subject: [PATCH] feat: Implement temporary patch for C10_CHECK macro import missing --- Dockerfile | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1a59c9c..63d626d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -66,13 +66,21 @@ RUN echo "import sys, re" > patch_strix.py && \ echo "txt = re.sub(r'device_name = .*', 'device_name = \"gfx1151\"', txt)" >> patch_strix.py && \ echo "txt += '\n def get_device_name(self, device_id: int = 0) -> str:\n return \"AMD-gfx1151\"\n'" >> patch_strix.py && \ echo "p.write_text(txt)" >> patch_strix.py && \ - # Patch 3: Fix C10_HIP_CHECK undeclared identifier in selective_scan_fwd.hip - echo "p_hip = Path('csrc/mamba/mamba_ssm/selective_scan_fwd.hip')" >> patch_strix.py && \ - echo "if p_hip.exists():" >> patch_strix.py && \ - echo " txt_hip = p_hip.read_text()" >> patch_strix.py && \ - echo " macro_def = '#ifndef C10_HIP_CHECK\n#include \n#ifndef C10_HIP_CHECK\n#define C10_HIP_CHECK(error) if (error != hipSuccess) { abort(); }\n#endif\n#endif\n'" >> patch_strix.py && \ - echo " txt_hip = macro_def + txt_hip" >> patch_strix.py && \ - echo " p_hip.write_text(txt_hip)" >> patch_strix.py && \ + # Patch 3: Fix C10_HIP_CHECK undeclared identifier by patching source files + echo "import glob" >> patch_strix.py && \ + echo "for f in glob.glob('csrc/mamba/mamba_ssm/selective_scan_*.cu') + glob.glob('csrc/mamba/mamba_ssm/selective_scan_*.hip'):" >> patch_strix.py && \ + echo " p_f = Path(f)" >> patch_strix.py && \ + echo " if p_f.exists():" >> patch_strix.py && \ + echo " txt = p_f.read_text()" >> patch_strix.py && \ + echo " macro_def = '''" >> patch_strix.py && \ + echo "#ifndef C10_HIP_CHECK" >> patch_strix.py && \ + echo "#define C10_HIP_CHECK(error) do { if (error != hipSuccess) { abort(); } } while(0)" >> patch_strix.py && \ + echo "#endif" >> patch_strix.py && \ + echo "#ifndef C10_CUDA_CHECK" >> patch_strix.py && \ + echo "#define C10_CUDA_CHECK(error) do { if (error != cudaSuccess) { abort(); } } while(0)" >> patch_strix.py && \ + echo "#endif" >> patch_strix.py && \ + echo "'''" >> patch_strix.py && \ + echo " p_f.write_text(macro_def + '\\n' + txt)" >> patch_strix.py && \ # ----------- echo "print('Successfully patched vLLM for Strix Halo')" >> patch_strix.py && \ python patch_strix.py && \