Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion torchao/kernel/intmm.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
import logging
import os

import torch

from torchao.utils import TORCH_VERSION_AT_LEAST_2_2, TORCH_VERSION_AT_LEAST_2_6

logger = logging.getLogger(__name__)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think its recommend to have null handlers for library logging

logger = logging.getLogger(__name__)
logger.addHandler(logging.NullHandler())

And then users can turn them on w/
https://github.com/drisspg/transformer_nuggets/blob/d04895f4adb17a7db1cd99be405019501dcb3ecf/transformer_nuggets/__init__.py#L4

logger.addHandler(logging.NullHandler())

try:
# Only works for torch2.2 or newer.
if TORCH_VERSION_AT_LEAST_2_2:
from torchao.kernel import intmm_triton
else:
intmm_triton = None
except ImportError as e:
print("import error:", e)
logger.debug("import error:", e)
# On cpu-only builds might not be available.
intmm_triton = None

Expand Down
Loading