vector-quantize-pytorch 1.17.0__tar.gz → 1.17.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {vector_quantize_pytorch-1.17.0 → vector_quantize_pytorch-1.17.2}/PKG-INFO +1 -1
- {vector_quantize_pytorch-1.17.0 → vector_quantize_pytorch-1.17.2}/pyproject.toml +1 -1
- {vector_quantize_pytorch-1.17.0 → vector_quantize_pytorch-1.17.2}/vector_quantize_pytorch/finite_scalar_quantization.py +1 -1
- {vector_quantize_pytorch-1.17.0 → vector_quantize_pytorch-1.17.2}/vector_quantize_pytorch/lookup_free_quantization.py +3 -1
- {vector_quantize_pytorch-1.17.0 → vector_quantize_pytorch-1.17.2}/.github/workflows/build.yml +0 -0
- {vector_quantize_pytorch-1.17.0 → vector_quantize_pytorch-1.17.2}/.github/workflows/python-publish.yml +0 -0
- {vector_quantize_pytorch-1.17.0 → vector_quantize_pytorch-1.17.2}/.github/workflows/test.yml +0 -0
- {vector_quantize_pytorch-1.17.0 → vector_quantize_pytorch-1.17.2}/.gitignore +0 -0
- {vector_quantize_pytorch-1.17.0 → vector_quantize_pytorch-1.17.2}/LICENSE +0 -0
- {vector_quantize_pytorch-1.17.0 → vector_quantize_pytorch-1.17.2}/README.md +0 -0
- {vector_quantize_pytorch-1.17.0 → vector_quantize_pytorch-1.17.2}/examples/autoencoder.py +0 -0
- {vector_quantize_pytorch-1.17.0 → vector_quantize_pytorch-1.17.2}/examples/autoencoder_fsq.py +0 -0
- {vector_quantize_pytorch-1.17.0 → vector_quantize_pytorch-1.17.2}/examples/autoencoder_lfq.py +0 -0
- {vector_quantize_pytorch-1.17.0 → vector_quantize_pytorch-1.17.2}/images/fsq.png +0 -0
- {vector_quantize_pytorch-1.17.0 → vector_quantize_pytorch-1.17.2}/images/lfq.png +0 -0
- {vector_quantize_pytorch-1.17.0 → vector_quantize_pytorch-1.17.2}/images/vq.png +0 -0
- {vector_quantize_pytorch-1.17.0 → vector_quantize_pytorch-1.17.2}/ruff.toml +0 -0
- {vector_quantize_pytorch-1.17.0 → vector_quantize_pytorch-1.17.2}/tests/test_latent_quantization.py +0 -0
- {vector_quantize_pytorch-1.17.0 → vector_quantize_pytorch-1.17.2}/tests/test_readme.py +0 -0
- {vector_quantize_pytorch-1.17.0 → vector_quantize_pytorch-1.17.2}/vector_quantize_pytorch/__init__.py +0 -0
- {vector_quantize_pytorch-1.17.0 → vector_quantize_pytorch-1.17.2}/vector_quantize_pytorch/latent_quantization.py +0 -0
- {vector_quantize_pytorch-1.17.0 → vector_quantize_pytorch-1.17.2}/vector_quantize_pytorch/random_projection_quantizer.py +0 -0
- {vector_quantize_pytorch-1.17.0 → vector_quantize_pytorch-1.17.2}/vector_quantize_pytorch/residual_fsq.py +0 -0
- {vector_quantize_pytorch-1.17.0 → vector_quantize_pytorch-1.17.2}/vector_quantize_pytorch/residual_lfq.py +0 -0
- {vector_quantize_pytorch-1.17.0 → vector_quantize_pytorch-1.17.2}/vector_quantize_pytorch/residual_vq.py +0 -0
- {vector_quantize_pytorch-1.17.0 → vector_quantize_pytorch-1.17.2}/vector_quantize_pytorch/vector_quantize_pytorch.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: vector-quantize-pytorch
|
|
3
|
-
Version: 1.17.
|
|
3
|
+
Version: 1.17.2
|
|
4
4
|
Summary: Vector Quantization - Pytorch
|
|
5
5
|
Project-URL: Homepage, https://pypi.org/project/vector-quantize-pytorch/
|
|
6
6
|
Project-URL: Repository, https://github.com/lucidrains/vector-quantizer-pytorch
|
|
@@ -187,7 +187,7 @@ class FSQ(Module):
|
|
|
187
187
|
# whether to force quantization step to be full precision or not
|
|
188
188
|
|
|
189
189
|
force_f32 = self.force_quantization_f32
|
|
190
|
-
quantization_context = partial(autocast, enabled = False) if force_f32 else nullcontext
|
|
190
|
+
quantization_context = partial(autocast, 'cuda', enabled = False) if force_f32 else nullcontext
|
|
191
191
|
|
|
192
192
|
with quantization_context():
|
|
193
193
|
orig_dtype = z.dtype
|
|
@@ -10,7 +10,9 @@ from math import log2, ceil
|
|
|
10
10
|
from functools import partial, cache
|
|
11
11
|
from collections import namedtuple
|
|
12
12
|
from contextlib import nullcontext
|
|
13
|
+
|
|
13
14
|
import torch.distributed as dist
|
|
15
|
+
from torch.distributed import nn as dist_nn
|
|
14
16
|
|
|
15
17
|
import torch
|
|
16
18
|
from torch import nn, einsum
|
|
@@ -36,7 +38,7 @@ def maybe_distributed_mean(t):
|
|
|
36
38
|
if not is_distributed():
|
|
37
39
|
return t
|
|
38
40
|
|
|
39
|
-
|
|
41
|
+
dist_nn.all_reduce(t)
|
|
40
42
|
t = t / dist.get_world_size()
|
|
41
43
|
return t
|
|
42
44
|
|
{vector_quantize_pytorch-1.17.0 → vector_quantize_pytorch-1.17.2}/.github/workflows/build.yml
RENAMED
|
File without changes
|
|
File without changes
|
{vector_quantize_pytorch-1.17.0 → vector_quantize_pytorch-1.17.2}/.github/workflows/test.yml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{vector_quantize_pytorch-1.17.0 → vector_quantize_pytorch-1.17.2}/examples/autoencoder_fsq.py
RENAMED
|
File without changes
|
{vector_quantize_pytorch-1.17.0 → vector_quantize_pytorch-1.17.2}/examples/autoencoder_lfq.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{vector_quantize_pytorch-1.17.0 → vector_quantize_pytorch-1.17.2}/tests/test_latent_quantization.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|