MCPcopy Create free account

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

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

↓ 3 callersFunction_deepcopy_warp
Create a deep copy of the model while preserving specific attributes. Args: model (torch.nn.Module): The model to deep copy. Returns
neural_compressor/torch/quantization/autotune.py:56
↓ 3 callersMethod_detect_batch_size
(self, requests=None, pos: int = 0)
neural_compressor/evaluation/lm_eval/models/huggingface.py:780
↓ 3 callersMethod_dtype
Get the dtype of the node.
neural_compressor/tensorflow/quantization/utils/graph_rewriter/bf16/bf16_convert.py:62
↓ 3 callersMethod_eightbitize_input_to_node
Takes one float input to an op, and converts it to quantized form.
neural_compressor/tensorflow/quantization/utils/quantize_graph/quantize_graph_base.py:671
↓ 3 callersMethod_fuse_requantize_with_fused_quantized_node
Fuse the Requantize/Dequantize with fused quantized Ops.
neural_compressor/tensorflow/quantization/utils/graph_converter.py:778
↓ 3 callersMethod_get_sq_layer_names
Get all the layers that could be smooth quantized. Returns: list: All the smooth quantization layer names.
neural_compressor/torch/algorithms/smooth_quant/utility.py:1509
↓ 3 callersFunction_getattribute
(obj, name)
neural_compressor/torch/algorithms/layer_wise/modified_pickle.py:336
↓ 3 callersMethod_inference
Run the calibration on the input graph. Args: model(TensorflowBaseModel): input TensorflowBaseModel
neural_compressor/tensorflow/quantization/utils/graph_converter.py:228
↓ 3 callersMethod_init_subtokenizer
(self, vocab_list)
examples/tensorflow/nlp/transformer_lt/quantization/ptq/utils/tokenizer_test.py:27
↓ 3 callersFunction_ipex_post_quant_process
Converts to a jit model. Args: model (QuantizationInterceptionModule): a prepared model. example_inputs (tensor/tuple/dict):
neural_compressor/torch/algorithms/smooth_quant/smooth_quant.py:383
↓ 3 callersMethod_is_w4a8_model_from_auto_round
(self)
neural_compressor/torch/algorithms/weight_only/save_load.py:307
↓ 3 callersMethod_np_arrays_to_batch
( self, dense: np.ndarray, sparse: List[np.ndarray], labels: np.ndarray, )
examples/pytorch/recommendation/dlrm_v2/fp8_quant/cpu/data_process/multi_hot_criteo.py:211
↓ 3 callersMethod_parse_graph
Parse the graph and get the input node and output node name details.
neural_compressor/tensorflow/quantization/utils/quantize_graph/quantize_graph_base.py:516
↓ 3 callersFunction_quantize_elemwise_core
Core function used for element-wise quantization. Args: A (torch.Tensor): tensor to be quantized bits (int): number of mantissa b
neural_compressor/torch/algorithms/mx_quant/utils.py:366
↓ 3 callersFunction_resolve_manifest_path
Use absolute paths from manifest directly; fallback to root for relative paths.
examples/pytorch/diffusion_model/diffusers/wan/evaluate_manifest_no_gt.py:12
↓ 3 callersMethod_scale_layer_weight
Scale the layer weights at input channel and depthwise convolution output channel. Args: layer_name (str): The layer name.
neural_compressor/torch/algorithms/smooth_quant/utility.py:1968
↓ 3 callersMethod_trace
Identify the layers which can be smooth quantized. Args: op_types (list): The operation types to be smooth quantized.
neural_compressor/torch/algorithms/smooth_quant/utility.py:2518
↓ 3 callersFunction_transform_features
( x_int_batch, x_cat_batch, y_batch, max_ind_range, flag_input_torch_tensor=False )
examples/pytorch/recommendation/dlrm/static_quant/ipex/data_loader_terabyte.py:69
↓ 3 callersMethodadd_bias
(self, output)
neural_compressor/torch/algorithms/fp8_quant/_quant_common/helper_modules.py:541
↓ 3 callersFunctionadd_import_to_name
(sess, name, try_cnt=2)
examples/tensorflow/style_transfer/arbitrary_style_transfer/quantization/ptq/main.py:165
↓ 3 callersMethodadd_trial_result
Adds a trial result to the tuning history. Args: trial_index (int): The index of the trial. trial_result (Union[int,
neural_compressor/common/base_tuning.py:459
↓ 3 callersMethodbatch
Dataset return data per batch.
examples/tensorflow/image_recognition/vgg16/quantization/ptq/data_process.py:476
↓ 3 callersMethodblock_inference
Collect output of block. Args: model (torch.nn.Module): input model. Returns: output(list): a list of block
neural_compressor/torch/algorithms/weight_only/awq.py:509
↓ 3 callersFunctionbuild_captured_dataloader
Build a dataloader that captures input data and keyword arguments used in forward passes of the model. Args: model (torch.nn.Module):
neural_compressor/torch/algorithms/smooth_quant/utility.py:556
↓ 3 callersFunctionbuild_fake_graphdef
(set_min_first=False, dq_multi_outputs=False)
test/tensorflow/quantization/ptq/test_graph_dequantize_cast_optimizer.py:16
↓ 3 callersFunctionbuild_fake_graphdef
(set_min_first=False, dq_multi_outputs=False)
test/tensorflow/quantization/ptq/newapi/test_graph_dequantize_cast_optimizer_newapi.py:16
↓ 3 callersMethodbuild_simple_torch_model_and_example_inputs
()
test/torch/quantization/test_pt2e_quant.py:87
↓ 3 callersFunctioncal_scale
Calculate the scaling factor for weights based on the input max values and weight magnitudes. Args: input_max_abs (Tensor): The maximu
neural_compressor/torch/algorithms/smooth_quant/utility.py:605
↓ 3 callersFunctioncalc_scale_from_maxabs
(xmaxabs, fullscale, backoff=1)
neural_compressor/torch/algorithms/fp8_quant/_core/fp_utils.py:156
↓ 3 callersFunctioncalculate_scale_maxabs_with_cguid
(x, maxMode, **kwargs)
neural_compressor/torch/algorithms/fp8_quant/_core/fp_utils.py:27
↓ 3 callersFunctioncalib_func
(model)
test/torch/quantization/fp8_quant/test_save_load.py:47
↓ 3 callersMethodcalibrate
Process the absorb layer and smooth layers, then return the channel-wise max value info. Args: absorb_to_layer (dict): A dicti
neural_compressor/torch/algorithms/smooth_quant/utility.py:929
↓ 3 callersMethodcall
Default call before add_variables is invoked. Should not be reached after setup.
neural_compressor/jax/quantization/layers_dynamic.py:129
↓ 3 callersFunctioncfg_to_qconfig
Check configs and quantization configs. Args: user_cfg (dict): quantization configuration for ops. cfgs (dict): configs loade
neural_compressor/torch/algorithms/smooth_quant/utility.py:249
↓ 3 callersFunctioncheck_backend
Check if the current Keras backend is JAX and log a warning or error if not.
neural_compressor/jax/utils/utility.py:34
↓ 3 callersFunctioncollate_tf_preds
Collate the prediction results.
neural_compressor/tensorflow/quantization/utils/utility.py:209
↓ 3 callersMethodcommit_frame
(self, force=False)
neural_compressor/torch/algorithms/layer_wise/modified_pickle.py:235
↓ 3 callersMethodconvert
Converts a prepared model to a quantized model. Args: model (QuantizationInterceptionModule): the prepared model to be convert
neural_compressor/torch/algorithms/smooth_quant/smooth_quant.py:130
↓ 3 callersFunctionconvert_to_unicode
Converts `text` to Unicode (if it's not already), assuming utf-8 input.
examples/tensorflow/nlp/bert_large_squad_model_zoo/quantization/ptq/tokenization.py:81
↓ 3 callersMethodconvert_tokens_to_ids
(self, tokens)
examples/tensorflow/nlp/bert_large_squad_model_zoo/quantization/ptq/tokenization.py:181
↓ 3 callersMethodcount_batchnorm_relavant_ops
Return the count of FusedBatchNorm op and the count of primitive ops which may make up batchnorm computation in a given graph.
test/tensorflow/quantization/ptq/test_graph_fuse_decomposed_bn.py:17
↓ 3 callersMethodcreate_base_for_fuse_batchnorm
Create testing graph and compute the result from original graph. Args: pattern_match_mode: A label string to indicate which batchn
test/tensorflow/quantization/ptq/test_graph_fuse_decomposed_bn.py:30
↓ 3 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/quantize_graph_common.py:204
↓ 3 callersFunctiondequant_original_fp8_weight_if_needed
Dequantize FP8 weights using the module hook when required. Args: mod (torch.nn.Module): Module that may provide a dequantization callbac
neural_compressor/torch/algorithms/fp8_quant/_core/common.py:33
↓ 3 callersMethoddo_transformation
Fold all the sequences only consist of const and self.supported_op_type. Args: input_graph_def (graphdef): graphdef object
neural_compressor/tensorflow/quantization/utils/graph_rewriter/generic/fold_constant.py:161
↓ 3 callersFunctiondump_model_op_stats
This is a function to dump quantizable ops of model to user. Args: user_cfg (dict): quantization config. Returns: None
neural_compressor/torch/algorithms/smooth_quant/utility.py:274
↓ 3 callersMethodevaluate
(self, model)
examples/tensorflow/nlp/large_language_models/quantization/ptq/smoothquant/benchmark.py:44
↓ 3 callersMethodevaluation_end
Log the end of the evaluation process.
neural_compressor/common/utils/logger.py:212
↓ 3 callersMethodevaluation_start
Log the start of the evaluation process.
neural_compressor/common/utils/logger.py:207
↓ 3 callersMethodexecution_end
Log the end of the execution process.
neural_compressor/common/utils/logger.py:200
↓ 3 callersMethodexecution_start
Log the start of the execution process.
neural_compressor/common/utils/logger.py:193
↓ 3 callersFunctionexport_model_for_pt2e_quant
Exports a eager model for PT2E quantization. Args: model (torch.nn.Module): The PyTorch model to be exported. example_inputs (Tup
neural_compressor/torch/export/pt2e_export.py:34
↓ 3 callersMethodfatal
Output log with the fatal level.
neural_compressor/common/utils/logger.py:111
↓ 3 callersMethodfind_params
(self, x, weight=False)
neural_compressor/torch/algorithms/mixed_low_precision/custom_methods/gptq.py:77
↓ 3 callersMethodfrom_dict
Create a StaticQuantConfig from a dictionary. Args: config_dict (Dict): Configuration fields. Returns: Stati
neural_compressor/jax/quantization/config.py:321
↓ 3 callersMethodfrom_str
Get element format with str.
neural_compressor/torch/algorithms/mx_quant/utils.py:48
↓ 3 callersFunctionfuse_ln_linear
Fuse the linear operations in Layernorm into the adjacent linear blocks.
neural_compressor/torch/algorithms/mixed_low_precision/custom_methods/quarot.py:36
↓ 3 callersFunctiongenerate_scheme
To generate the scheme requested by vllm compatible config.
neural_compressor/torch/algorithms/fp8_quant/save_load.py:250
↓ 3 callersMethodget_all_config_cls_by_fwk_name
Get all registered configuration classes for a specific framework. Args: fwk_name (str): The framework name. Returns:
neural_compressor/common/base_config.py:153
↓ 3 callersFunctionget_all_config_set_from_config_registry
Retrieves all the configuration sets from the config registry for a given framework name. Args: fwk_name (str): The name of the framework
neural_compressor/common/base_config.py:837
↓ 3 callersMethodget_best_trial_record
Returns the best trial record based on the trial result. Raises: AssertionError: If there are no trial records in the tuning moni
neural_compressor/common/base_tuning.py:525
↓ 3 callersFunctionget_block_names
Get the block names for transformers-like networks. Args: model: The model. Returns: block_names: A list whose elements are list of
neural_compressor/torch/utils/utility.py:468
↓ 3 callersFunctionget_block_prefix
Get prefix and number of attention blocks of transformer models. Args: model (torch.nn.Module): input model Returns: block_p
neural_compressor/torch/utils/block_wise.py:35
↓ 3 callersFunctionget_call_wrapper
(cls_instance, func_name)
neural_compressor/torch/algorithms/fp8_quant/patched_module_base.py:36
↓ 3 callersMethodget_config
Serialize this class to a config dict.
neural_compressor/tensorflow/keras/layers/dense.py:155
↓ 3 callersMethodget_config
Serialize this class to a config dict.
neural_compressor/tensorflow/keras/layers/pool2d.py:105
↓ 3 callersFunctionget_dataloader
Generate a DataLoader for calibration using specified parameters. Args: tokenizer (Tokenizer): The tokenizer to use for tokenization.
neural_compressor/torch/algorithms/autoround/autoround.py:268
↓ 3 callersFunctionget_default_double_quant_config
Get the default configuration of double quant. Args: type (str, optional): double quant type. Defaults to "BNB_NF4". Returns:
neural_compressor/torch/quantization/config.py:305
↓ 3 callersFunctionget_default_static_quant_config
Generate the default static quant config. Returns: the default keras config.
neural_compressor/tensorflow/keras/quantization/config.py:155
↓ 3 callersFunctionget_enum_from_string
Convert a string to the corresponding enum value of enum_class. Raises ValueError if the string does not match any enum member.
neural_compressor/torch/algorithms/fp8_quant/_core/scale_methods/scale_method_parser.py:28
↓ 3 callersMethodget_extension
(self, code)
neural_compressor/torch/algorithms/layer_wise/modified_pickle.py:1599
↓ 3 callersMethodget_fresh_model
(self)
test/torch/quantization/fp8_quant/test_gptq_mixed_precision.py:87
↓ 3 callersMethodget_fuse_patterns
Get supported patterns by low precisions. Returns: [dictionary list]: A list composed of dictionary which key is precision
neural_compressor/tensorflow/algorithms/static_quant/tensorflow.py:1055
↓ 3 callersFunctionget_model_input_shape
Get the input shape of the input model.
neural_compressor/tensorflow/quantization/utils/utility.py:396
↓ 3 callersFunctionget_module
Get module from model by key name. Args: module (torch.nn.Module): original model key (str): module name to be replaced
neural_compressor/torch/utils/utility.py:366
↓ 3 callersMethodget_module_info
Only necessary for the newly registered patched module that doesn't in _mod_default_dict. Return the module info for the module, which is used
neural_compressor/torch/algorithms/fp8_quant/patched_module_base.py:188
↓ 3 callersMethodget_node_in_graph
(graph_module)
test/torch/quantization/test_pt2e_quant.py:263
↓ 3 callersMethodget_number_of_eval_functions
Returns the number of evaluation functions in the eval_fn_registry. Returns: int: The number of evaluation functions.
neural_compressor/common/base_tuning.py:124
↓ 3 callersMethodget_op_types
Get the supported op types by all precisions. Returns: [dictionary list]: A list composed of dictionary which key is precision
neural_compressor/tensorflow/algorithms/static_quant/tensorflow.py:1042
↓ 3 callersMethodget_optimized_model
Executed the non-precision dependent graph optimization. The input graph will be optimized with following passes: 1. Remove the train
neural_compressor/tensorflow/quantization/utils/graph_rewriter/generic/pre_optimize.py:108
↓ 3 callersFunctionget_orthogonal_matrix
(size, random=False)
neural_compressor/torch/algorithms/mixed_low_precision/custom_methods/quarot.py:87
↓ 3 callersMethodget_params_dict
Get a dictionary containing the parameters and their values for the current instance. Returns: A dictionary containing the parame
neural_compressor/common/base_config.py:337
↓ 3 callersMethodget_scale_funcs_dict
(self)
neural_compressor/torch/algorithms/fp8_quant/_core/scale_methods/scales_method.py:64
↓ 3 callersFunctionget_user_model
(empty_model=False)
examples/pytorch/nlp/huggingface_models/language-modeling/quantization/weight_only/run_clm_no_trainer.py:286
↓ 3 callersFunctionget_white_list
()
neural_compressor/torch/algorithms/fp8_quant/_core/patching_common.py:34
↓ 3 callersFunctionget_woq_linear_num
(model, woq_module_type_name)
test/torch/quantization/weight_only/test_rtn.py:77
↓ 3 callersFunctioninit_tuning
Initializes the tuning process. Args: tuning_config (TuningConfig): The configuration for the tuning process. Returns: Tuple
neural_compressor/common/base_tuning.py:568
↓ 3 callersMethodinitialize
(cls, device_quantized_func_wrapper_dict)
neural_compressor/torch/algorithms/fp8_quant/_core/quantized_func_wrappers/quantized_func_wrapper.py:72
↓ 3 callersFunctioninvert_scale
Inverts the scale of the input tensor, list of tensors, or tuple of tensors.
neural_compressor/torch/algorithms/fp8_quant/_core/fp_utils.py:226
↓ 3 callersFunctionis_device
(device_name)
test/torch/algorithms/fp8_quant/test_hpu_utils.py:27
↓ 3 callersFunctionis_supported_dynamic_op
Dynamically checks if the given op supports dynamic quantization by looking up its ModuleInfo and checking for a 'supports_dynamic_quantizati
neural_compressor/torch/algorithms/fp8_quant/_quant_common/quant_config.py:109
↓ 3 callersFunctionload
Load(f, map_location=None, pickle_module=pickle, *, weights_only=False, **pickle_load_args). Loads an object saved with :func:`torch.save` from a
neural_compressor/torch/algorithms/layer_wise/load.py:142
↓ 3 callersFunctionload_graph
This is a function to load TF graph from pb file Args: model_file (string): TF pb file local path Returns: graph: TF graph o
examples/tensorflow/recommendation/wide_deep_large_ds/quantization/ptq/main.py:45
↓ 3 callersMethodlp_matmul_hp
Perfoms a matmul with lp inputs and returns output in hp
neural_compressor/torch/algorithms/fp8_quant/_quant_common/helper_modules.py:420
↓ 3 callersFunctionmake_scale_method_config_and_expected
Constructs a scale_method config dict for fp8_config, with a default and an override section, and also returns the expected_configs dict for test
test/torch/algorithms/fp8_quant/unit_tests/test_scale_method_config.py:167
↓ 3 callersMethodmeasure
(self, x)
neural_compressor/torch/algorithms/fp8_quant/observer.py:47
↓ 3 callersFunctionmodel_forward
The model forward function.
neural_compressor/torch/algorithms/weight_only/utility.py:546
↓ 3 callersFunctionmove_input_device
Auto mapping input to device for all kinds of format. Args: input (torch.tensor): input data device (str, optional): target devic
neural_compressor/torch/utils/utility.py:661
↓ 3 callersFunctionneed_apply
Check whether to apply this algorithm according to configs_mapping. Args: configs_mapping (Dict[Tuple[str, callable], BaseConfig]): confi
neural_compressor/torch/quantization/quantize.py:55
↓ 3 callersMethodneed_stop
Check if need to stop tuning. Either accuracy goal is met, max trials is reached or timeout is reached. Returns: stop_flag: True
neural_compressor/common/base_tuning.py:550
← previousnext →401–500 of 4,695, ranked by callers