MCPcopy Create free account

hub / github.com/intel/neural-compressor / functions

Functions4,695 in github.com/intel/neural-compressor

↓ 7 callersMethod__init__
Init the Matmul object.
neural_compressor/torch/algorithms/weight_only/modules.py:42
↓ 7 callersMethod_cal_scales
Calculate the adjustment scales. Args: absorb_to_layer (dict): A dictionary mapping absorb layers to smooth quantized layers.
neural_compressor/torch/algorithms/smooth_quant/utility.py:1429
↓ 7 callersFunction_convert_to_eval_metric
Wrap a metric fn that returns scores and weights as an eval metric fn. The input metric_fn returns values for the current batch. The wrapper aggr
examples/tensorflow/nlp/transformer_lt/quantization/ptq/utils/metrics.py:90
↓ 7 callersMethod_get_node_from_name
Get node struct from node name.
neural_compressor/tensorflow/quantization/utils/quantize_graph/qdq/fuse_qdq_concatv2.py:40
↓ 7 callersMethod_update_scales_for_auto
Apply activation and weight scales to the model.
neural_compressor/torch/algorithms/smooth_quant/utility.py:1376
↓ 7 callersMethodcall
Update min/max statistics during calibration. Args: inputs (jnp.ndarray): Input tensor to observe. mask (Optional[jnp
neural_compressor/jax/quantization/layers_static.py:99
↓ 7 callersFunctioncheck_tests_to_skip
(scale_method, scale_value_type_weight=None, scale_value_type_activation=None)
test/torch/algorithms/fp8_quant/unit_tests/test_scale_method_config.py:49
↓ 7 callersMethoddo_transform
Apply all the transformers to fuse into int8 op.
neural_compressor/tensorflow/quantization/utils/quantize_graph/qdq/optimize_qdq.py:129
↓ 7 callersFunctionenv2int
(env_list, default = -1)
examples/pytorch/recommendation/dlrm/static_quant/ipex/extend_distributed.py:24
↓ 7 callersMethodevaluate
Evaluates the given model using the evaluation function and arguments provided. Args: model: The model to be evaluated.
neural_compressor/common/base_tuning.py:51
↓ 7 callersFunctionforward_wrapper
Model forward with device auto mapping. Args: model (torch.nn.Module): input model input (torch.tensor): input data Returns:
neural_compressor/torch/utils/utility.py:687
↓ 7 callersFunctionget_default_sq_config
Generate the default smoothquant config. Returns: the default smoothquant config.
neural_compressor/torch/quantization/config.py:1615
↓ 7 callersFunctionget_device_type
()
test/torch/algorithms/fp8_quant/test_hpu_utils.py:11
↓ 7 callersFunctionget_input_output_node_names
Get the input node name and output node name of the graph_def.
neural_compressor/tensorflow/quantization/utils/utility.py:226
↓ 7 callersFunctionget_module
Get module from model by key name. Args: model (torch.nn.Module): original model key (str): module name to be replaced
neural_compressor/torch/algorithms/weight_only/utility.py:704
↓ 7 callersFunctionget_q_params
Compute quantization scale and zero-point for a weight tensor. Args: orig_weight (jnp.ndarray): Weight tensor to analyze. dtype (
neural_compressor/jax/utils/utility.py:278
↓ 7 callersFunctionis_hpex_available
Returns whether hpex is available.
neural_compressor/torch/utils/environ.py:73
↓ 7 callersFunctionmove_input_to_device
Move input to the spevific device.
neural_compressor/torch/algorithms/weight_only/utility.py:587
↓ 7 callersMethodset_attr_int_list
Set the node's attr which data type is int list.
neural_compressor/tensorflow/quantization/utils/graph_util.py:831
↓ 7 callersMethodset_attr_tensor
Set the tensor value to specified attribute field. Args: node (nodedef): the target nodedef object key (string): attr
neural_compressor/tensorflow/quantization/utils/graph_util.py:799
↓ 7 callersFunctionset_module
Set new module into model by key name. Args: model (torch.nn.Module): original model key (str): module name to be replaced
neural_compressor/torch/algorithms/weight_only/utility.py:606
↓ 7 callersMethodto_dict
Convert the config to a dictionary. Returns: The config as a dictionary.
neural_compressor/common/base_config.py:318
↓ 6 callersMethod__init__
(self, scale_inv, lp_dtype, hp_dtype, *args, **kwargs)
neural_compressor/torch/algorithms/fp8_quant/_core/quant_dequant.py:84
↓ 6 callersFunction_bytes_feature
Wrapper for inserting bytes features into Example proto.
examples/tensorflow/keras/image_recognition/imagenet_prepare/build_imagenet_data.py:147
↓ 6 callersMethod_get_first_input_from_name
Get the first input of the node.
neural_compressor/tensorflow/quantization/utils/quantize_graph/qdq/fuse_qdq_concatv2.py:50
↓ 6 callersFunction_is_autoround_model_free_string_case
Return True when model-free AutoRound is called with a string model reference.
neural_compressor/torch/quantization/quantize.py:46
↓ 6 callersFunction_pretty_dict
Make the logger dict pretty.
neural_compressor/common/utils/logger.py:34
↓ 6 callersMethodall_reduce
(self, input)
neural_compressor/torch/algorithms/fp8_quant/_quant_common/helper_modules.py:349
↓ 6 callersMethodbatch
Set batch_size and last_batch.
neural_compressor/tensorflow/utils/data.py:283
↓ 6 callersMethodcalc_input_scales
(self, num_of_inputs)
neural_compressor/torch/algorithms/fp8_quant/_core/scale_methods/ops_quantizer.py:66
↓ 6 callersFunctioncheck_shape
Validate that a tensor shape matches the sample data.
neural_compressor/tensorflow/quantization/utils/utility.py:438
↓ 6 callersFunctioncompute_model_hash
Compute a SHA-256 hash of the model's config and all variable values.
test/jax/jax_test_utility.py:125
↓ 6 callersMethoddevice_name
Get the device name.
neural_compressor/torch/utils/auto_accelerator.py:187
↓ 6 callersFunctionfetch_module
Get module with a given op name. Args: model (object): the input model. op_name (str): name of op. Returns: module (
neural_compressor/torch/utils/utility.py:85
↓ 6 callersFunctionfetch_requirements
(path)
setup.py:10
↓ 6 callersMethodgather
(self, tensor, reduced_chunk, original_shape)
neural_compressor/torch/algorithms/fp8_quant/_quant_common/helper_modules.py:474
↓ 6 callersMethodgelu_enable_approximation
( self, input_tensor, another_mul_value=0.5, mul1_value=0.044715, addv
test/tensorflow/quantization/ptq/test_graph_fuse_gelu.py:19
↓ 6 callersFunctionget_const_dim_count
Get the number of dimensions for a Const node. Args: node_def: Const NodeDef. Returns: Number of dimensions for the Const no
neural_compressor/tensorflow/quantization/utils/graph_rewriter/generic/fuse_decomposed_bn.py:390
↓ 6 callersFunctionget_enum_from_format
Make sure Save&Load format is an Enum object.
neural_compressor/torch/utils/utility.py:715
↓ 6 callersFunctionget_gaudi3_type
()
test/torch/algorithms/fp8_quant/test_hpu_utils.py:19
↓ 6 callersMethodget_graph_input_output
Get the graphdef input/output node names. Sometimes, the configuration doesn't specifies the input/output names of the graph, but ten
neural_compressor/tensorflow/quantization/utils/graph_util.py:123
↓ 6 callersMethodget_model_info
Get information about the model. Args: model (torch.nn.Module): The model. Returns: List[Tuple[str, Callable
neural_compressor/torch/quantization/config.py:250
↓ 6 callersMethodget_node_name_from_input
Get the original node name from input string. Args: node_name: input node's name in string Returns: node's n
neural_compressor/tensorflow/quantization/utils/transform_graph/graph_transform_base.py:94
↓ 6 callersFunctionget_patched_module_table
(device_type: Optional[str] = None)
neural_compressor/torch/algorithms/fp8_quant/model_configs.py:127
↓ 6 callersFunctionget_rtn_double_quant_config_set
Generate RTN double quant config set. Returns: List[RTNConfig]: a set of quant config
neural_compressor/torch/quantization/autotune.py:35
↓ 6 callersMethodget_sorted_graph
Return a sorted graphdef object. Sometimes the input graphdef was composed of the random nodedef objects, we reorder the graph to mak
neural_compressor/tensorflow/quantization/utils/quantize_graph_common.py:57
↓ 6 callersFunctionget_tensor_by_name
Get the tensor by name. Considering the 'import' scope when model may be imported more then once, handle naming format like both name:0 and n
neural_compressor/tensorflow/quantization/utils/utility.py:152
↓ 6 callersFunctionis_package_available
Check if the package exists in the environment without importing. Args: package_name (str): package name
neural_compressor/torch/utils/environ.py:53
↓ 6 callersFunctionload_model_from_preset
(model_type, preset, dtype="float32")
test/jax/jax_test_utility.py:116
↓ 6 callersMethodlog
(self, func, msg, *args, **kwargs)
neural_compressor/torch/algorithms/fp8_quant/utils/logger.py:218
↓ 6 callersFunctionprepare_model
Receives the parent module to quantize. Replaces its submodules with patched submodules that perform calibration and quantization. Returns the
neural_compressor/torch/algorithms/fp8_quant/_core/utils.py:110
↓ 6 callersMethodprint_stat
Print the statistics.
neural_compressor/common/utils/utility.py:411
↓ 6 callersMethodquantize
Check whether the mode is for quantization.
neural_compressor/torch/quantization/config.py:1812
↓ 6 callersFunctionread_graph
Reads input graph file as GraphDef. :param in_graph: input graph file. :param in_graph_is_binary: whether input graph is binary, default True
neural_compressor/tensorflow/quantization/utils/utility.py:40
↓ 6 callersMethodsave
Save alpha/scale or model weight. Args: save_scale_file: path to save alpha/scale with torch.save. save_state_dict_fi
neural_compressor/torch/algorithms/weight_only/teq.py:350
↓ 6 callersMethodto_config_mapping
Generate the configuration mapping based on the model information. Args: config_list (List[BaseConfig], optional): A list of Base
neural_compressor/common/base_config.py:586
↓ 6 callersFunctionvalues_from_const
Extracts the values from a const NodeDef as a numpy ndarray. Args: node_def: Const NodeDef that has the values we want to access. Re
neural_compressor/tensorflow/quantization/utils/graph_rewriter/generic/fuse_decomposed_in.py:305
↓ 5 callersMethod_fake_quantize
Fake quantization.
neural_compressor/torch/algorithms/qat/tensor_quantizer.py:105
↓ 5 callersMethod_load_sess
Load a TensorFlow session for the wrapped model. Args: model: Model path or graph object. **kwargs: Additional sessio
neural_compressor/tensorflow/utils/model_wrappers.py:964
↓ 5 callersMethod_post_init
Populate global and local configs based on the whitelist settings.
neural_compressor/common/base_config.py:217
↓ 5 callersFunctionadd_rank_suffix
Add rank suffix to name.
neural_compressor/torch/algorithms/fp8_quant/save_load.py:70
↓ 5 callersMethodapply_conv3d_add_fusion
Apply Conv3D Add fusion. Dequantize + Conv3D + BiasAdd + QuantizeV2 Dequantize + Conv3D + Add + QuantizeV2 Dequantize + Conv3
neural_compressor/tensorflow/quantization/utils/quantize_graph/qdq/fuse_qdq_conv.py:683
↓ 5 callersMethodapply_newly_conv_biasadd_addn_fusion
Apply Conv2D BiasAdd AddN fusion. Dequantize + Conv2D + Add + Add + QuantizeV2 Dequantize + Conv2D + AddV2 + Add + QuantizeV2
neural_compressor/tensorflow/quantization/utils/quantize_graph/qdq/fuse_qdq_conv.py:1747
↓ 5 callersMethodapply_newly_conv_biasadd_fusion
Apply Conv2D BiasAdd fusion. Dequantize + Conv2D + Biasadd + QuantizeV2 Dequantize + DepthwiseConv2dNative + BiasAdd + QuantizeV2
neural_compressor/tensorflow/quantization/utils/quantize_graph/qdq/fuse_qdq_conv.py:1070
↓ 5 callersMethodassertAllClose
(self, first, second, rtol=1e-7, atol=0)
test/tensorflow/quantization/ptq/test_graph_fuse_decomposed_bn.py:96
↓ 5 callersFunctionbypass_reshape
Get Reshape input nodes.
neural_compressor/tensorflow/quantization/utils/graph_rewriter/generic/fuse_decomposed_in.py:341
↓ 5 callersMethodcalc
(self, scale)
neural_compressor/torch/algorithms/fp8_quant/_core/scale_methods/round_scales_function.py:59
↓ 5 callersFunctioncompute_padding
Compute padding values based on padding type and stride. Args: padding: controls the amount of padding applied to the input.
neural_compressor/torch/algorithms/fp8_quant/_quant_common/helper_modules.py:1327
↓ 5 callersMethodconvert
Quant the model with mx data type. Args: model: torch module Returns: model: fake quantized torch module
neural_compressor/torch/algorithms/mx_quant/mx.py:123
↓ 5 callersFunctioncreate_quant_spec_from_config
Create a quantization specification based on the given configuration. Args: dtype (str): The desired data type for quantization. Valid op
neural_compressor/torch/algorithms/pt2e_quant/utility.py:29
↓ 5 callersFunctiondump_model_op_stats
Dump quantizable ops stats of model to user. Args: mode (object): quantization mode. tune_cfg (dict): quantization config
neural_compressor/torch/utils/utility.py:204
↓ 5 callersFunctionexport
Unified export function for quantization. Args: model (torch.nn.Module): The model to be exported. example_inputs (Tuple[Any]): E
neural_compressor/torch/export/pt2e_export.py:111
↓ 5 callersFunctionget_block_prefix
Get prefix and number of blocks. Args: model (torch.nn.Module): input model Returns: block_prefix(str): block_list name in m
neural_compressor/torch/algorithms/weight_only/utility.py:988
↓ 5 callersFunctionget_default_fake_config
Generate the default fake config. Returns: the default fake config.
test/common/test_common.py:161
↓ 5 callersMethodget_default_quantized_func
(self)
neural_compressor/torch/algorithms/fp8_quant/_core/quantized_func_wrappers/hpu/hpu_quantized_func_wrapper.py:42
↓ 5 callersFunctionget_dequantize_fun
Create a dequantization function for the specified dtype. Args: dtype (jnp.dtype): Output dtype after dequantization. asymmetric
neural_compressor/jax/utils/utility.py:177
↓ 5 callersFunctionget_example_input
Get the example input. Args: dataloader (object): calibration dataset. Returns: example_inp (object).
neural_compressor/torch/algorithms/weight_only/utility.py:1010
↓ 5 callersMethodget_inc_accelerator_type
(self)
neural_compressor/torch/utils/auto_accelerator.py:215
↓ 5 callersFunctionget_ipex_version
Return ipex version if ipex exists.
neural_compressor/torch/utils/environ.py:138
↓ 5 callersFunctionget_local_rank
()
neural_compressor/torch/algorithms/fp8_quant/prepare_quant/prepare_model.py:37
↓ 5 callersFunctionget_model_device
Get the device. Args: model (torch.nn.Module): the input model. Returns: device (str): a string.
neural_compressor/torch/utils/utility.py:257
↓ 5 callersFunctionget_param
(key, default_value)
neural_compressor/torch/algorithms/fp8_quant/_core/scale_methods/scale_method_config.py:193
↓ 5 callersMethodget_predefined_configs
Get the predefined configuration set. Returns: Dict[torch_utils.ProcessorType, "RTNConfig"]: The configuration of RTN.
neural_compressor/torch/quantization/config.py:279
↓ 5 callersFunctionget_quantize_fun
Create a quantization function for the specified dtype. Args: dtype (jnp.dtype): Target quantization dtype. asymmetric (bool): Wh
neural_compressor/jax/utils/utility.py:112
↓ 5 callersFunctionget_scale_method_from_config
Given a dictionary with 'weight' and 'activation' ScaleMethodConfig objects, returns the corresponding ScaleMethodString if it matches a know
neural_compressor/torch/algorithms/fp8_quant/_core/scale_methods/scale_method_config.py:175
↓ 5 callersFunctiongraph_def_session
Build session with tf.compat.v1.GraphDef. Args: model (tf.compat.v1.GraphDef): tf.compat.v1.GraphDef object. input_tensor_names (
neural_compressor/tensorflow/utils/model_wrappers.py:191
↓ 5 callersMethodinit_input_config
(self, scales_inv)
neural_compressor/torch/algorithms/fp8_quant/_core/scale_methods/ops_quantizer.py:85
↓ 5 callersFunctioninit_quantized_func_wrapper_factory
()
neural_compressor/torch/algorithms/fp8_quant/_core/quantized_func_wrappers/quantized_func_wrapper_api.py:31
↓ 5 callersFunctionis_ipex_imported
Check whether intel_extension_for_pytorch is imported.
neural_compressor/torch/utils/environ.py:36
↓ 5 callersFunctionis_re_match
(substr_list, target)
neural_compressor/torch/algorithms/fp8_quant/_core/utils.py:49
↓ 5 callersMethodis_scale_quantized
Check if the scale is quantized.
neural_compressor/torch/algorithms/weight_only/hqq/qtensor.py:79
↓ 5 callersMethodis_tunable
Checks if the given value is tunable based on the specified tunable type. Args: value (Any): The value to be checked for tunabili
neural_compressor/common/tuning_param.py:108
↓ 5 callersMethodis_zero_quantized
Check if the zero is quantized.
neural_compressor/torch/algorithms/weight_only/hqq/qtensor.py:83
↓ 5 callersFunctioniterator_sess_run
Run the graph that have iterator integrated in the graph. Args: sess (tf.compat.v1.Session): the model sess to run the graph iter
neural_compressor/tensorflow/quantization/utils/utility.py:176
↓ 5 callersFunctionload_file
Load a scale file and convert it to module configuration objects. Args: fname (str): Source file path. target_format (type): Desi
neural_compressor/torch/algorithms/fp8_quant/_core/common.py:181
↓ 5 callersFunctionload_state_dict
replace torch.nn.Module._load_from_state_dict
neural_compressor/torch/algorithms/fp8_quant/_core/scale_handler.py:160
↓ 5 callersMethodmodel
(self)
neural_compressor/evaluation/lm_eval/models/huggingface.py:362
↓ 5 callersFunctionnative_to_unicode
Convert string to unicode (required in Python 2).
examples/tensorflow/nlp/transformer_lt/quantization/ptq/utils/tokenizer.py:205
↓ 5 callersMethodpack
Pack int weight.
neural_compressor/torch/algorithms/weight_only/modules.py:321
↓ 5 callersFunctionpostprocess
The function that processes the inference outputs to prediction
examples/tensorflow/nlp/large_language_models/quantization/ptq/gpt-j/main.py:237
← previousnext →201–300 of 4,695, ranked by callers