Skip to content

Incorrect dependency constraint on compressed-tensors leads to ImportError (is_fp4) #22

Description

@butterShoter

'llm-compressor' currently declares the following dependency:

# ./workspace/llm-compressor/setup.py, line 143
(
            "compressed-tensors==0.12.1"
            if BUILD_TYPE == "release"
            else "compressed-tensors>=0.12.2a2"
 ),

However, the code imports an internal API that is not stable across versions:

from compressed_tensors.quantization.utils import is_fp4

With a clean environment, this this can result in installation of newer alpha versions
(e.g. compressed-tensors==0.13.1.a*), where is_fp4 is no longer available
(or not exported), leading to an immediate ImportError at import time.

Reproduction

  1. Create a clean environment
  2. pip install -e . (or uv pip install -e .)
  3. import llmcompressor
    This installs compressed-tensors==0.13.x and fails with:
    ImportError: cannot import name 'is_fp4'

Expected Behavior

The dependency should be pinned or constrained to versions that are known
to expose the required API, e.g.:
compressed-tensors==0.12.2a2 or compressed-tensors>=0.12.2a2,<0.13

Notes

Since this relies on an internal (non-public) API, a strict pin or upper bound
seems necessary to ensure reproducibility.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions