MCPcopy Create free account

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

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

↓ 5 callersFunctionprepare_model_to_compare
( model, config_dict, config_dict_qdq, module_type="Linear", scale_method="MAXABS_HW", scale_format="CONST
test/torch/algorithms/fp8_quant/unit_tests/test_qdq.py:86
↓ 5 callersFunctionprepare_qat
r"""Prepares a copy of the model for quantization calibration or quantization-aware training and converts it to quantized version. Quantizati
neural_compressor/torch/quantization/quantize.py:222
↓ 5 callersFunctionprint_rank_0
Prints only on the master process.
examples/pytorch/nlp/huggingface_models/language-modeling/quantization/llm_qat/utils.py:151
↓ 5 callersFunctionquantize_4bit
Quantize tensor to NF4/FP4 data type. Args: tensor: input tensor quantile (float, optional): percentile of clip. Defaults to 1.0.
neural_compressor/torch/algorithms/weight_only/utility.py:112
↓ 5 callersFunctionquantize_elemwise_op
A function used for element-wise quantization with mx_specs. Args: A (torch.Tensor): a tensor that needs to be quantized mx_specs
neural_compressor/torch/algorithms/mx_quant/utils.py:473
↓ 5 callersFunctionregister_supported_configs_for_fwk
Register supported configs for specific framework. Args: fwk_name: the framework name.
neural_compressor/common/base_config.py:853
↓ 5 callersMethodreplace_constant_graph_with_constant_node
Remove sub-graph with a const node. Args: new_node (nodedef): the constant node old_end_node_name (string): the sub-
neural_compressor/tensorflow/quantization/utils/graph_util.py:479
↓ 5 callersMethodrun
This is neural_compressor function include tuning, export and benchmark option.
examples/tensorflow/image_recognition/mobilenet_v2/quantization/ptq/main.py:98
↓ 5 callersMethodrun
This is neural_compressor function include tuning, export and benchmark option.
examples/tensorflow/image_recognition/resnet_v2_50/quantization/ptq/main.py:99
↓ 5 callersMethodrun
This is neural_compressor function include tuning, export and benchmark option.
examples/tensorflow/image_recognition/vision_transformer/quantization/ptq/main.py:121
↓ 5 callersMethodrun
This is neural_compressor function include tuning, export and benchmark option.
examples/tensorflow/image_recognition/inception_v3/quantization/ptq/main.py:98
↓ 5 callersMethodrun
This is neural_compressor function include tuning and benchmark option
examples/tensorflow/recommendation/wide_deep_large_ds/quantization/ptq/main.py:299
↓ 5 callersMethodsave_to_preset
Save task to a preset directory. Args: preset_dir: The path to the local model preset directory. max_shard_size: `int
neural_compressor/jax/quantization/saving.py:440
↓ 5 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/smooth_quant/utility.py:372
↓ 5 callersFunctionsimple_inference
The function is used for ipex warm-up inference.
neural_compressor/torch/algorithms/static_quant/utility.py:447
↓ 5 callersFunctionunpack_batch
(b)
examples/pytorch/recommendation/dlrm/static_quant/ipex/dlrm_s_pytorch.py:128
↓ 5 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_bn.py:336
↓ 4 callersMethod__init__
(self)
test/torch/algorithms/fp8_quant/fp8_tests.py:11
↓ 4 callersMethod__init__
(self, name, mod, d_shape=None, params=None, device=cur_device)
neural_compressor/torch/algorithms/fp8_quant/observer.py:39
↓ 4 callersMethod_change_qdq_for_auto
Change the option for qdq.
neural_compressor/torch/algorithms/smooth_quant/utility.py:1388
↓ 4 callersFunction_check_value
Check if the given object is the given supported type and in the given supported value. Example:: from neural_compressor.common.base_con
neural_compressor/common/base_config.py:869
↓ 4 callersMethod_create_q_tensor
(cls, weight, meta)
neural_compressor/torch/algorithms/weight_only/hqq/core.py:85
↓ 4 callersMethod_get_auto_loss
Get the loss for auto-tuning. Args: output (Tensor): FP32 output for one layer. output_q (Tensor): Quantized outp
neural_compressor/torch/algorithms/smooth_quant/utility.py:1483
↓ 4 callersMethod_get_best_alpha
Obtain the optimal alpha values based on shared criteria and loss values recorded in the auto-tuning step. Returns: dict: A di
neural_compressor/torch/algorithms/smooth_quant/utility.py:1521
↓ 4 callersFunction_get_graph_from_saved_model_v1
The version 1 function that get graph from saved_model. Args: model (string or tf.keras.Model): model path or tf.keras.Model object.
neural_compressor/tensorflow/utils/model_wrappers.py:470
↓ 4 callersFunction_get_nodes_from_name
Get nodes from graph_def using node name. Args: graph_def (graph_def): graph_def node_name (str): node name Returns:
neural_compressor/tensorflow/quantization/utils/utility.py:125
↓ 4 callersFunction_int64_feature
Wrapper for inserting int64 features into Example proto.
examples/tensorflow/keras/image_recognition/imagenet_prepare/build_imagenet_data.py:133
↓ 4 callersMethod_load_weight_file
Load weight file with safe defaults. `weights_only=True` avoids unpickling arbitrary Python objects when loading quantized checkpoint
neural_compressor/torch/algorithms/weight_only/save_load.py:287
↓ 4 callersFunction_map_inc_config_to_torch_quant_config
(inc_config, is_dynamic=False)
neural_compressor/torch/algorithms/pt2e_quant/utility.py:76
↓ 4 callersFunction_pad_tensors_to_same_length
Pad x and y so that the results have the same length (second dimension).
examples/tensorflow/nlp/transformer_lt/quantization/ptq/utils/metrics.py:39
↓ 4 callersFunction_raise_lora_layer_error
(layer_class)
neural_compressor/torch/algorithms/fp8_quant/_quant_common/helper_modules.py:97
↓ 4 callersMethod_use_hpu_module
Check whether hpu weight-only quantization linear module can be used. return True when: 1. device is 'hpu' 2. model has hpu f
neural_compressor/torch/algorithms/weight_only/save_load.py:1068
↓ 4 callersMethodapply_mlp
(self, x, layers)
examples/pytorch/recommendation/dlrm/static_quant/ipex/dlrm_s_pytorch.py:257
↓ 4 callersFunctionbypass_reshape
Get Reshape input nodes.
neural_compressor/tensorflow/quantization/utils/graph_rewriter/generic/fuse_decomposed_bn.py:372
↓ 4 callersMethodcalc_output_scales
(self)
neural_compressor/torch/algorithms/fp8_quant/_core/scale_methods/ops_quantizer.py:78
↓ 4 callersFunctionclean_module_weight
Clean module weight.
neural_compressor/torch/algorithms/layer_wise/utils.py:336
↓ 4 callersFunctionclear_quantized_func_wrapper_factory
()
neural_compressor/torch/algorithms/fp8_quant/_core/quantized_func_wrappers/quantized_func_wrapper_api.py:47
↓ 4 callersFunctionconvert_by_vocab
Converts a sequence of [tokens|ids] using the vocab.
examples/tensorflow/nlp/bert_large_squad_model_zoo/quantization/ptq/tokenization.py:139
↓ 4 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/quantize_graph_common.py:185
↓ 4 callersFunctioncreate_simple_model
Create a simple model for testing.
test/jax/test_save_load.py:40
↓ 4 callersFunctioncreate_test_data
Create test data for inference.
test/jax/test_save_load.py:58
↓ 4 callersFunctiondict_to_scale_method_config
Converts a dictionary specifying scale method parameters (granularity, scale_value_type, rounding_method, backoff, params) into a ScaleMethod
neural_compressor/torch/algorithms/fp8_quant/_core/scale_methods/scale_method_config.py:186
↓ 4 callersMethodexport
Abstract method of model conversion to ONNX.
neural_compressor/tensorflow/utils/model_wrappers.py:817
↓ 4 callersMethodextra_repr
(self)
neural_compressor/torch/algorithms/fp8_quant/_core/quant_dequant.py:109
↓ 4 callersMethodfind_class
(self, module, name)
neural_compressor/torch/algorithms/layer_wise/modified_pickle.py:1615
↓ 4 callersFunctionfind_layers
Get all layers with target types.
neural_compressor/torch/algorithms/weight_only/gptq.py:141
↓ 4 callersMethodfind_params
Find scale and zero for weight.
neural_compressor/torch/algorithms/weight_only/gptq.py:1501
↓ 4 callersFunctionfix_ref_type_of_graph_def
Fix ref type of the graph_def.
neural_compressor/tensorflow/quantization/utils/utility.py:234
↓ 4 callersMethodfrom_float
Create a new HQQModule instance from a floating-point linear. Args: float_module (torch.nn.Linear): The floating-point module to
neural_compressor/torch/algorithms/weight_only/hqq/core.py:284
↓ 4 callersFunctiongenerate_feed_dict
Generate feed dict helper function.
neural_compressor/tensorflow/quantization/utils/utility.py:410
↓ 4 callersMethodgenerate_int32_bias_for_matmul
Static method that generate int32 bias for matmul op. Args: bias_tensor: bias node tensor. weights_tensor: weights te
neural_compressor/tensorflow/quantization/utils/graph_util.py:945
↓ 4 callersMethodget_accelerator_cls_by_name
Get accelerator by name.
neural_compressor/torch/utils/auto_accelerator.py:91
↓ 4 callersMethodget_config_set_for_tuning
Get the default configuration set for tuning. Returns: Union[None, "RTNConfig", List["RTNConfig"]]: The configuration set for tun
neural_compressor/torch/quantization/config.py:268
↓ 4 callersFunctionget_device_name
()
test/torch/algorithms/fp8_quant/test_hpu_utils.py:23
↓ 4 callersFunctionget_fp8_143_scales
()
test/torch/algorithms/fp8_quant/unit_tests/test_functions/test_matmul_fp8.py:40
↓ 4 callersMethodget_frame_info
Get the frame info of the model. Returns: [parent_frame_details]: OrderedDict frame info of the graph nodes.
neural_compressor/tensorflow/quantization/utils/graph_util.py:635
↓ 4 callersFunctionget_fullscale
(dtype, device, exp_bias=None)
neural_compressor/torch/algorithms/fp8_quant/_core/fp_utils.py:105
↓ 4 callersFunctionget_gaudi2_type
()
test/torch/algorithms/fp8_quant/test_hpu_utils.py:15
↓ 4 callersFunctionget_model_info
Get model info according to white_module_list.
neural_compressor/torch/utils/utility.py:134
↓ 4 callersFunctionget_scale_dtype
(scale)
neural_compressor/torch/algorithms/fp8_quant/_core/scale_handler.py:82
↓ 4 callersMethodget_scales_module_config
(self)
neural_compressor/torch/algorithms/fp8_quant/_core/scale_methods/ops_quantizer.py:51
↓ 4 callersFunctionget_woq_linear_num
(model, woq_module_type_name)
test/torch/quantization/weight_only/test_gptq.py:26
↓ 4 callersMethodget_woq_linear_num
(self, model, woq_module_type_name)
test/torch/quantization/weight_only/test_load.py:31
↓ 4 callersMethodhas_name
(self, module_name: str)
test/torch/algorithms/fp8_quant/tester.py:290
↓ 4 callersMethodhas_positive_input
Check the specified node has positive input data or not. Args: node_name (string): node name Returns: bool:
neural_compressor/tensorflow/quantization/utils/graph_util.py:111
↓ 4 callersFunctioninference
( args, dlrm, best_acc_test, best_auc_test, test_ld, trace=True )
examples/pytorch/recommendation/dlrm/static_quant/ipex/dlrm_s_pytorch.py:447
↓ 4 callersFunctionis_gaudi2
()
test/torch/algorithms/fp8_quant/test_hpu_utils.py:35
↓ 4 callersFunctionis_ipex_available
Return whether ipex is available.
neural_compressor/torch/utils/environ.py:133
↓ 4 callersFunctionis_runtime_scale_patching
()
neural_compressor/torch/algorithms/fp8_quant/_core/common.py:348
↓ 4 callersFunctionis_saved_model_format
Check the model_path format is saved_model or not. Args: model_path (string): the model folder path Returns: bool: return Tr
neural_compressor/tensorflow/quantization/utils/utility.py:138
↓ 4 callersFunctioniterate_over_layers
Apply operations to model layers matching the filter function. Args: model (keras.Model): Keras model with a _flatten_layers iterator.
neural_compressor/jax/utils/utility.py:506
↓ 4 callersFunctionload_empty_model
Load a empty model.
neural_compressor/torch/utils/utility.py:341
↓ 4 callersMethodmodule_inference
Collect output of module. Args: model (torch.nn.Module): input model. inputs (list): a list of module input.
neural_compressor/torch/algorithms/weight_only/awq.py:529
↓ 4 callersFunctionnormalize_answer
Normalize the answer text. Lower text, remove punctuation, articles and extra whitespace, and replace other whitespace (newline, tab, etc.) t
examples/tensorflow/nlp/bert_large_squad_model_zoo/quantization/ptq/data_process.py:51
↓ 4 callersFunctionparse_saved_model
Parse a input saved_model. Args: model(string or AutoTrackable object): The input saved_model. Returns: graph_def: The graph
neural_compressor/tensorflow/quantization/utils/utility.py:558
↓ 4 callersFunctionprep_model
Prepare this model with the given (absolute or relative) path of the json file containing the configuration. If `config_path` is not given or `No
neural_compressor/torch/algorithms/fp8_quant/prepare_quant/prepare_model.py:56
↓ 4 callersFunctionprint_model
Print the model structure. Args: container (keras.Model): The model or layer to be printed. max_lines (int): The maximum number o
neural_compressor/jax/utils/utility.py:324
↓ 4 callersFunctionprompts2images
(pipeline, prompts, **kwargs)
examples/pytorch/diffusion_model/diffusers/stable_diffusion/smooth_quant/sdxl_smooth_quant.py:13
↓ 4 callersFunctionquant_dequant_x_v1
Quantize and dequantize a tensor. Args: x (Tensor): The input tensor to be quantized and dequantized. min_x (Tensor, optional
neural_compressor/torch/algorithms/smooth_quant/utility.py:726
↓ 4 callersMethodquantize
Do quantization.
neural_compressor/torch/algorithms/weight_only/gptq.py:1626
↓ 4 callersMethodrank
(self)
neural_compressor/evaluation/lm_eval/models/huggingface.py:401
↓ 4 callersFunctionrun_accuracy_test
Run both the reference and the quantized versions of this module, and compare the outputs on every test vector. First the measure vectors are
test/torch/algorithms/fp8_quant/tester.py:150
↓ 4 callersFunctionrun_fn
(model)
examples/pytorch/nlp/huggingface_models/language-modeling/quantization/smooth_quant/run_clm_no_trainer.py:169
↓ 4 callersMethodsave_temp_json_file
Save configuration to a temporary json file.
neural_compressor/torch/quantization/config.py:1835
↓ 4 callersMethodset_attr_dtype
Set the attribute data type.
neural_compressor/tensorflow/quantization/utils/quantize_graph_common.py:235
↓ 4 callersMethodset_attr_float
Set the node's attr which data type is float.
neural_compressor/tensorflow/quantization/utils/graph_util.py:842
↓ 4 callersMethodset_eval_fn_registry
Set the evaluation function registry. Args: eval_fns (Optional[Union[Callable, Dict, List[Dict]]]): The evaluation function(s) to
neural_compressor/common/base_tuning.py:147
↓ 4 callersFunctiontime_wrap
()
examples/pytorch/recommendation/dlrm/static_quant/ipex/dlrm_s_pytorch.py:113
↓ 4 callersMethodtokenize
(self, text)
examples/tensorflow/nlp/bert_large_squad_model_zoo/quantization/ptq/tokenization.py:173
↓ 4 callersMethodupdate
(self, pred, label)
examples/tensorflow/nlp/transformer_lt/quantization/ptq/main.py:96
↓ 4 callersFunctionvalidate
(val_loader, model, criterion, args)
examples/pytorch/image_recognition/torchvision_models/quantization/static_quant/ipex/main.py:429
↓ 3 callersMethod__init__
(self, in_features, out_features, bias=True)
test/torch/algorithms/fp8_quant/unit_tests/test_qdq.py:46
↓ 3 callersMethod__init__
Initialize the AutoAlpha tuner with necessary parameters and components.
neural_compressor/torch/algorithms/smooth_quant/utility.py:1235
↓ 3 callersMethod__init__
Initialization.
neural_compressor/tensorflow/quantization/utils/graph_rewriter/int8/fuse_matmul_requantize.py:208
↓ 3 callersMethod__new__
Create a singleton _Logger instance.
neural_compressor/torch/algorithms/fp8_quant/utils/logger.py:97
↓ 3 callersMethod_absorb_scales
Absorb the scale to the layer at the output channel. Args: layer_name (str): The module name. scale (Tensor): The
neural_compressor/torch/algorithms/smooth_quant/utility.py:1994
↓ 3 callersMethod_add_common_quantization_nodes
Builds constant nodes needed for quantization of inputs.
neural_compressor/tensorflow/quantization/utils/quantize_graph/quantize_graph_base.py:472
↓ 3 callersMethod_allowed_dtype_val
Get the allowed dtype value of the node.
neural_compressor/tensorflow/quantization/utils/graph_rewriter/bf16/bf16_convert.py:104
↓ 3 callersMethod_calculate_maxabs_scale
(self, tensor, tensor_type)
neural_compressor/torch/algorithms/fp8_quant/_core/scale_methods/scales_method.py:78
↓ 3 callersMethod_decode_string
(self, value)
neural_compressor/torch/algorithms/layer_wise/modified_pickle.py:1341
← previousnext →301–400 of 4,695, ranked by callers