已合并
fix: adapt Inductor compile mode for TA3.6 #45315
fix: adapt Inductor compile mode for TA3.6 #45315
已合并
luqichao创建于 23 天前
2 个文件变更+7-3
@@ -34,7 +34,7 @@ class NPUKernelType(Enum):
34 34 
35 def compile_mode(self):35 def compile_mode(self):
36 if self == NPUKernelType.SIMT_TEMPLATE:36 if self == NPUKernelType.SIMT_TEMPLATE:
37- return "unstructured_in_simt"37+ return "simd_simt_template"
38 return str(self)38 return str(self)
39 39 
40 40 
@@ -825,7 +825,9 @@ class NPUCachingAutotuner(CachingAutotuner):
825 and not self.inductor_meta.get("is_hip", False)825 and not self.inductor_meta.get("is_hip", False)
826 )826 )
827 827 
828- compile_meta['compile_mode'] = cfg_kwargs.get('compile_mode')828+ compile_meta['compile_mode'] = (
829+ cfg_kwargs.get('compile_mode') or NPUKernelType.SIMT_TEMPLATE.compile_mode()
830+ )
829 831 
830 # device type will be "hip" rather than "cuda" here832 # device type will be "hip" rather than "cuda" here
831 compile_meta["device_type"] = self.device_props.type833 compile_meta["device_type"] = self.device_props.type
@@ -1261,7 +1263,9 @@ class NPUCachingAutotuner(CachingAutotuner):
1261 and not self.inductor_meta.get("is_hip", False)1263 and not self.inductor_meta.get("is_hip", False)
1262 )1264 )
1263 1265 
1264- compile_meta['compile_mode'] = cfg_kwargs.get('compile_mode')1266+ compile_meta['compile_mode'] = (
1267+ cfg_kwargs.get('compile_mode') or NPUKernelType.SIMT_TEMPLATE.compile_mode()
1268+ )
1265 1269 
1266 # device type will be "hip" rather than "cuda" here1270 # device type will be "hip" rather than "cuda" here
1267 compile_meta["device_type"] = self.device_props.type1271 compile_meta["device_type"] = self.device_props.type