Skip to content

Commit

Permalink
Review Comments from @mgoin
Browse files Browse the repository at this point in the history
  • Loading branch information
rahul-tuli committed Oct 2, 2024
1 parent 6e571e4 commit 27011f6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/compressed_tensors/compressors/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from abc import ABC, abstractmethod
from typing import Dict, Generator, Optional, Tuple, Union

import torch
Expand All @@ -25,7 +26,7 @@
__all__ = ["BaseCompressor"]


class BaseCompressor(RegistryMixin):
class BaseCompressor(RegistryMixin, ABC):
"""
Base class representing a model compression algorithm. Each child class should
implement compression_param_info, compress_weight and decompress_weight.
Expand Down Expand Up @@ -76,6 +77,7 @@ def compression_param_info(
"""
raise NotImplementedError()

@abstractmethod
def compress(
self,
model_state: Dict[str, Tensor],
Expand All @@ -90,6 +92,7 @@ def compress(
"""
raise NotImplementedError()

@abstractmethod
def decompress(
self,
path_to_model_or_tensors: str,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class BaseQuantizationCompressor(BaseCompressor):
- Compressor.compression_param_info()
- register_parameters()
- compressed_module.forward()
-compressed_module.decompress()
- compressed_module.decompress()
:param config: config specifying compression parameters
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class BaseSparseCompressor(BaseCompressor):
- Compressor.compression_param_info()
- register_parameters()
- compressed_module.forward()
-compressed_module.decompress()
- compressed_module.decompress()
:param config: config specifying compression parameters
Expand Down

0 comments on commit 27011f6

Please sign in to comment.