File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
third_party/proton/proton Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -24,12 +24,14 @@ def _select_backend() -> str:
2424 elif backend == "xpu" :
2525 global UTILS_CACHE_PATH
2626 UTILS_CACHE_PATH = triton .runtime .driver .active .build_proton_help_lib ()
27- files = importlib .metadata .files ('intel-pti' )
28- if files is not None :
29- for f in files :
30- if f .name == 'libpti_view.so' :
31- os .environ ["TRITON_XPUPTI_LIB_PATH" ] = str (pathlib .Path (f .locate ()).parent .resolve ())
32- break
27+ try :
28+ if files := importlib .metadata .files ('intel-pti' ) is not None :
29+ for f in files :
30+ if f .name == 'libpti_view.so' :
31+ os .environ ["TRITON_XPUPTI_LIB_PATH" ] = str (pathlib .Path (f .locate ()).parent .resolve ())
32+ break
33+ except importlib .metadata .PackageNotFoundError :
34+ pass
3335 return "xpupti"
3436 else :
3537 raise ValueError ("No backend is available for the current target." )
You can’t perform that action at this time.
0 commit comments