__init__.py 958 Bytes
Newer Older
1
2
3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
Tim Dettmers's avatar
Tim Dettmers committed
4
# LICENSE file in the root directory of this source tree.
Max Ryabinin's avatar
Max Ryabinin committed
5

6
7
8
9

import torch

from . import _ops, research, utils
10
11
12
from .autograd._functions import (
    MatmulLtState,
    matmul,
Aarni Koskela's avatar
Aarni Koskela committed
13
    matmul_4bit,
14
)
15
16
from .backends.cpu import ops as cpu_ops
from .backends.default import ops as default_ops
17
from .nn import modules
18
from .optim import adam
Max Ryabinin's avatar
Max Ryabinin committed
19

20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# This is a signal for integrations with transformers/diffusers.
# Eventually, we will remove this and check based on release version.
features = {"multi-backend"}
supported_torch_devices = {
    "cuda",
    "cpu",
    # "mps",
    # "xpu",
    # "hpu",
    # "npu",
}

if torch.cuda.is_available():
    from .backends.cuda import ops as cuda_ops

35
36
37
38
39
__pdoc__ = {
    "libbitsandbytes": False,
    "optim.optimizer.Optimizer8bit": False,
    "optim.optimizer.MockArgs": False,
}
40

Matthew Douglas's avatar
Matthew Douglas committed
41
__version__ = "0.46.0.dev0"