compressed-tensors-nightly 0.4.0.20240617__py3-none-any.whl → 0.4.0.20240619__py3-none-any.whl

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.
@@ -93,6 +93,14 @@ def dequantize(
93
93
  :param args: quantization args used to quantize x_q
94
94
  :return: dequantized float tensor
95
95
  """
96
+ # ensure all tensors are on the same device
97
+ # assumes that the target device is the input
98
+ # tensor's device
99
+ if x_q.device != scale.device:
100
+ scale = scale.to(x_q.device)
101
+ if x_q.device != zero_point.device:
102
+ zero_point = zero_point.to(x_q.device)
103
+
96
104
  if args is None:
97
105
  if scale.ndim == 0 or scale.ndim == 1:
98
106
  args = QuantizationArgs(strategy=QuantizationStrategy.TENSOR)
@@ -108,10 +108,10 @@ def is_preset_scheme(name: str) -> bool:
108
108
 
109
109
 
110
110
  W8A8 = dict(
111
- weights=QuantizationArgs(), input_activations=QuantizationArgs(symmetric=False)
111
+ weights=QuantizationArgs(), input_activations=QuantizationArgs(symmetric=True)
112
112
  )
113
113
 
114
- W4A16 = dict(weights=QuantizationArgs(num_bits=4, symmetric=False))
114
+ W4A16 = dict(weights=QuantizationArgs(num_bits=4, symmetric=True))
115
115
 
116
116
  PRESET_SCHEMES = {
117
117
  "W8A8": W8A8,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: compressed-tensors-nightly
3
- Version: 0.4.0.20240617
3
+ Version: 0.4.0.20240619
4
4
  Summary: Library for utilization of compressed safetensors of neural network models
5
5
  Home-page: https://github.com/neuralmagic/compressed-tensors
6
6
  Author: Neuralmagic, Inc.
@@ -21,12 +21,12 @@ compressed_tensors/config/sparse_bitmask.py,sha256=pZUboRNZTu6NajGOQEFExoPknak5y
21
21
  compressed_tensors/quantization/__init__.py,sha256=83J5bPB7PavN2TfCoW7_vEDhfYpm4TDrqYO9vdSQ5bk,760
22
22
  compressed_tensors/quantization/quant_args.py,sha256=Z9Zu20ooAwEWlliAdUw1f1zwSrheuD6vqm3YXgJ1Lws,4388
23
23
  compressed_tensors/quantization/quant_config.py,sha256=hL42sXp1wAZxyrkHarw7tAMRcwSVEr0MT3wmrmL3NhE,8285
24
- compressed_tensors/quantization/quant_scheme.py,sha256=-hAK1-C67_wJl10eaVLUvbslPBTV04WyzL_J-u9f1ck,3571
24
+ compressed_tensors/quantization/quant_scheme.py,sha256=3LX_UMS0uaYbBW1Zei-REuGXtNtFwAMk8lIj7lnHDP0,3569
25
25
  compressed_tensors/quantization/lifecycle/__init__.py,sha256=ggRGWRqhCxCaTTDWRcgTVX3axnS2xV6rc5YvdzK7fSg,798
26
26
  compressed_tensors/quantization/lifecycle/apply.py,sha256=aZrglJ5mR3Xaxwj51-1BVVB1JGVkKQEeHxGfBaVmsHI,8881
27
27
  compressed_tensors/quantization/lifecycle/calibration.py,sha256=mLns4jlaWmBwOW8Jtlm5bMX-JET1AiZYUBO7qa-XuxI,1776
28
28
  compressed_tensors/quantization/lifecycle/compressed.py,sha256=VreB10xPwgSLQQlTu20UCrFpRS--cA7-lx5s7nrPPrg,2247
29
- compressed_tensors/quantization/lifecycle/forward.py,sha256=0T817yzYqFR1wUjk2XCtOISwr4u7cdkKqAv13jjfu24,11113
29
+ compressed_tensors/quantization/lifecycle/forward.py,sha256=F4VQmCPXBpjWsDnlEErJ2eTWK54Ir9S1Kn2frlkBr9A,11401
30
30
  compressed_tensors/quantization/lifecycle/frozen.py,sha256=h1XYt89MouBTf3jTYLG_6OdFxIu5q2N8tPjsy6J4E6Y,1726
31
31
  compressed_tensors/quantization/lifecycle/initialize.py,sha256=9xgPzHejQUO_AkZcc_SH5kqFeieG-9uo0fMRYV51i7Y,4577
32
32
  compressed_tensors/quantization/observers/__init__.py,sha256=DNH31NQYrIBBcmHsMyFA6whh4pbRsLwuNa6L8AeXaGc,745
@@ -41,8 +41,8 @@ compressed_tensors/registry/registry.py,sha256=fxjOjh2wklCvJhQxwofdy-zV8q7MkQ85S
41
41
  compressed_tensors/utils/__init__.py,sha256=5DrYjoZbaEvSkJcC-GRSbM_RBHVF4tG9gMd3zsJnjLw,665
42
42
  compressed_tensors/utils/helpers.py,sha256=5ull5yFT31M2zVxKeFvpvvlvX5f1Sk1LGuj_wrfZWCY,2267
43
43
  compressed_tensors/utils/safetensors_load.py,sha256=0MheXwx1jeY12PeISppiSIZHs6rmN2YddwPpFb9V67I,8527
44
- compressed_tensors_nightly-0.4.0.20240617.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
45
- compressed_tensors_nightly-0.4.0.20240617.dist-info/METADATA,sha256=UlgXlSh8O72kUD4ExYI-2wfjli7JaDH9Pr_UsB_5OKM,5668
46
- compressed_tensors_nightly-0.4.0.20240617.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
47
- compressed_tensors_nightly-0.4.0.20240617.dist-info/top_level.txt,sha256=w2i-GyPs2s1UwVxvutSvN_lM22SXC2hQFBmoMcPnV7Y,19
48
- compressed_tensors_nightly-0.4.0.20240617.dist-info/RECORD,,
44
+ compressed_tensors_nightly-0.4.0.20240619.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
45
+ compressed_tensors_nightly-0.4.0.20240619.dist-info/METADATA,sha256=xJpJU2rjediV-76_G-EwExDIQ_qTDgq2L3Gci1vpFdg,5668
46
+ compressed_tensors_nightly-0.4.0.20240619.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
47
+ compressed_tensors_nightly-0.4.0.20240619.dist-info/top_level.txt,sha256=w2i-GyPs2s1UwVxvutSvN_lM22SXC2hQFBmoMcPnV7Y,19
48
+ compressed_tensors_nightly-0.4.0.20240619.dist-info/RECORD,,