compressed-tensors 0.11.1a20250904__tar.gz → 0.11.1a20250909__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.
Files changed (153) hide show
  1. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/PKG-INFO +1 -1
  2. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/src/compressed_tensors/compressors/quantized_compressors/nvfp4_quantized.py +5 -4
  3. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/src/compressed_tensors/quantization/quant_scheme.py +20 -0
  4. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/src/compressed_tensors/transform/factory/base.py +11 -4
  5. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/src/compressed_tensors/transform/factory/hadamard.py +15 -12
  6. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/src/compressed_tensors/transform/factory/matrix_multiply.py +14 -11
  7. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/src/compressed_tensors/transform/factory/random_hadamard.py +2 -3
  8. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/src/compressed_tensors/utils/offload.py +4 -27
  9. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/src/compressed_tensors/version.py +1 -1
  10. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/src/compressed_tensors.egg-info/PKG-INFO +1 -1
  11. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/tests/test_compressors/quantized_compressors/test_nvfp4_quant.py +14 -0
  12. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/.github/.gitkeep +0 -0
  13. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/.github/actions/test/action.yml +0 -0
  14. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/.github/scripts/step-status +0 -0
  15. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/.github/workflows/build-test.yml +0 -0
  16. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/.github/workflows/build.yml +0 -0
  17. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/.github/workflows/quality-check.yaml +0 -0
  18. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/.github/workflows/report.yml +0 -0
  19. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/.github/workflows/test-check.yaml +0 -0
  20. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/.github/workflows/test.yml +0 -0
  21. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/.github/workflows/trigger-all.yml +0 -0
  22. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/.github/workflows/upload.yml +0 -0
  23. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/.gitignore +0 -0
  24. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/LICENSE +0 -0
  25. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/Makefile +0 -0
  26. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/README.md +0 -0
  27. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/examples/bit_packing/ex_quantize_and_pack.py +0 -0
  28. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/examples/bit_packing/int4_config.json +0 -0
  29. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/examples/bitmask_compression.ipynb +0 -0
  30. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/examples/llama_1.1b/ex_config_quantization.py +0 -0
  31. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/examples/llama_1.1b/ex_llmcompressor_quantization.py +0 -0
  32. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/examples/llama_1.1b/example_quant_config.json +0 -0
  33. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/examples/llama_1.1b/example_quant_recipe.yaml +0 -0
  34. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/examples/quantize_and_pack_int4.ipynb +0 -0
  35. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/pyproject.toml +0 -0
  36. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/setup.cfg +0 -0
  37. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/setup.py +0 -0
  38. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/src/__init__.py +0 -0
  39. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/src/compressed_tensors/README.md +0 -0
  40. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/src/compressed_tensors/__init__.py +0 -0
  41. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/src/compressed_tensors/base.py +0 -0
  42. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/src/compressed_tensors/compressors/__init__.py +0 -0
  43. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/src/compressed_tensors/compressors/base.py +0 -0
  44. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/src/compressed_tensors/compressors/helpers.py +0 -0
  45. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/src/compressed_tensors/compressors/model_compressors/__init__.py +0 -0
  46. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/src/compressed_tensors/compressors/model_compressors/model_compressor.py +0 -0
  47. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/src/compressed_tensors/compressors/quantized_compressors/__init__.py +0 -0
  48. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/src/compressed_tensors/compressors/quantized_compressors/base.py +0 -0
  49. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/src/compressed_tensors/compressors/quantized_compressors/naive_quantized.py +0 -0
  50. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/src/compressed_tensors/compressors/quantized_compressors/pack_quantized.py +0 -0
  51. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/src/compressed_tensors/compressors/sparse_compressors/__init__.py +0 -0
  52. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/src/compressed_tensors/compressors/sparse_compressors/base.py +0 -0
  53. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/src/compressed_tensors/compressors/sparse_compressors/dense.py +0 -0
  54. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/src/compressed_tensors/compressors/sparse_compressors/sparse_24_bitmask.py +0 -0
  55. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/src/compressed_tensors/compressors/sparse_compressors/sparse_bitmask.py +0 -0
  56. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/src/compressed_tensors/compressors/sparse_quantized_compressors/__init__.py +0 -0
  57. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/src/compressed_tensors/compressors/sparse_quantized_compressors/marlin_24.py +0 -0
  58. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/src/compressed_tensors/config/__init__.py +0 -0
  59. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/src/compressed_tensors/config/base.py +0 -0
  60. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/src/compressed_tensors/config/dense.py +0 -0
  61. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/src/compressed_tensors/config/sparse_24_bitmask.py +0 -0
  62. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/src/compressed_tensors/config/sparse_bitmask.py +0 -0
  63. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/src/compressed_tensors/linear/__init__.py +0 -0
  64. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/src/compressed_tensors/linear/compressed_linear.py +0 -0
  65. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/src/compressed_tensors/quantization/__init__.py +0 -0
  66. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/src/compressed_tensors/quantization/lifecycle/__init__.py +0 -0
  67. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/src/compressed_tensors/quantization/lifecycle/apply.py +0 -0
  68. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/src/compressed_tensors/quantization/lifecycle/compressed.py +0 -0
  69. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/src/compressed_tensors/quantization/lifecycle/forward.py +0 -0
  70. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/src/compressed_tensors/quantization/lifecycle/helpers.py +0 -0
  71. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/src/compressed_tensors/quantization/lifecycle/initialize.py +0 -0
  72. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/src/compressed_tensors/quantization/quant_args.py +0 -0
  73. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/src/compressed_tensors/quantization/quant_config.py +0 -0
  74. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/src/compressed_tensors/quantization/utils/__init__.py +0 -0
  75. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/src/compressed_tensors/quantization/utils/helpers.py +0 -0
  76. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/src/compressed_tensors/registry/__init__.py +0 -0
  77. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/src/compressed_tensors/registry/registry.py +0 -0
  78. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/src/compressed_tensors/transform/__init__.py +0 -0
  79. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/src/compressed_tensors/transform/apply.py +0 -0
  80. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/src/compressed_tensors/transform/factory/__init__.py +0 -0
  81. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/src/compressed_tensors/transform/transform_args.py +0 -0
  82. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/src/compressed_tensors/transform/transform_config.py +0 -0
  83. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/src/compressed_tensors/transform/transform_scheme.py +0 -0
  84. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/src/compressed_tensors/transform/utils/__init__.py +0 -0
  85. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/src/compressed_tensors/transform/utils/hadamard.py +0 -0
  86. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/src/compressed_tensors/transform/utils/hadamards.safetensors +0 -0
  87. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/src/compressed_tensors/transform/utils/matrix.py +0 -0
  88. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/src/compressed_tensors/utils/__init__.py +0 -0
  89. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/src/compressed_tensors/utils/helpers.py +0 -0
  90. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/src/compressed_tensors/utils/internal.py +0 -0
  91. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/src/compressed_tensors/utils/match.py +0 -0
  92. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/src/compressed_tensors/utils/permutations_24.py +0 -0
  93. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/src/compressed_tensors/utils/permute.py +0 -0
  94. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/src/compressed_tensors/utils/safetensors_load.py +0 -0
  95. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/src/compressed_tensors/utils/semi_structured_conversions.py +0 -0
  96. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/src/compressed_tensors/utils/type.py +0 -0
  97. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/src/compressed_tensors.egg-info/SOURCES.txt +0 -0
  98. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/src/compressed_tensors.egg-info/dependency_links.txt +0 -0
  99. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/src/compressed_tensors.egg-info/requires.txt +0 -0
  100. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/src/compressed_tensors.egg-info/top_level.txt +0 -0
  101. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/tests/__init__.py +0 -0
  102. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/tests/conftest.py +0 -0
  103. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/tests/test_compressors/__init__.py +0 -0
  104. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/tests/test_compressors/model_compressors/__init__.py +0 -0
  105. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/tests/test_compressors/model_compressors/test_model_compressor.py +0 -0
  106. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/tests/test_compressors/quantized_compressors/__init__.py +0 -0
  107. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/tests/test_compressors/quantized_compressors/test_fp8_quant.py +0 -0
  108. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/tests/test_compressors/quantized_compressors/test_int_quant.py +0 -0
  109. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/tests/test_compressors/quantized_compressors/test_pack_quant.py +0 -0
  110. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/tests/test_compressors/sparse_compressors/__init__.py +0 -0
  111. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/tests/test_compressors/sparse_compressors/test_bitmask.py +0 -0
  112. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/tests/test_compressors/sparse_compressors/test_sparse_24_bitmask.py +0 -0
  113. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/tests/test_compressors/sparse_quantized_compressors/__init__.py +0 -0
  114. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/tests/test_compressors/sparse_quantized_compressors/test_marlin_24.py +0 -0
  115. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/tests/test_configs/__init__.py +0 -0
  116. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/tests/test_configs/test_base.py +0 -0
  117. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/tests/test_examples/test_bitmask_compression_ipynb.py +0 -0
  118. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/tests/test_linear/__init__.py +0 -0
  119. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/tests/test_linear/test_compressed_linear.py +0 -0
  120. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/tests/test_quantization/__init__.py +0 -0
  121. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/tests/test_quantization/lifecycle/__init__.py +0 -0
  122. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/tests/test_quantization/lifecycle/conftest.py +0 -0
  123. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/tests/test_quantization/lifecycle/test_apply.py +0 -0
  124. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/tests/test_quantization/lifecycle/test_dynamic_lifecycle.py +0 -0
  125. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/tests/test_quantization/lifecycle/test_enabled.py +0 -0
  126. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/tests/test_quantization/lifecycle/test_forward.py +0 -0
  127. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/tests/test_quantization/lifecycle/test_helpers.py +0 -0
  128. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/tests/test_quantization/lifecycle/test_initialize.py +0 -0
  129. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/tests/test_quantization/lifecycle/test_lifecycle.py +0 -0
  130. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/tests/test_quantization/test_configs/__init__.py +0 -0
  131. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/tests/test_quantization/test_configs/test_bit_depths.py +0 -0
  132. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/tests/test_quantization/test_configs/test_strategies.py +0 -0
  133. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/tests/test_quantization/test_quant_args.py +0 -0
  134. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/tests/test_quantization/test_quant_config.py +0 -0
  135. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/tests/test_quantization/test_quant_scheme.py +0 -0
  136. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/tests/test_quantization/test_utils/test_helpers.py +0 -0
  137. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/tests/test_registry.py +0 -0
  138. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/tests/test_transform/conftest.py +0 -0
  139. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/tests/test_transform/factory/test_correctness.py +0 -0
  140. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/tests/test_transform/factory/test_memory.py +0 -0
  141. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/tests/test_transform/factory/test_serialization.py +0 -0
  142. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/tests/test_transform/test_transform_args.py +0 -0
  143. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/tests/test_transform/test_transform_config.py +0 -0
  144. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/tests/test_transform/test_transform_scheme.py +0 -0
  145. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/tests/test_transform/utils/test_hadamard.py +0 -0
  146. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/tests/test_utils/__init__.py +0 -0
  147. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/tests/test_utils/test_helpers.py +0 -0
  148. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/tests/test_utils/test_match.py +0 -0
  149. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/tests/test_utils/test_offload.py +0 -0
  150. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/tests/test_utils/test_safetensors_load.py +0 -0
  151. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/tests/test_utils/test_type.py +0 -0
  152. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/tests/testing_utils.py +0 -0
  153. {compressed_tensors-0.11.1a20250904 → compressed_tensors-0.11.1a20250909}/utils/copyright.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: compressed-tensors
