Skip to content

Commit 5a49a6f

Browse files
committed
added warning for qaic sdk
Signed-off-by: Sharvari Medhe <[email protected]>
1 parent bb3ab32 commit 5a49a6f

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

QEfficient/__init__.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
from QEfficient.peft import QEffAutoPeftModelForCausalLM
2929
from QEfficient.transformers.transform import transform
3030
from QEfficient.utils import custom_format_warning
31+
from QEfficient.utils.logging_utils import logger
3132

3233
# custom warning for the better logging experience
3334
warnings.formatwarning = custom_format_warning
@@ -50,3 +51,21 @@
5051
"QEFFAutoModelForSpeechSeq2Seq",
5152
"QEFFCommonLoader",
5253
]
54+
55+
56+
def check_qaic_sdk():
57+
"""Check if QAIC SDK is installed"""
58+
try:
59+
import platform
60+
import sys
61+
62+
sys.path.append(f"/opt/qti-aic/dev/lib/{platform.machine()}")
63+
import qaicrt # noqa: F401
64+
65+
return True
66+
except ImportError:
67+
return False
68+
69+
70+
if not check_qaic_sdk():
71+
logger.warning("QAIC SDK is not installed, eager mode features won't be available!")

0 commit comments

Comments
 (0)