MCPcopy Create free account

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

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

↓ 568 callersMethodformat
(self, record)
neural_compressor/torch/algorithms/fp8_quant/utils/logger.py:137
↓ 421 callersMethodto
Move the QTensor object to a new device or new dtype.
neural_compressor/torch/algorithms/weight_only/hqq/qtensor.py:126
↓ 383 callersMethodget
(self, i)
neural_compressor/torch/algorithms/layer_wise/modified_pickle.py:537
↓ 282 callersMethodinfo
Output log with the info level.
neural_compressor/common/utils/logger.py:121
↓ 254 callersMethodrun
The main entry of auto-tune.
test/common/test_common.py:384
↓ 246 callersMethodset_attr_dtype
Set the attribute data type.
neural_compressor/tensorflow/quantization/utils/graph_util.py:794
↓ 244 callersMethodfrom_pretrained
(cls, pretrained_model_name_or_path, *model_args, **kwargs)
neural_compressor/transformers/models/modeling_auto.py:96
↓ 226 callersFunctionquantize_model
The main entry to quantize model. Args: model: a fp32 model to be quantized. quant_config: single or lists of quantization config
neural_compressor/tensorflow/quantization/quantize.py:32
↓ 223 callersMethoddebug
Output log with the debug level.
neural_compressor/torch/algorithms/fp8_quant/utils/logger.py:230
↓ 195 callersMethodinfo
Output log with the info level.
neural_compressor/torch/algorithms/fp8_quant/utils/logger.py:234
↓ 192 callersMethodnode_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:78
↓ 183 callersFunctionconvert
Convert the prepared model to a quantized model. Args: model (torch.nn.Module): torch model quant_config (BaseConfig, optional):
neural_compressor/torch/quantization/quantize.py:253
↓ 171 callersFunctionprepare
Prepare the model for calibration. Insert observers into the model so that it can monitor the input and output tensors during calibration. A
neural_compressor/torch/quantization/quantize.py:179
↓ 154 callersMethodcreate_node
Create a nodedef object. Args: op (string): op type name (string): op name inputs (string list): op's inp
neural_compressor/tensorflow/quantization/utils/graph_util.py:755
↓ 125 callersMethodcopy_attr
Copy the specified attr value to node. Args: node (nodedef): a nodedef object key (string): string name a
neural_compressor/tensorflow/quantization/utils/quantize_graph_common.py:224
↓ 123 callersFunctionversion1_gte_version2
Check whether version1 is greater than version2 or is equal to it.
neural_compressor/tensorflow/utils/utility.py:52
↓ 115 callersMethodadd_output_graph_node
Inserts one node into the new graph.
neural_compressor/tensorflow/quantization/utils/quantize_graph/quantize_graph_base.py:510
↓ 115 callersMethodload
Read a pickled object representation from the open file. Return the reconstituted object hierarchy specified in the file.
neural_compressor/torch/algorithms/layer_wise/modified_pickle.py:1188
↓ 114 callersMethodeval
(model)
examples/tensorflow/image_recognition/vgg16/quantization/ptq/main.py:132
↓ 105 callersMethod_get_node_input
Return control_input name, non-control_input node name.
neural_compressor/tensorflow/quantization/utils/quantize_graph/quantize_graph_base.py:334
↓ 105 callersMethodwarning
Output log with the warning level (Alias of the method warn).
neural_compressor/torch/algorithms/fp8_quant/utils/logger.py:238
↓ 104 callersMethodremove_node
Remove the user specified node by its name. Args: node_name (string): node name string. Returns: [bool]: Tru
neural_compressor/tensorflow/quantization/utils/graph_util.py:424
↓ 101 callersMethodsave
Abstract method of model saving.
neural_compressor/tensorflow/utils/model_wrappers.py:812
↓ 92 callersMethoddo_transformation
Base Interface that need to be implemented by each sub class.
neural_compressor/tensorflow/quantization/utils/graph_rewriter/graph_base.py:38
↓ 89 callersMethodcreate_constant_node
Create constant node. Args: name (string): op name value (np.array): input data dtype (datatype): data ty
neural_compressor/tensorflow/quantization/utils/graph_util.py:774
↓ 85 callersMethodadd_node
Add the node into the internal data structure node_name_details. Args: new_node (nodedef): the nodedef object. start_
neural_compressor/tensorflow/quantization/utils/graph_util.py:577
↓ 83 callersMethodset_attr_type_list
Set the node's attr which data type is int list.
neural_compressor/tensorflow/quantization/utils/graph_util.py:814
↓ 83 callersMethodupdate
Updates attributes of this class instance with attributes from `kwargs` if they match existing atributtes, returning all the unused kwargs.
neural_compressor/transformers/utils/quantization_config.py:48
↓ 75 callersMethodbias_add
(self, output)
neural_compressor/torch/algorithms/fp8_quant/_quant_common/helper_modules.py:498
↓ 72 callersMethodparse_graph
Analyze the input graphdef and return the list contains each node's input/outputnode names. Args: input_graph_def ([graphdef]): g
neural_compressor/tensorflow/quantization/utils/graph_util.py:683
↓ 70 callersMethodwrite
(self, data)
neural_compressor/torch/algorithms/layer_wise/modified_pickle.py:259
↓ 69 callersMethodread
(self, n)
neural_compressor/torch/algorithms/layer_wise/modified_pickle.py:303
↓ 59 callersMethodadd
(a, b)
test/common/test_utility.py:188
↓ 57 callersMethoddump_graph
Dump the current model's graphdef. Returns: [graphdef]: A graphdef object
neural_compressor/tensorflow/quantization/utils/graph_util.py:623
↓ 57 callersMethodwarning
Output log with the warning level (Alias of the method warn).
neural_compressor/common/utils/logger.py:131
↓ 55 callersMethodset_attr_bool
Set the node's attr which data type is bool.
neural_compressor/tensorflow/quantization/utils/graph_util.py:847
↓ 55 callersMethodset_attr_string_list
Set the node's attr which data type is int list.
neural_compressor/tensorflow/quantization/utils/graph_util.py:820
↓ 53 callersMethodclose
(self)
examples/tensorflow/nlp/bert_large_squad_model_zoo/quantization/ptq/create_tf_record.py:473
↓ 52 callersMethodset_attr_string
Set the node's attr which data type is string.
neural_compressor/tensorflow/quantization/utils/graph_util.py:826
↓ 48 callersMethodrun
This is neural_compressor function include tuning, export and benchmark option.
examples/tensorflow/image_recognition/vgg16/quantization/ptq/main.py:101
↓ 48 callersMethodto
Change device for all values.
neural_compressor/torch/algorithms/weight_only/modules.py:83
↓ 47 callersMethodsynchronize
Do nothing.
neural_compressor/torch/utils/auto_accelerator.py:211
↓ 45 callersFunctionload
Load quantized model. 1. Load INC quantized model in local. case 1: WOQ from neural_compressor.torch.quantization import load
neural_compressor/torch/quantization/save_load_entry.py:69
↓ 45 callersMethodquery_fusion_pattern_nodes
Public interface for query the nodes aggregation status. Args: patterns (string list): Please check the _search_patterns definiti
neural_compressor/tensorflow/quantization/utils/graph_util.py:199
↓ 45 callersMethodset_local
Set custom configuration based on the global configuration object. Args: operator_name_or_list (Union[List, str, Callable]): Spec
neural_compressor/common/base_config.py:297
↓ 44 callersFunctiondefault_collate
Merge data with outer dimension batch size.
neural_compressor/tensorflow/utils/data.py:31
↓ 43 callersFunctionauto_detect_accelerator
Automatically detects and selects the appropriate accelerator. Force use the cpu on node has both cpu and gpu: `INC_TARGET_DEVICE=cpu` python mai
neural_compressor/torch/utils/auto_accelerator.py:427
↓ 40 callersMethod_intel_cpu_add_dequantize_result_node
Add Dequantize node after the quantized node.
neural_compressor/tensorflow/quantization/utils/quantize_graph/quantize_graph_base.py:340
↓ 40 callersMethoddecode
Converts list of int subtokens ids into a string.
examples/tensorflow/nlp/transformer_lt/quantization/ptq/utils/tokenizer.py:150
↓ 37 callersMethodfrom_dict
(cls, config_dict)
test/common/test_common.py:145
↓ 36 callersMethod_find_relu_node
Find relu node algorithm to identify the positive input.
neural_compressor/tensorflow/quantization/utils/quantize_graph/quantize_graph_base.py:291
↓ 34 callersMethodclear
(cls)
neural_compressor/torch/algorithms/fp8_quant/_core/quantized_func_wrappers/quantized_func_wrapper.py:89
↓ 33 callersMethodcurrent_device_name
Get the current device name.
neural_compressor/torch/utils/auto_accelerator.py:199
↓ 33 callersMethoddevice
Do nothing.
neural_compressor/torch/utils/auto_accelerator.py:203
↓ 33 callersMethodtrace
Output log with the trace level.
neural_compressor/torch/algorithms/fp8_quant/utils/logger.py:226
↓ 31 callersMethoddo_transformation
Execute the fusion from small ops to Gelu.
neural_compressor/tensorflow/quantization/utils/graph_rewriter/generic/fuse_gelu.py:30
↓ 31 callersMethodsave_pretrained
Save a configuration object to the directory `save_directory`, so that it can be re-loaded using the [`~PretrainedConfig.from_pretrained`] cla
neural_compressor/transformers/utils/quantization_config.py:189
↓ 30 callersMethod_add_quantize_down_nodes
Add quantize down nodes.
neural_compressor/tensorflow/quantization/utils/quantize_graph/quantize_graph_base.py:618
↓ 30 callersFunctionquantize
(model, q_data, e_data)
test/tensorflow/quantization/ptq/test_rnn.py:13
↓ 29 callersMethodencode
Encodes a string into a list of int subtoken ids.
examples/tensorflow/nlp/transformer_lt/quantization/ptq/utils/tokenizer.py:125
↓ 29 callersMethodis_available
Always return True.
neural_compressor/torch/utils/auto_accelerator.py:183
↓ 28 callersMethodstate_dict
Returns a dictionary containing the state of the module. The state dictionary contains the weights of the `q_weight` attribute. If th
neural_compressor/torch/algorithms/weight_only/hqq/core.py:326
↓ 27 callersMethod__init__
(self)
neural_compressor/torch/algorithms/fp8_quant/_quant_common/helper_modules.py:31
↓ 27 callersMethodremove_redundant_quantization
Remove the redundant Quantize/QuantizeV2 nodes.
neural_compressor/tensorflow/quantization/utils/quantize_graph/quantize_graph_base.py:532
↓ 26 callersMethod_intel_cpu_quantize_weight_eightbit
Quantize weight node.
neural_compressor/tensorflow/quantization/utils/quantize_graph/quantize_graph_base.py:733
↓ 26 callersMethoddump
Write a pickled representation of obj to the open file.
neural_compressor/torch/algorithms/layer_wise/modified_pickle.py:489
↓ 26 callersFunctionsave
Save FP8 model. Args: model (torch.nn.Module): fp8 model object. checkpoint_dir (str, optional): path to checkpoint. Defaults to
neural_compressor/torch/algorithms/fp8_quant/save_load.py:374
↓ 25 callersFunctionautotune
The main entry of auto-tune. Args: model (torch.nn.Module): The model to be quantized. tune_config (TuningConfig): The configurat
neural_compressor/torch/quantization/autotune.py:95
↓ 25 callersFunctionget_hqt_config
(mod)
neural_compressor/torch/algorithms/fp8_quant/_quant_common/quant_config.py:121
↓ 25 callersFunctionmeasure_input
(input, observer)
neural_compressor/torch/algorithms/fp8_quant/_quant_common/helper_modules.py:62
↓ 25 callersMethodset_attr_int
Set the node's attr which data type is int.
neural_compressor/tensorflow/quantization/utils/graph_util.py:837
↓ 24 callersFunctionmeasure_output
(output, observer)
neural_compressor/torch/algorithms/fp8_quant/_quant_common/helper_modules.py:67
↓ 24 callersMethodname
Get the accelerator name.
neural_compressor/torch/utils/auto_accelerator.py:178
↓ 23 callersMethoddequantize
Dequantizes the QTensor into a float tensor. Args: q_weight (QTensor): The quantized weight tensor. Returns:
neural_compressor/torch/algorithms/weight_only/hqq/core.py:70
↓ 23 callersMethodnode_name_from_input
Static method that get the valid node name from input name. Args: node_name (string): node name defined in the input field.
neural_compressor/tensorflow/quantization/utils/graph_util.py:852
↓ 23 callersMethodpost_quantization_cleanup
Remove observers and finalize quantized call path. Returns: None: Cleans up observers and sets quantized call.
neural_compressor/jax/quantization/layers_static.py:272
↓ 23 callersFunctionquantize_model
Return a quantized Keras model according to the given configuration. Args: model (keras.Model): FP32 Keras model to be quantized.
neural_compressor/jax/quantization/quantize.py:43
↓ 23 callersMethodregister_transformer
Register transformers API.
neural_compressor/tensorflow/quantization/utils/quantize_graph/quantize_graph_base.py:38
↓ 22 callersMethodadd_variables
Create quantization variables for activations. Returns: None: Initializes quantization variables.
neural_compressor/jax/quantization/layers_static.py:214
↓ 22 callersFunctionrun_with_raised_exception
(test_to_run, error, error_str)
test/torch/algorithms/fp8_quant/tester.py:73
↓ 22 callersMethodto_dict
(self)
test/torch/algorithms/qat/test_quant_utils.py:147
↓ 22 callersMethodto_dict
Converts the QTensorMetaInfo object to a dictionary. Returns: dict: A dictionary representation of the QTensorMetaInfo object.
neural_compressor/torch/algorithms/weight_only/hqq/qtensor.py:45
↓ 22 callersMethodtrace
Trace and freeze a model using TorchScript, handling various input formats and devices. Args: model (torch.nn.Module): The mod
neural_compressor/torch/algorithms/smooth_quant/utility.py:997
↓ 22 callersMethodupdate
(self, val, n=1)
examples/pytorch/cv/fp8_quant/main.py:338
↓ 21 callersMethodconvert
Compute activation scale and finalize static quantization. Uses fixed_range if set, otherwise reads from the calibration observer. R
neural_compressor/jax/quantization/layers_static.py:242
↓ 21 callersMethodcurrent_device
Get the current device.
neural_compressor/torch/utils/auto_accelerator.py:195
↓ 21 callersMethoddevice
(self)
neural_compressor/evaluation/lm_eval/models/huggingface.py:397
↓ 21 callersFunctionget_used_hpu_mem_MB
Get HPU used memory: MiB.
neural_compressor/torch/utils/environ.py:267
↓ 21 callersMethodidentity
(x)
neural_compressor/torch/algorithms/fp8_quant/_quant_common/helper_modules.py:941
↓ 21 callersFunctionset_random_seed
Set the random seed in config.
neural_compressor/common/utils/utility.py:262
↓ 20 callersMethod_get_op_list
Get the op list.
neural_compressor/tensorflow/quantization/utils/quantize_graph/quantize_graph_base.py:328
↓ 20 callersMethodadd_observers
Attach observer layers for calibration. Skipped when fixed_range is set, as no calibration data is needed. Returns: None
neural_compressor/jax/quantization/layers_static.py:200
↓ 20 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/smooth_quant/utility.py:349
↓ 20 callersFunctionrun_fn
(model)
test/torch/quantization/weight_only/test_gptq.py:22
↓ 19 callersFunctionget_accelerator
Return the recommended accelerator based on device priority.
neural_compressor/torch/utils/environ.py:172
↓ 19 callersMethodget_scale_method
(self, tensor_type, is_dynamic=False, scale_dim_index=-1)
neural_compressor/torch/algorithms/fp8_quant/_core/scale_methods/scale_method_factory.py:53
↓ 19 callersMethodreplace_const_node
Replace the specified const node with another one. Args: new_const_node (NodeDef): node name string. target_node (lis
neural_compressor/tensorflow/quantization/utils/graph_util.py:446
↓ 19 callersFunctionunpack
(input: KeyedJaggedTensor)
examples/pytorch/recommendation/dlrm_v2/fp8_quant/cpu/main.py:34
↓ 18 callersFunctionis_transformers_imported
Check whether transformers is imported.
neural_compressor/torch/utils/environ.py:44
↓ 17 callersMethodempty_cache
Do nothing.
neural_compressor/torch/utils/auto_accelerator.py:207
next →1–100 of 4,695, ranked by callers