Skip to content

Commit 08169cd

Browse files
committed
minor
Signed-off-by: Frida Hou <[email protected]>
1 parent f8c7512 commit 08169cd

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

tensorrt_llm/_torch/auto_deploy/models/quant_config_reader.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
from abc import ABC, abstractmethod
1212
from typing import Any, Callable, Dict, Optional, Tuple, Type
1313

14-
import torch
15-
1614

1715
class QuantConfigReader(ABC):
1816
"""Base class for reading and parsing quantization config."""
@@ -30,16 +28,18 @@ def read_config(self, config: Dict) -> Dict:
3028
Parse and normalize a quantization config dictionary.
3129
3230
Args:
33-
config: The raw "quantization" field from the JSON file.
31+
config: The raw parsed JSON object.
3432
3533
Returns:
36-
A processed and normalized config dictionary.
34+
A dictionary of extra model kwargs derived from the quantization config.
35+
Implementations must also populate self._quant_config with the normalized
36+
quantization config.
3737
"""
3838
pass
3939

4040
@classmethod
4141
@abstractmethod
42-
def from_file(cls, file_path: str) -> Optional["QuantConfigReader"]:
42+
def from_file(cls, file_path: str) -> Optional[Tuple["QuantConfigReader", Dict[str, Any]]]:
4343
"""
4444
Load and parse a quantization config file from disk.
4545
@@ -49,7 +49,7 @@ def from_file(cls, file_path: str) -> Optional["QuantConfigReader"]:
4949
file_path: Path to the quant config JSON file.
5050
5151
Returns:
52-
An initialized QuantConfigReader instance, or None if the file doesn't exist.
52+
A (reader, extra_model_kwargs) tuple, or None if the file doesn't exist.
5353
"""
5454
pass
5555

@@ -109,7 +109,7 @@ def read_config(self, config: Dict) -> Dict:
109109
@classmethod
110110
def from_file(
111111
cls, ckpt_dir: str
112-
) -> Optional[Tuple["ModelOPTQuantConfigReader", Optional[torch.dtype]]]:
112+
) -> Optional[Tuple["ModelOPTQuantConfigReader", Dict[str, Any]]]:
113113
"""
114114
Load and parse a modelopt-style quantization config from a checkpoint directory.
115115

0 commit comments

Comments
 (0)