hf_text-generation-inference/server/text_generation_server
Daniël de Kok 8511669cb2
Move quantized weight handling out of the `Weights` class (#2194)
Quantized weights were loaded in the `Weights` class, but this was
getting quite unwieldy, where every higher level method to load weights
was a long conditional to cover all the different quantizers.

This change moves loading of quantized weights out of the `Weights`
class. This is done by defining a simple `WeightsLoader` interface
that is implemented by `Exl2WeightsLoader`, `GPTQWeightsLoader`,
and `MarlinWeightsLoader`. These implementations are in the quantizers'
respective modules. The `Weights` class provides the low-level load
operations (such as loading tensors or sharded tensors), but delegates
loads that need quantizer-specific weight processing to a loader. The
loaders still use the low-level functionality provided by `Weights`.

I initially tried making a hierarchy where a class like `GPTQWeights`
would inherit from `Weights`. But it is not very flexible (e.g. does
not work well with the new weight storage mock used in tests) and
the implicit indirections made the code harder to follow.
2024-07-09 20:04:03 +02:00
..
adapters Enable multiple LoRa adapters (#2010) 2024-06-25 14:46:27 -04:00
layers Move quantized weight handling out of the `Weights` class (#2194) 2024-07-09 20:04:03 +02:00
models Move quantized weight handling out of the `Weights` class (#2194) 2024-07-09 20:04:03 +02:00
pb chore: add pre-commit (#1569) 2024-02-16 11:58:58 +01:00
utils Move quantized weight handling out of the `Weights` class (#2194) 2024-07-09 20:04:03 +02:00
__init__.py feat(clients): Python client (#103) 2023-03-07 18:52:22 +01:00
cache.py fix(server): decrease memory fragmentation (#557) 2023-07-06 14:28:33 +02:00
cli.py Enable multiple LoRa adapters (#2010) 2024-06-25 14:46:27 -04:00
interceptor.py v2.0.0 (#1736) 2024-04-12 18:38:34 +02:00
server.py Enable multiple LoRa adapters (#2010) 2024-06-25 14:46:27 -04:00
tracing.py Add OTLP Service Name Environment Variable (#2076) 2024-06-25 09:33:01 +02:00