-
Notifications
You must be signed in to change notification settings - Fork 129
/
Copy pathhook-bitsandbytes.py
23 lines (20 loc) · 1.09 KB
/
hook-bitsandbytes.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# ------------------------------------------------------------------
# Copyright (c) 2023 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ---------------------------------------------------
from PyInstaller.utils.hooks import collect_dynamic_libs
# bitsandbytes contains several extensions for CPU and different CUDA versions: libbitsandbytes_cpu.so,
# libbitsandbytes_cuda110_nocublaslt.so, libbitsandbytes_cuda110.so, etc. At build-time, we could query the
# `bitsandbytes.cextension.setup` and its `binary_name` attribute for the extension that is in use. However, if the
# build system does not have CUDA available, this would automatically mean that we will not collect any of the CUDA
# libs. So for now, we collect them all.
binaries = collect_dynamic_libs("bitsandbytes")
# bitsandbytes uses triton's JIT module, which requires access to source .py files.
module_collection_mode = 'pyz+py'