MCPcopy Create free account

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

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

↓ 17 callersMethodget_logger
Get the logger.
neural_compressor/common/utils/logger.py:76
↓ 17 callersFunctionget_quantized_func_wrapper
(op_type, scale_format, is_dynamic=False)
neural_compressor/torch/algorithms/fp8_quant/_core/quantized_func_wrappers/quantized_func_wrapper_api.py:27
↓ 17 callersFunctionnode_from_map
Pulls a node def from a dictionary for a given name. Args: node_map: Dictionary containing an entry indexed by name for every node.
neural_compressor/tensorflow/quantization/utils/graph_rewriter/generic/fuse_decomposed_in.py:286
↓ 17 callersFunctionnode_from_map
Pulls a node def from a dictionary for a given name. Args: node_map: Dictionary containing an entry indexed by name for every node.
neural_compressor/tensorflow/quantization/utils/graph_rewriter/generic/fuse_layer_norm.py:209
↓ 17 callersMethodpredict
(self, predict_dataset, predict_examples, ignore_keys=None, metric_key_prefix: str = "test")
examples/pytorch/nlp/huggingface_models/question-answering/quantization/static_quant/ipex/trainer_qa.py:75
↓ 16 callersMethod_post_init
(self)
neural_compressor/torch/algorithms/weight_only/teq.py:79
↓ 16 callersFunctioneval
(model)
examples/tensorflow/nlp/bert_large_squad_model_zoo/quantization/ptq/main.py:114
↓ 16 callersFunctionmove_input_to_device
Move the input data to the specified device. Args: input (dict, list, tuple, or torch.Tensor): The input data to be moved.
neural_compressor/torch/algorithms/smooth_quant/utility.py:458
↓ 16 callersMethodquantize
Execute the quantize process on the specified model. Args: quant_config(dict): The user defined 'StaticQuantConfig' class.
neural_compressor/tensorflow/algorithms/static_quant/keras.py:334
↓ 15 callersMethodcalc_scales
(self, tensor, tensor_type, **additional_kwargs)
neural_compressor/torch/algorithms/fp8_quant/_core/scale_methods/scales_method.py:234
↓ 15 callersMethoderror
Output log with the error level.
neural_compressor/torch/algorithms/fp8_quant/utils/logger.py:242
↓ 15 callersMethodfrom_dict
Construct config from a dictionary. Args: config_dict: The dictionary containing the config. Returns: The co
neural_compressor/common/base_config.py:350
↓ 15 callersMethodget_full_layer_name
Get full layer name. Args: sub_layer_name (str): sub layer name block_idx (int): index of block Returns:
neural_compressor/torch/algorithms/weight_only/gptq.py:317
↓ 15 callersFunctionget_torch_version
Return torch version if ipex exists.
neural_compressor/torch/utils/environ.py:159
↓ 15 callersFunctionget_used_cpu_mem_MB
Get the amount of CPU memory used by the current process in MiB (Mebibytes).
neural_compressor/torch/utils/environ.py:278
↓ 15 callersMethodlog
Output log with the level as a parameter.
neural_compressor/common/utils/logger.py:81
↓ 15 callersFunctionrun_fn
(model)
test/torch/quantization/test_static_quant.py:52
↓ 14 callersMethod_insert_dummy_biasadd
Insert dummy biasadd for fusion.
neural_compressor/tensorflow/quantization/utils/quantize_graph/qdq/fuse_qdq_conv.py:132
↓ 14 callersFunctionbuild_simple_torch_model
()
test/torch/test_autotune.py:65
↓ 14 callersMethoddecode_jpeg
(self, image_data)
examples/tensorflow/keras/image_recognition/imagenet_prepare/build_imagenet_data.py:215
↓ 14 callersMethodreadline
(self)
neural_compressor/torch/algorithms/layer_wise/modified_pickle.py:315
↓ 14 callersMethodreplace_single_node
Insert one node into the graph. Args: new_node (nodedef): new nodedef object old_output_node_names (string list):the
neural_compressor/tensorflow/quantization/utils/graph_util.py:513
↓ 14 callersFunctionvalidate_graph_node
Validate nodes exist in the graph_def. Args: graph_def (tf.compat.v1.GraphDef): tf.compat.v1.GraphDef object. node_names (list of
neural_compressor/tensorflow/utils/model_wrappers.py:119
↓ 14 callersFunctionverify_api
Check if quantized layer method API matches original layer method API. Args: orig_cls (type): Original layer class. quant_cls (ty
neural_compressor/jax/utils/utility.py:526
↓ 14 callersFunctionversion1_lt_version2
Check whether version1 is less than version2.
neural_compressor/tensorflow/utils/utility.py:37
↓ 13 callersMethod__init__
Init RTN weight-only quantization config. Args: dtype (str): Data type for weights. Default is "int". bits (int): Num
neural_compressor/torch/quantization/config.py:125
↓ 13 callersFunctioncreate_int_feature
(values)
examples/tensorflow/nlp/bert_large_squad_model_zoo/quantization/ptq/create_pretraining_data.py:175
↓ 13 callersMethodexecute
Execute according to mode. Args: model (torch.nn.Module): The model to be executed. mode (Mode): The mode of curr
neural_compressor/torch/algorithms/base_algorithm.py:103
↓ 13 callersFunctionget_current_repr
(cls_instance, *member_names)
neural_compressor/torch/algorithms/fp8_quant/_quant_common/helper_modules.py:73
↓ 13 callersFunctionnode_from_map
Pulls a node def from a dictionary for a given name. Args: node_map: Dictionary containing an entry indexed by name for every node.
neural_compressor/tensorflow/quantization/utils/graph_rewriter/generic/fuse_decomposed_bn.py:317
↓ 13 callersFunctionset_module
Set module with a given op name. Args: model (object): the input model. op_name (str): name of op. new_module (object): t
neural_compressor/torch/utils/utility.py:106
↓ 12 callersMethod_add_eightbit_prologue_nodes
Add quantized prologue nodes.
neural_compressor/tensorflow/quantization/utils/quantize_graph/quantize_graph_base.py:373
↓ 12 callersMethod_reset_output_node_maps
Reset output node maps.
neural_compressor/tensorflow/quantization/utils/quantize_graph/quantize_graph_base.py:324
↓ 12 callersFunctionevaluate
Custom evaluate function to estimate the accuracy of the model. Args: model (tf.Graph_def): The input model graph Returns:
examples/tensorflow/image_recognition/vgg16/quantization/ptq/main.py:53
↓ 12 callersFunctionextra_representation
(org_repr, org_name, curr_repr)
neural_compressor/torch/algorithms/fp8_quant/_quant_common/helper_modules.py:92
↓ 12 callersMethodfrom_json_file
Load config from a JSON file. Args: filename (str): The path to the JSON file. Returns: The loaded config.
neural_compressor/common/base_config.py:384
↓ 12 callersFunctionget_default_static_config
Generate the default Static quantization config. Returns: StaticQuantConfig: The default JAX Static quantization config.
neural_compressor/jax/quantization/config.py:366
↓ 12 callersMethodget_eightbit_patterns
Get eightbit op wise sequences information. Returns: [dictionary]: key is the op type while value is the list of sequences start
neural_compressor/tensorflow/algorithms/static_quant/tensorflow.py:1387
↓ 12 callersMethodsave
(self, obj, save_persistent_id=True)
neural_compressor/torch/algorithms/layer_wise/modified_pickle.py:546
↓ 12 callersMethodset_device
Do nothing.
neural_compressor/torch/utils/auto_accelerator.py:191
↓ 12 callersMethodvalues_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.
neural_compressor/tensorflow/quantization/utils/graph_util.py:874
↓ 11 callersMethod__init__
(self, round_scale_method, params, device_for_scales, backoff, fullscale=None, is_dynamic=False)
neural_compressor/torch/algorithms/fp8_quant/_core/scale_methods/scales_method.py:88
↓ 11 callersFunctionfinalize_calibration
Generate and save calibration info.
neural_compressor/torch/quantization/quantize.py:328
↓ 11 callersFunctionget_default_gptq_config
Get the default configuration of GPTQ. Args: processor_type (Optional[Union[str, torch_utils.ProcessorType]], optional): The user-specifi
neural_compressor/torch/quantization/config.py:509
↓ 11 callersMethodget_op_types_by_precision
Get op types per precision. Args: precision (string): precision name Returns: [string list]: A list composed
neural_compressor/tensorflow/algorithms/static_quant/tensorflow.py:1317
↓ 11 callersFunctionget_quantizer
Get the quantizer. Initialize a quantizer or get `quantizer` attribute from model. Args: model (torch.nn.Module): pytorch model.
neural_compressor/torch/utils/utility.py:163
↓ 11 callersFunctionget_world_size
()
neural_compressor/torch/algorithms/fp8_quant/prepare_quant/prepare_model.py:26
↓ 11 callersMethodhalf
Convert the QTensor object to half precision.
neural_compressor/torch/algorithms/weight_only/hqq/qtensor.py:133
↓ 11 callersMethodpop_mark
(self)
neural_compressor/torch/algorithms/layer_wise/modified_pickle.py:1222
↓ 11 callersMethodremove_training_nodes
Prunes out nodes that aren't needed for inference. Args: input_graph: Model to analyze and prune. types_to_splice: An
neural_compressor/tensorflow/quantization/utils/quantize_graph_common.py:125
↓ 11 callersMethodsave_model
Save the quantized model.
examples/pytorch/nlp/huggingface_models/language-modeling/quantization/llm_qat/utils.py:175
↓ 11 callersMethodsave_reduce
(self, func, args, state=None, listitems=None, dictitems=None, state_setter=None, obj=None)
neural_compressor/torch/algorithms/layer_wise/modified_pickle.py:629
↓ 11 callersMethodto_config_mapping
Convert the configuration to a mapping. Args: config_list (List[BaseConfig]): List of base configurations. Default is None.
neural_compressor/torch/quantization/config.py:229
↓ 10 callersMethod__init__
(self, name, mod, d_shape=None, params=None, device="hpu")
test/torch/algorithms/fp8_quant/test_register_apis.py:157
↓ 10 callersMethod_is_match
Detect the rule matched nodes collections. Returns: [List] -- [the matched rule] [String] -- [the list contains the m
neural_compressor/tensorflow/quantization/utils/quantize_graph/quantize_graph_base.py:163
↓ 10 callersMethodbackward
(ctx, grad_output)
examples/pytorch/recommendation/dlrm/static_quant/ipex/extend_distributed.py:370
↓ 10 callersFunctionbuild_simple_torch_model
()
test/torch/test_config.py:29
↓ 10 callersMethodcalc_invert_scales
(self)
neural_compressor/torch/algorithms/fp8_quant/_core/scale_methods/scales_method.py:45
↓ 10 callersFunctionconvert_dtype_str2torch
Converts a string dtype to its corresponding PyTorch dtype. Args: str_dtype (str): The string representation of the dtype. Returns:
neural_compressor/torch/algorithms/weight_only/utility.py:1218
↓ 10 callersMethoddebug
Output log with the debug level.
neural_compressor/common/utils/logger.py:91
↓ 10 callersFunctiondeep_get
Get the dot key's item in nested dict. Usage example: person = {'person':{'name':{'first':'John'}}} deep_get(person, "person.name.f
neural_compressor/tensorflow/utils/utility.py:91
↓ 10 callersMethoderror
Output log with the error level.
neural_compressor/common/utils/logger.py:101
↓ 10 callersMethodevaluate
Evaluate the model using registered evaluation functions. Args: model: The fp32 model or quantized model. Returns:
neural_compressor/common/base_tuning.py:95
↓ 10 callersMethodmemoize
Store an object in the memo.
neural_compressor/torch/algorithms/layer_wise/modified_pickle.py:503
↓ 10 callersMethodparse
(custom_config: Mapping[str, str])
neural_compressor/torch/algorithms/fp8_quant/_quant_common/quant_config.py:162
↓ 10 callersFunctionpostprocess_model
Process `quantizer` attribute of model according to current phase. In `prepare` phase, the `quantizer` is set as an attribute of the model to
neural_compressor/torch/utils/utility.py:184
↓ 10 callersFunctionquant_tensor
Quant and dequant tensor with group size. It's an in-place function. Args: weight: input weight bits (int, optional): bits. Defau
neural_compressor/torch/algorithms/weight_only/utility.py:273
↓ 10 callersFunctionrun_fn
(model)
test/torch/quantization/test_smooth_quant.py:35
↓ 10 callersFunctionsave
Save quantized model. Args: model (torch.nn.module or TorchScript model with IPEX or fx graph with pt2e, optional): Quantized model.
neural_compressor/torch/quantization/save_load_entry.py:37
↓ 10 callersFunctionsave_file
Persist a scale-related payload to disk in the chosen format. Args: model (torch.nn.Module): Model associated with the data. d (d
neural_compressor/torch/algorithms/fp8_quant/_core/common.py:150
↓ 9 callersMethod__init__
(self, config, mod, measurement, params, mod_type_str)
neural_compressor/torch/algorithms/fp8_quant/_core/scale_methods/ops_quantizer.py:29
↓ 9 callersMethodadd_variables
Create quantization helper functions for activations. When fixed_range is set, pre-computes scale (and zero point) so that call avoid
neural_compressor/jax/quantization/layers_dynamic.py:91
↓ 9 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/algorithms/weight_only/utility.py:636
↓ 9 callersFunctionget_default_rtn_config
Get the default configuration of RTN. Args: processor_type (Optional[Union[str, torch_utils.ProcessorType]], optional): The user-specifie
neural_compressor/torch/quantization/config.py:291
↓ 9 callersFunctionload_value
Load the module value. Args: model (torch.nn.module): torch model. param_name (str): module name. path (str): path to loa
neural_compressor/torch/algorithms/layer_wise/utils.py:200
↓ 9 callersMethodremove_node_with_single_input_output
Remove node with one input and rebuild internal graph data structure. Args: node_name (string): node name Returns:
neural_compressor/tensorflow/quantization/utils/graph_util.py:374
↓ 9 callersMethodrun_linear_qdq
(self, input, bias)
neural_compressor/torch/algorithms/fp8_quant/_quant_common/helper_modules.py:225
↓ 9 callersMethodrun_linear_quant
(self, input, bias)
neural_compressor/torch/algorithms/fp8_quant/_quant_common/helper_modules.py:215
↓ 9 callersMethodupdate
(self, val, n=1)
examples/pytorch/image_recognition/torchvision_models/quantization/static_quant/ipex/main.py:498
↓ 9 callersMethodupdate
(self, val, n=1)
examples/pytorch/cv/mixed_precision/main.py:314
↓ 9 callersMethodupdate
(self, val, n=1)
examples/pytorch/cv/static_quant/main.py:386
↓ 9 callersFunctionversion1_gt_version2
Check whether version1 is greater than version2.
neural_compressor/tensorflow/utils/utility.py:42
↓ 9 callersMethodwait
(self)
examples/pytorch/recommendation/dlrm/static_quant/ipex/extend_distributed.py:123
↓ 8 callersMethod__getattribute__
Delegate attribute access to the wrapped model. Args: name (str): Attribute name to access. Returns: Any: At
neural_compressor/jax/quantization/saving.py:363
↓ 8 callersMethod__setattr__
Delegate attribute updates to the wrapped model. Args: name (str): Attribute name to update. value (Any): Value to as
neural_compressor/jax/quantization/saving.py:376
↓ 8 callersFunctioncalib_func
(model)
test/torch/quantization/weight_only/test_awq.py:27
↓ 8 callersFunctioncheck_scale_method_fields
Iterates over all scale method configs (default, nodes, layers, layer_types) in the given dict and compares them to the given conditions. For
neural_compressor/torch/algorithms/fp8_quant/_core/scale_methods/scale_method_config.py:274
↓ 8 callersMethodconvert
Generate optimized model by fusing BN layers or replacing Keras layers to custom quantized layers. Args: BN_fused_layers: The lay
neural_compressor/tensorflow/algorithms/static_quant/keras.py:749
↓ 8 callersMethodexpand
Expand the config. case 1 { "global": { "weight_bits": [4, 6]} } expand to :
neural_compressor/common/base_config.py:491
↓ 8 callersFunctionforward_wrapper
Apply the model to the input data on the specified device. Args: model (torch.nn.Module): The model to be applied. input (dic
neural_compressor/torch/algorithms/smooth_quant/utility.py:487
↓ 8 callersMethodfrom_config
Deserialize this class from a config dict.
neural_compressor/tensorflow/keras/layers/dense.py:151
↓ 8 callersMethodgelu
(self, input_tensor, mul_value=0.5, addv2_value=1.0, sqrt_value=2.0)
test/tensorflow/quantization/ptq/test_graph_fuse_gelu.py:15
↓ 8 callersMethodget_cls_configs
Get registered configurations without priority. Returns: Dict[str, Dict[str, object]]: A dictionary containing registered configu
neural_compressor/common/base_config.py:139
↓ 8 callersMethodget_layer_config
Obtain config for one layer, since GPTQ supports layer-wise config.
neural_compressor/torch/algorithms/weight_only/gptq.py:367
↓ 8 callersMethodinit_scales_from_module_config
(self, module)
neural_compressor/torch/algorithms/fp8_quant/_core/scale_methods/ops_quantizer.py:58
↓ 8 callersMethodprepare
Prepares a given model for quantization. Args: model (torch.nn.Module): raw fp32 model or prepared model. example
neural_compressor/torch/algorithms/smooth_quant/smooth_quant.py:63
↓ 8 callersFunctionrun_fn
(model)
test/torch/quantization/test_mx_quant.py:27
↓ 8 callersFunctionset_hqt_config
(mod, config)
neural_compressor/torch/algorithms/fp8_quant/_quant_common/quant_config.py:125
↓ 8 callersFunctionversion1_eq_version2
Check whether version1 is equal to version2.
neural_compressor/tensorflow/utils/utility.py:47
↓ 8 callersMethodwarning_once
Output log with the warning level only once.
neural_compressor/common/utils/logger.py:141
← previousnext →101–200 of 4,695, ranked by callers