Skip to content

Commit

Permalink
replenish docstring (#1955)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
xin3he and yiliu30 authored Jul 31, 2024
1 parent 81a076d commit aa42e5e
Show file tree
Hide file tree
Showing 15 changed files with 268 additions and 31 deletions.
19 changes: 10 additions & 9 deletions .azure-pipelines/scripts/codeScan/pydocstyle/scan_path.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@
/neural-compressor/neural_compressor/strategy
/neural-compressor/neural_compressor/training.py
/neural-compressor/neural_compressor/utils
/neural_compressor/torch/algorithms/mx_quant
/neural-compressor/neural_compressor/torch/algorithms/static_quant
/neural-compressor/neural_compressor/common
/neural-compressor/neural_compressor/tensorflow
/neural-compressor/neural_compressor/torch/algorithms/layer_wise
/neural-compressor/neural_compressor/torch/algorithms/mixed_precision
/neural-compressor/neural_compressor/torch/algorithms/mx_quant
/neural-compressor/neural_compressor/torch/algorithms/pt2e_quant
/neural-compressor/neural_compressor/torch/algorithms/smooth_quant
/neural_compressor/torch/algorithms/pt2e_quant
/neural_compressor/torch/export
/neural_compressor/common
/neural_compressor/torch/algorithms/weight_only
/neural_compressor/torch/algorithms/layer_wise
/neural_compressor/torch/algorithms/mixed_precision
/neural_compressor/tensorflow
/neural-compressor/neural_compressor/torch/algorithms/static_quant
/neural-compressor/neural_compressor/torch/algorithms/weight_only
/neural-compressor/neural_compressor/torch/export
/neural-compressor/neural_compressor/torch/utils
6 changes: 5 additions & 1 deletion neural_compressor/common/benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Benchmark API for Intel Neural Compressor."""

import argparse
import os
Expand Down Expand Up @@ -242,7 +243,9 @@ def get_numa_node(core_list, reversed_numa_info):


def set_cores_for_instance(args, numa_info):
"""All use cases are listed below:
"""Set cores for each instance based on the input args.
All use cases are listed below:
Params: a=num_instance; b=num_cores_per_instance; c=cores;
- no a, b, c: a=1, c=numa:0
- no a, b: a=1, c=c
Expand Down Expand Up @@ -357,6 +360,7 @@ def generate_prefix(args, core_list):
Args:
args (argparse): arguments for setting different configurations
core_list: ["node_index", "cpu_index", num_cpu]
Returns:
command_prefix (str): command_prefix with specific core list for Linux or Windows.
"""
Expand Down
2 changes: 2 additions & 0 deletions neural_compressor/common/utils/utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,8 @@ def wrapper(*args, **kwargs):


class ProcessorType(enum.Enum):
"""The processor type."""

Client = "Client"
Server = "Server"

Expand Down
1 change: 1 addition & 0 deletions neural_compressor/torch/algorithms/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Intel Neural Compressor PyTorch algorithms."""

from .base_algorithm import Quantizer
1 change: 1 addition & 0 deletions neural_compressor/torch/algorithms/base_algorithm.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Intel Neural Compressor PyTorch Quantizer API."""

import copy
from abc import ABC, abstractmethod
Expand Down
2 changes: 1 addition & 1 deletion neural_compressor/torch/quantization/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Intel Neural Compressor Pytorch quantization API."""
"""Intel Neural Compressor PyTorch quantization API."""

from neural_compressor.torch.quantization.quantize import quantize, prepare, convert
from neural_compressor.torch.quantization.config import (
Expand Down
1 change: 1 addition & 0 deletions neural_compressor/torch/quantization/algorithm_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Intel Neural Compressor PyTorch supported algorithm entries."""

from copy import deepcopy
from types import MethodType
Expand Down
Loading

0 comments on commit aa42e5e

Please sign in to comment.