3
- Version: 0.11.1a20250904
3
+ Version: 0.11.1a20250909
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.
@@ -140,6 +140,11 @@ def pack_fp4_to_uint8(x: torch.Tensor) -> torch.Tensor:
140
140
  m, n = x.shape
141
141
  device = x.device
142
142
 
143
+ if n % 2 != 0:
144
+ raise ValueError(
145
+ "tensor must have an even number of columns for nvfp4 compression"
146
+ )
147
+
143
148
  # Create lookup table for FP4 values to indices
144
149
  # Map the absolute values to 0-7 indices
145
150
  kE2M1 = torch.tensor(FLOAT_TO_E2M1, device=device, dtype=x.dtype)
@@ -155,10 +160,6 @@ def pack_fp4_to_uint8(x: torch.Tensor) -> torch.Tensor:
155
160
  # Reshape to prepare for packing pairs of values
156
161
  indices = indices.reshape(-1)
157
162
 
158
- # Handle odd length by padding if necessary
159
- if indices.numel() % 2 != 0:
160
- indices = torch.cat([indices, torch.zeros(1, dtype=torch.long, device=device)])
161
-
162
163
  # Reshape to pair consecutive elements
163
164
  indices = indices.reshape(-1, 2)
164
165
 
@@ -60,6 +60,26 @@ class QuantizationScheme(BaseModel):
60
60
  format = model.format
