Skip to content

Commit aa42e5e

Browse files
xin3heyiliu30
andauthored
replenish docstring (#1955)
* replenish docstring Signed-off-by: xin3he <[email protected]> * update Quantizer API docstring Signed-off-by: xin3he <[email protected]> * Add docstring for auto accelerator (#1956) Signed-off-by: yiliu30 <[email protected]> * temporary remove torch/quantization and add it back after fp8 code is updated. * Update config.py --------- Signed-off-by: xin3he <[email protected]> Signed-off-by: yiliu30 <[email protected]> Co-authored-by: Yi Liu <[email protected]>
1 parent 81a076d commit aa42e5e

File tree

15 files changed

+268
-31
lines changed

15 files changed

+268
-31
lines changed

.azure-pipelines/scripts/codeScan/pydocstyle/scan_path.txt

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,14 @@
1515
/neural-compressor/neural_compressor/strategy
1616
/neural-compressor/neural_compressor/training.py
1717
/neural-compressor/neural_compressor/utils
18-
/neural_compressor/torch/algorithms/mx_quant
19-
/neural-compressor/neural_compressor/torch/algorithms/static_quant
18+
/neural-compressor/neural_compressor/common
19+
/neural-compressor/neural_compressor/tensorflow
20+
/neural-compressor/neural_compressor/torch/algorithms/layer_wise
21+
/neural-compressor/neural_compressor/torch/algorithms/mixed_precision
22+
/neural-compressor/neural_compressor/torch/algorithms/mx_quant
23+
/neural-compressor/neural_compressor/torch/algorithms/pt2e_quant
2024
/neural-compressor/neural_compressor/torch/algorithms/smooth_quant
21-
/neural_compressor/torch/algorithms/pt2e_quant
22-
/neural_compressor/torch/export
23-
/neural_compressor/common
24-
/neural_compressor/torch/algorithms/weight_only
25-
/neural_compressor/torch/algorithms/layer_wise
26-
/neural_compressor/torch/algorithms/mixed_precision
27-
/neural_compressor/tensorflow
25+
/neural-compressor/neural_compressor/torch/algorithms/static_quant
26+
/neural-compressor/neural_compressor/torch/algorithms/weight_only
27+
/neural-compressor/neural_compressor/torch/export
28+
/neural-compressor/neural_compressor/torch/utils

neural_compressor/common/benchmark.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14+
"""Benchmark API for Intel Neural Compressor."""
1415

1516
import argparse
1617
import os
@@ -242,7 +243,9 @@ def get_numa_node(core_list, reversed_numa_info):
242243

243244

244245
def set_cores_for_instance(args, numa_info):
245-
"""All use cases are listed below:
246+
"""Set cores for each instance based on the input args.
247+
248+
All use cases are listed below:
246249
Params: a=num_instance; b=num_cores_per_instance; c=cores;
247250
- no a, b, c: a=1, c=numa:0
248251
- no a, b: a=1, c=c
@@ -357,6 +360,7 @@ def generate_prefix(args, core_list):
357360
Args:
358361
args (argparse): arguments for setting different configurations
359362
core_list: ["node_index", "cpu_index", num_cpu]
363+
360364
Returns:
361365
command_prefix (str): command_prefix with specific core list for Linux or Windows.
362366
"""

neural_compressor/common/utils/utility.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,8 @@ def wrapper(*args, **kwargs):
328328

329329

330330
class ProcessorType(enum.Enum):
331+
"""The processor type."""
332+
331333
Client = "Client"
332334
Server = "Server"
333335

neural_compressor/torch/algorithms/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14+
"""Intel Neural Compressor PyTorch algorithms."""
1415

1516
from .base_algorithm import Quantizer

neural_compressor/torch/algorithms/base_algorithm.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14+
"""Intel Neural Compressor PyTorch Quantizer API."""
1415

1516
import copy
1617
from abc import ABC, abstractmethod

neural_compressor/torch/quantization/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
"""Intel Neural Compressor Pytorch quantization API."""
14+
"""Intel Neural Compressor PyTorch quantization API."""
1515

1616
from neural_compressor.torch.quantization.quantize import quantize, prepare, convert
1717
from neural_compressor.torch.quantization.config import (

neural_compressor/torch/quantization/algorithm_entry.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14+
"""Intel Neural Compressor PyTorch supported algorithm entries."""
1415

1516
from copy import deepcopy
1617
from types import MethodType

0 commit comments

Comments
 (0)