Skip to content

Commit

Permalink
[Fix Test Failure]: Propagate name change to test (#1088)
Browse files Browse the repository at this point in the history
This PR addresses two key updates:  

1. **Test Update**:  
In [PR #948](#948), a
flag name was updated during the review process. However, this update
wasn't reflected in the relevant test. This PR propagates the updated
flag name to the associated test.

2. **Sparsity Threshold Adjustment**:  
As requested in [PR
#948](#948), the
sparsity threshold has been reduced to `0.49`.
  • Loading branch information
rahul-tuli authored Jan 22, 2025
1 parent 5bc5742 commit d5984db
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class SparsityConfigMetadata:
metadata from the model
"""

SPARSITY_THRESHOLD: float = 0.5
SPARSITY_THRESHOLD: float = 0.49

@staticmethod
def infer_global_sparsity(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -522,15 +522,15 @@ def test_sparse_24_compressor_is_lossless(model_stub, recipe, sparse_format, tmp
shutil.rmtree(tmp_path)


def test_no_sparse_compression_flag(tmp_path):
def test_disable_sparse_compression_flag(tmp_path):
two_four_sparse_model_id = "nm-testing/llama2.c-stories42M-pruned2.4"
two_four_sparse_model = AutoModelForCausalLM.from_pretrained(
two_four_sparse_model_id, torch_dtype="auto"
)
modify_save_pretrained(two_four_sparse_model)

save_path = tmp_path / "no_sparse_compression_model"
two_four_sparse_model.save_pretrained(save_path, no_sparse_compression=True)
two_four_sparse_model.save_pretrained(save_path, disable_sparse_compression=True)

config = AutoConfig.from_pretrained(save_path)
quantization_config = getattr(config, QUANTIZATION_CONFIG_NAME, None)
Expand Down

0 comments on commit d5984db

Please sign in to comment.