Skip to content

Commit 88bb2c3

Browse files
msaroufimliangel-02
authored andcommitted
Silence loud error on torchao cpu builds (#1808)
* Silence loud commit * Update intmm.py
1 parent 320024e commit 88bb2c3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

torchao/kernel/intmm.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
1+
import logging
12
import os
23

34
import torch
45

56
from torchao.utils import TORCH_VERSION_AT_LEAST_2_2, TORCH_VERSION_AT_LEAST_2_6
67

8+
logger = logging.getLogger(__name__)
9+
logger.addHandler(logging.NullHandler())
10+
711
try:
812
# Only works for torch2.2 or newer.
913
if TORCH_VERSION_AT_LEAST_2_2:
1014
from torchao.kernel import intmm_triton
1115
else:
1216
intmm_triton = None
1317
except ImportError as e:
14-
print("import error:", e)
18+
logger.debug("import error:", e)
1519
# On cpu-only builds might not be available.
1620
intmm_triton = None
1721

0 commit comments

Comments
 (0)