61
61
 
62
62
  if inputs is not None:
63
+ if inputs.strategy not in (
64
+ QuantizationStrategy.TOKEN,
65
+ QuantizationStrategy.TENSOR,
66
+ QuantizationStrategy.GROUP,
67
+ QuantizationStrategy.TENSOR_GROUP,
68
+ ):
69
+ if (
70
+ inputs.strategy == QuantizationStrategy.GROUP
71
+ and inputs.dynamic is True
72
+ ):
73
+ raise NotImplementedError(
74
+ "Static and local group-wise activation "
75
+ "quantization is not supported"
76
+ )
77
+
78
+ raise NotImplementedError(
79
+ f"Using {inputs.strategy} strategy is not supported for "
80
+ "activation quantization"
81
+ )
82
+
63
83
  if inputs.actorder is not None:
64
84
  raise ValueError("Cannot apply actorder to input activations")
65
85
 
@@ -18,6 +18,7 @@ from typing import List, Optional, Set, Tuple
18
18
 
19
19
  import torch
20
20
  import torch.nn.utils.parametrize as P
21
+ import tqdm
21
22
  from compressed_tensors.registry.registry import RegistryMixin, T
22
23
  from compressed_tensors.transform import (
23
24
  TransformArgs,
@@ -84,15 +85,21 @@ class TransformFactory(RegistryMixin, ABC):
84
85
  """
85
86
  raise NotImplementedError()
86
87
 
87
- def apply_to_model(self, model: Module):
88
+ def apply_to_model(self, model: Module, use_tqdm=True):
88
89
  """
89
90
  Create transforms and apply them to the model
90
91
 
91
92
  :param model: module to apply transforms to
92
93
  """
93
- for arg in self.scheme.apply:
94
- for _, module in match_named_modules(model, arg.targets, arg.ignore):
95
- self._apply_to_module(module, arg)
94
+ modules_args = [
95
+ (module, arg)
96
+ for arg in self.scheme.apply
97
+ for _, module in match_named_modules(model, arg.targets, arg.ignore)
98
+ ]
99
+
100
+ desc = f"Applying {self.name} transforms"
101
+ for module, arg in tqdm.tqdm(modules_args, desc=desc, disable=(not use_tqdm)):
102
+ self._apply_to_module(module, arg)
96
103
 
97
104
  self._update_tied_weights()
98
105
 
@@ -53,24 +53,28 @@ class HadamardFactory(TransformFactory):
53
53
  """
54
54
  assert hasattr(module, "weight")
55
55
  size = get_transform_size(module, args.location, self.scheme.head_dim)
56
- dtype = self.scheme.precision
57
- device = get_offloaded_device(module)
58
56
  exec_device = get_execution_device(module)
59
-
60
- factory_kwargs = {"construct_device": exec_device}
61
- weight = self.weights.get(size, dtype, device, factory_kwargs=factory_kwargs)
57
+ device = get_offloaded_device(module)
58
+ precision = self.scheme.precision if args.is_online() else torch.float64
59
+
60
+ factory_kwargs = {
61
+ "device": device,
62
+ "construct_device": exec_device,
63
+ "precision": precision,
64
+ }
65
+ weight = self.weights.get(size, factory_kwargs=factory_kwargs)
66
+ # TODO: permutations should be keyed by fused modules, not weight
62
67
  perm = self.perms[weight] if self.scheme.randomize else None
63
68
  return HadamardTransform(weight, perm, self.scheme, args, type(module))
64
69
 
65
70
  def _create_weight(
66
71
  self,
67
72
  size: int,
68
- dtype: dtype,
69
73
  device: device,
70
74
  construct_device: device,
75
+ precision: dtype,
71
76
  ) -> Parameter:
72
- # construct on execution device, cache on offload device
73
- data = deterministic_hadamard_matrix(size, dtype, construct_device)
77
+ data = deterministic_hadamard_matrix(size, precision, construct_device)
74
78
  data = data.to(device=device)
75
79
  return Parameter(data, requires_grad=self.scheme.requires_grad)
76
80
 
@@ -94,8 +98,7 @@ class HadamardTransform(TransformBase):
94
98
  self.scheme = scheme
95
99
  self.args = args
96
100
  self.module_type = module_type
97
- self._scale = torch.tensor(weight.size(0), dtype=self.scheme.precision).sqrt()
98
- self._precision = scheme.precision if args.is_online() else torch.float64
101
+ self._scale = torch.tensor(weight.size(0), dtype=torch.float64).sqrt()
99
102
 
100
103
  def forward(self, value: Tensor) -> Tensor:
101
104
  weight = self.weight
@@ -108,8 +111,8 @@ class HadamardTransform(TransformBase):
108
111
 
109
112
  return (
110
113
  apply_transform_weight(
111
- weight.to(self._precision),
112
- value.to(self._precision),
114
+ weight.to(device=value.device),
115
+ value.to(dtype=weight.dtype),
113
116
  self.args.location,
114
117
  self.module_type,
115
118
  )
@@ -21,8 +21,8 @@ from compressed_tensors.transform.utils.matrix import (
21
21
  apply_transform_weight,
22
22
  get_transform_size,
23
23
  )
24
- from compressed_tensors.utils import get_offloaded_device
25
24
  from compressed_tensors.utils.helpers import ParameterizedDefaultDict
25
+ from compressed_tensors.utils.offload import get_offloaded_device
26
26
  from torch import Tensor, device, dtype
27
27
  from torch.nn import Module, Parameter
28
28
 
@@ -52,19 +52,23 @@ class RandomMatrixFactory(TransformFactory):
52
52
  """
53
53
  assert hasattr(module, "weight")
54
54
  size = get_transform_size(module, args.location, self.scheme.head_dim)
55
- dtype = self.scheme.precision
56
55
  device = get_offloaded_device(module)
56
+ precision = self.scheme.precision if args.is_online() else torch.float64
57
57
 
58
- weight = self.weights[size, dtype, device]
58
+ factory_kwargs = {"device": device, "precision": precision}
59
+ weight = self.weights.get(size, factory_kwargs=factory_kwargs)
59
60
  if args.inverse:
60
61
  weight = self.inverses[weight]
61
62
 
62
63
  return RandomMatrixTransform(weight, self.scheme, args, type(module))
63
64
 
64
- def _create_weight(self, size: int, dtype: dtype, device: device) -> Parameter:
65
- # TODO: verify that weight is invertible (has non-zero determinant)
65
+ def _create_weight(self, size: int, device: device, precision: dtype) -> Parameter:
66
+ # TODO: construct such that weight is invertible (has non-zero determinant)
66
67
  data = torch.rand(
67
- (size, size), generator=self.generator, dtype=dtype, device=device
68
+ (size, size),
69
+ generator=self.generator,
70
+ dtype=precision,
71
+ device=device,
68
72
  )
69
73
  return Parameter(data, requires_grad=self.scheme.requires_grad)
70
74
 
@@ -87,12 +91,11 @@ class RandomMatrixTransform(TransformBase):
87
91
  self.scheme = scheme
88
92
  self.args = args
89
93
  self.module_type = module_type
90
- self._precision = scheme.precision if args.is_online() else torch.float64
91
94
 
92
95
  def forward(self, value: Tensor) -> Parameter:
93
96
  return apply_transform_weight(
94
- self.weight.to(self._precision),
95
- value.to(self._precision),
97
+ self.weight.to(device=value.device),
98
+ value.to(dtype=self.weight.dtype),
96
99
  self.args.location,
97
100
  self.module_type,
98
101
  ).to(value.dtype)
@@ -100,8 +103,8 @@ class RandomMatrixTransform(TransformBase):
100
103
  def right_inverse(self, value: Tensor) -> Tensor:
101
104
  inverse = high_precision_invert(self.weight)
102
105
  return apply_transform_weight(
103
- inverse.to(self._precision),
104
- value.to(self._precision),
106
+ inverse.to(device=value.device),
107
+ value.to(dtype=inverse.dtype),
105
108
  self.args.location,
106
109
  self.module_type,
107
110
  ).to(value.dtype)
@@ -31,11 +31,10 @@ class RandomHadamardFactory(HadamardFactory):
31
31
  def _create_weight(
32
32
  self,
33
33
  size: int,
34
- dtype: dtype,
35
34
  device: device,
36
35
  construct_device: device,
36
+ precision: dtype,
37
37
  ) -> Parameter:
38
- # construct on execution device, cache on offload device
39
- data = random_hadamard_matrix(size, dtype, construct_device, self.generator)
38
+ data = random_hadamard_matrix(size, precision, construct_device, self.generator)
40
39
  data = data.to(device=device)
41
40
  return Parameter(data, requires_grad=self.scheme.requires_grad)
@@ -68,10 +68,8 @@ except ImportError:
68
68
 
69
69
 
70
70
  __all__ = [
71
- "is_module_offloaded",
72
71
  "get_execution_device",
73
72
  "get_offloaded_device",
74
- "update_prefix_dict",
75
73
  "update_parameter_data",
76
74
  "register_offload_parameter",
77
75
  "update_offload_parameter",
@@ -117,11 +115,6 @@ def check_accelerate(fallback: Any):
117
115
  """ Candidates for Depreciation """
118
116
 
119
117
 
120
- @check_accelerate(fallback=False)
121
- def is_module_offloaded(module: torch.nn.Module) -> bool:
122
- return has_offloaded_params(module)
123
-
124
-
125
118
  def get_offloaded_device(module: torch.nn.Module) -> torch.device:
126
119
  """
127
120
  :param module: module to check
@@ -131,26 +124,10 @@ def get_offloaded_device(module: torch.nn.Module) -> torch.device:
131
124
  first_key = list(module._hf_hook.weights_map.keys())[0]
132
125
  prefix_dataset = module._hf_hook.weights_map.dataset
133
126
  return prefix_dataset[first_key].device
134
- return next(module.parameters()).device
135
-
136
-
137
- @check_accelerate(fallback=None)
138
- def update_prefix_dict(module: torch.nn.Module, key: str, data: torch.Tensor):
139
- """
140
- Updates the offloaded state dict for a given module. Parameter named key is replaced
141
- by data. This is neccesary because parameter updates for offloaded modules do not
142
- persist automatically between loads. This function only affects the offloaded
143
- state dict and not the current state of the loaded module.
144
-
145
- :param module: module containing the parameter to update
146
- :param key: name of parameter to update
147
- :param data: tensor to update parameter with in the offloaded state dict
148
- """
149
- if not has_offloaded_params(module):
150
- raise ValueError("Prefix dict is only applicable to offloaded modules")
151
-
152
- weights_map = module._hf_hook.weights_map
153
- offload_to_weights_map(weights_map, key, data)
127
+ else:
128
+ # if the module is not offloaded, then any addded weights
129
+ # should be placed the module's execution device
130
+ return get_execution_device(module)
154
131
 
155
132
 
156
133
  def update_parameter_data(
@@ -17,5 +17,5 @@ __version__: str
17
17
  __version_tuple__: VERSION_TUPLE
18
18
  version_tuple: VERSION_TUPLE
19
19
 
20
- __version__ = version = '0.11.1.a20250904'
20
+ __version__ = version = '0.11.1.a20250909'
21
21
  __version_tuple__ = version_tuple = (0, 11, 1)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: compressed-tensors
3
- Version: 0.11.1a20250904
3
+ Version: 0.11.1a20250909
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.
@@ -12,6 +12,7 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
+ import pytest
15
16
  import torch
16
17
  from compressed_tensors.compressors.quantized_compressors.nvfp4_quantized import (
17
18
  pack_fp4_to_uint8,
@@ -41,3 +42,16 @@ def test_pack_unpack():
41
42
  sign_bitx = torch.signbit(x)
42
43
  sign_bitout = torch.signbit(unpacked)
43
44
  assert torch.equal(sign_bitout, sign_bitx)
45
+
46
+
47
+ def test_pack_unpack_odd_dims():
48
+ x = torch.Tensor(
49
+ [
50
+ [-0.5000, -6.0000, -0.5000, -1.5000, -1.0000, 6.0000, 0.0000],
51
+ [-1.0000, -6.0000, -0.5000, -0.0000, 0.5000, 0.5000, -0.0000],
52
+ [1.5000, 6.0000, -0.0000, -0.5000, 1.0000, 1.0000, -0.0000],
53
+ ]
54
+ )
55
+
56
+ with pytest.raises((ValueError, torch._dynamo.exc.Unsupported)):
57
+ _ = pack_fp4_to_uint8(x)