Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

Commit

Permalink
switched to compressed tensors instrad of sparseml
Browse files Browse the repository at this point in the history
  • Loading branch information
robertgshaw2-neuralmagic committed Jul 2, 2024
1 parent ceaf019 commit 655389d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
6 changes: 2 additions & 4 deletions requirements-test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,9 @@ peft
requests==2.31 # required for python 3.8 testing
ray
sentence-transformers # required for embedding
optimum # required for hf gptq baselines
auto-gptq # required for hf gptq baselines
torchvision # required for the image processor of phi3v
sparseml==1.8.0 # required for compressed-tensors
compressed-tensors==0.4.0 # required for compressed-tensors
git+https://github.com/vllm-project/llm-compressor.git # required for compressed-tensors
compressed-tensors==0.4.0

# Benchmarking
aiohttp
Expand Down
6 changes: 3 additions & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def __init__(
model_kwargs: Optional[Dict[str, Any]] = None,
is_embedding_model: bool = False,
is_vision_model: bool = False,
is_sparseml_model: bool = False,
is_compressed_tensors_model: bool = False,
**kwargs,
) -> None:
assert dtype in _STR_DTYPE_TO_TORCH_DTYPE
Expand All @@ -204,8 +204,8 @@ def __init__(
else:
if is_vision_model:
auto_cls = AutoModelForVision2Seq
elif is_sparseml_model:
from sparseml.transformers import SparseAutoModelForCausalLM
elif is_compressed_tensors_model:
from llmcompressor.transformers import SparseAutoModelForCausalLM
auto_cls = SparseAutoModelForCausalLM
else:
auto_cls = AutoModelForCausalLM
Expand Down
4 changes: 2 additions & 2 deletions tests/models/test_compressed_tensors.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ def test_models(
) -> None:
# Run sparseml.
with hf_runner(model_name=model_name,
is_sparseml_model=True) as sparseml_model:
is_compressed_tensors_model=True) as compressed_tensors_models:

sparseml_outputs = sparseml_model.generate_greedy_logprobs_limit(
sparseml_outputs = compressed_tensors_models.generate_greedy_logprobs_limit(
example_prompts, MAX_TOKENS, NUM_LOGPROBS)

# Run vllm.
Expand Down

0 comments on commit 655389d

Please sign in to comment.