Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] hivemind.compression is not compatible with bitsandbytes == 0.39.1 #572

Open
borzunov opened this issue Jun 30, 2023 · 2 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@borzunov
Copy link
Member

borzunov commented Jun 30, 2023

With bitsandbytes == 0.39.1 (the first version with 4-bit support), we get this for CompressionType.BLOCKWISE_8BIT:

Traceback (most recent call last):
  File "/storage/hdd1/jheuristic/exp/decentralized/borzunov/petals/src/petals/server/handler.py", line 289, in rpc_backward
    return runtime_pb2.ExpertResponse(tensors=self._serialize_grads(grads, requested_backends, metadata))
  File "/storage/hdd1/jheuristic/exp/decentralized/borzunov/petals/src/petals/server/handler.py", line 338, in _serialize_grads
    return [
  File "/storage/hdd1/jheuristic/exp/decentralized/borzunov/petals/src/petals/server/handler.py", line 339, in <listcomp>
    serialize_torch_tensor(result.to(proto.dtype), compression, allow_inplace=True)
  File "/home/jheuristic/anaconda3/envs/py38_petals_borzunov/lib/python3.8/site-packages/hivemind/compression/serialization.py", line 41, in serialize_torch_tensor
    return compression.compress(tensor, info, allow_inplace)
  File "/home/jheuristic/anaconda3/envs/py38_petals_borzunov/lib/python3.8/site-packages/hivemind/compression/quantization.py", line 147, in compress
    quantized, (absmax, codebook) = self.quantize(tensor, allow_inplace=allow_inplace)
  File "/home/jheuristic/anaconda3/envs/py38_petals_borzunov/lib/python3.8/site-packages/hivemind/compression/quantization.py", line 138, in quantize
    quantized, (absmax, codebook) = quantize_blockwise(tensor)
ValueError: too many values to unpack (expected 2)

That is because bnb 0.39.1 returns more params in quantize_blockwise() and requires more params in dequantize_blockwise() (4 params and 2 Nones instead of just (absmax, codebook)): code

Discovered in bigscience-workshop/petals#333.

@borzunov borzunov added the bug Something isn't working label Jun 30, 2023
@borzunov borzunov assigned justheuristic and mryab and unassigned justheuristic Jun 30, 2023
borzunov added a commit to bigscience-workshop/petals that referenced this issue Jun 30, 2023
@hrishikeshio
Copy link

can we use 0.38 till the fix? I tried and I am getting these kind of errors.
Jul 19 22:14:44.627 [WARN] [hivemind.averaging.partition.finalize:173] Averaging: received 48.1% results
Jul 19 22:14:16.398 [WARN] [hivemind.averaging.partition.finalize:270] Reducer: received 50.0% of input tensors

@justheuristic
Copy link
Member

Thank you! i'll try 0.38 and newer versions (e.g. 0.40.post*) and check for similar errors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants