MCPcopy Create free account

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

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

↓ 3 callersFunctionnested_move_to_device
(v, device)
neural_compressor/torch/algorithms/mixed_low_precision/custom_methods/gptq.py:375
↓ 3 callersMethodpack_tensor_with_numpy
Pack the tensor with numpy.
neural_compressor/torch/algorithms/weight_only/modules.py:546
↓ 3 callersMethodpack_tensor_with_torch
Pack the tensor with torch. Args: raw_tensor (tensor): raw tensor. Returns: tensor: packed tensor.
neural_compressor/torch/algorithms/weight_only/modules.py:445
↓ 3 callersMethodparse_input_pb
Parse the input pbdef to get the node name and node mapping. Returns: the dict that key is node name while the value is nodeDef.
neural_compressor/tensorflow/quantization/utils/transform_graph/graph_transform_base.py:54
↓ 3 callersFunctionpatch_module
Replaces the module with patched module according to mod_dict. Args: mod (nn.module): The module that will be replaced with a patched mod
neural_compressor/torch/algorithms/fp8_quant/_core/quantize.py:39
↓ 3 callersMethodpost_all_reduce
(self, input)
neural_compressor/torch/algorithms/fp8_quant/_quant_common/helper_modules.py:355
↓ 3 callersMethodpost_init
Initialization for W4A8 usage.
neural_compressor/torch/algorithms/weight_only/modules.py:125
↓ 3 callersMethodprepare
Convert a dense-like layer instance for static quantization. Args: orig (keras.layers.Layer): Original layer instance.
neural_compressor/jax/quantization/layers_static.py:438
↓ 3 callersFunctionprocess_model_for_scalar_scale
(model)
neural_compressor/torch/algorithms/fp8_quant/save_load.py:748
↓ 3 callersFunctionprocess_scale_method_keys
(key)
neural_compressor/torch/algorithms/fp8_quant/_core/scale_methods/scale_method_parser.py:99
↓ 3 callersFunctionqdq_weight_actor
Quant and dequant tensor per channel. It is an in-place op. Args: weight : input weight bits (int, optional): bits. Defaults to 4
neural_compressor/torch/algorithms/weight_only/utility.py:247
↓ 3 callersMethodquantize
Quantizes a given float tensor using the specified tensor quantization configuration. Args: float_tensor (torch.Tensor): The floa
neural_compressor/torch/algorithms/weight_only/hqq/core.py:52
↓ 3 callersFunctionreconstruct_saved_model
Reconstruct a saved_model. Args: graph_def: The input graph_def. func: The concrete function get from the original saved_model.
neural_compressor/tensorflow/quantization/utils/utility.py:609
↓ 3 callersFunctionrecover_model_from_json
Recover ipex model from JSON file. Args: model (object): fp32 model need to do quantization. json_file_path (json): configura
neural_compressor/torch/algorithms/smooth_quant/save_load.py:27
↓ 3 callersMethodregister
Register a model to TFSlimNetsFactory. Args: name (str): name of a model. model_func (_type_): model that built from
neural_compressor/tensorflow/utils/utility.py:439
↓ 3 callersFunctionreshape_in_channel_to_last
Move the input channel to the last dimension. Args: layer_name (str): Layer name. Returns: Tensor: The reshaped weight
neural_compressor/torch/algorithms/smooth_quant/utility.py:782
↓ 3 callersMethodresolve_input
this code is copied from vllm RowParallelLinear forward method
neural_compressor/torch/algorithms/fp8_quant/_quant_common/helper_modules.py:398
↓ 3 callersFunctionrun_fn
(model, dataloader)
test/torch/quantization/test_autoround_cpu.py:46
↓ 3 callersFunctionrun_fn
(model)
test/torch/quantization/fp8_quant/test_gptq_mixed_precision.py:57
↓ 3 callersFunctionrun_scale_method_test
(fp8_config, expected_configs)
test/torch/algorithms/fp8_quant/unit_tests/test_scale_method_config.py:138
↓ 3 callersMethodsave_global
(self, obj, name=None)
neural_compressor/torch/algorithms/layer_wise/modified_pickle.py:1064
↓ 3 callersFunctionsave_measurements
(model, fname=None)
neural_compressor/torch/algorithms/fp8_quant/_core/save_measure/save_files.py:109
↓ 3 callersMethodscatter
(self, tensor)
neural_compressor/torch/algorithms/fp8_quant/_quant_common/helper_modules.py:466
↓ 3 callersMethodset_attr_bool
Set the node's attr which data type is bool.
neural_compressor/tensorflow/quantization/utils/quantize_graph_common.py:272
↓ 3 callersMethodset_attr_int
Set the node's attr which data type is int.
neural_compressor/tensorflow/quantization/utils/quantize_graph_common.py:277
↓ 3 callersMethodset_attr_string
Set the node's attr which data type is string.
neural_compressor/tensorflow/quantization/utils/quantize_graph_common.py:267
↓ 3 callersMethodset_baseline
Set the baseline value for auto-tune. Args: baseline (float): The baseline value to be set.
neural_compressor/common/base_tuning.py:512
↓ 3 callersFunctionsetup_quantization
( quantized_model, mode, lp_dtype, scale_method, device_type, scale_format, dynami
test/torch/algorithms/fp8_quant/tester.py:117
↓ 3 callersFunctionsplit_weights
Args: weight (torch.Tensor): weight tensor. tp_size (int): tensor parallel size. tp_rank (int): tensor parallel rank.
neural_compressor/torch/algorithms/fp8_quant/save_load.py:724
↓ 3 callersMethodto_dict
(self)
test/common/test_common.py:141
↓ 3 callersMethodto_json_string
Serializes this instance to a JSON string. Args: use_diff (bool, optional): If True, only the difference between the config insta
neural_compressor/common/base_config.py:408
↓ 3 callersMethodto_list_if_necessary
(param)
neural_compressor/torch/algorithms/fp8_quant/_core/quantized_func_wrappers/hpu/hpu_quantized_func_wrapper.py:101
↓ 3 callersFunctiontrain
Train function.
test/torch/quantization/weight_only/test_teq.py:24
↓ 3 callersMethodtrial_end
Log the end of a trial.
neural_compressor/common/utils/logger.py:217
↓ 3 callersMethodtrial_start
Log the start of a trial.
neural_compressor/common/utils/logger.py:188
↓ 3 callersMethodtuning_end
Log the end of the tuning process.
neural_compressor/common/utils/logger.py:222
↓ 3 callersMethodtuning_start
Log the start of the tuning process.
neural_compressor/common/utils/logger.py:183
↓ 3 callersMethodunpack_tensor
Unpack tensor.
neural_compressor/torch/algorithms/weight_only/modules.py:587
↓ 3 callersMethodupdate
Add the predictions and labels. Args: predicts: The predictions. labels: The labels corresponding to the predictions.
examples/tensorflow/object_detection/mask_rcnn_inception_v2/quantization/ptq/data_process.py:419
↓ 3 callersMethodupdate
Add the predictions and labels. Args: predicts: The predictions. labels: The labels corresponding to the predictions.
examples/tensorflow/object_detection/faster_rcnn_resnet50/quantization/ptq/data_process.py:307
↓ 3 callersMethodupdate
Add the predictions and labels. Args: predicts: The predictions. labels: The labels corresponding to the predictions.
examples/tensorflow/object_detection/ssd_mobilenet_v1/quantization/ptq/data_process.py:307
↓ 3 callersFunctionvalidate
(val_loader, model, criterion, args)
examples/pytorch/cv/fp8_quant/main.py:272
↓ 3 callersFunctionvalidate
(val_loader, model, criterion, args)
examples/pytorch/cv/mixed_precision/main.py:240
↓ 3 callersFunctionvalidate
(val_loader, model, criterion, args)
examples/pytorch/cv/static_quant/main.py:322
↓ 3 callersMethodweight_pack
Pack weight and scale when saving.
neural_compressor/torch/algorithms/qat/tensor_quantizer.py:151
↓ 3 callersFunctionwhitespace_tokenize
Runs basic whitespace cleaning and splitting on a piece of text.
examples/tensorflow/nlp/bert_large_squad_model_zoo/quantization/ptq/tokenization.py:155
↓ 2 callersFunction_ConvertBoxToCOCOFormat
Convert a box in [ymin, xmin, ymax, xmax] format to COCO format. This is a utility function for converting from our internal [ymin, xmin, yma
examples/tensorflow/object_detection/mask_rcnn_inception_v2/quantization/ptq/coco_tools.py:463
↓ 2 callersFunction_ConvertBoxToCOCOFormat
Convert a box in [ymin, xmin, ymax, xmax] format to COCO format. This is a utility function for converting from our internal [ymin, xmin, yma
examples/tensorflow/object_detection/faster_rcnn_resnet50/quantization/ptq/coco_tools.py:463
↓ 2 callersFunction_ConvertBoxToCOCOFormat
Convert a box in [ymin, xmin, ymax, xmax] format to COCO format. This is a utility function for converting from our internal [ymin, xmin, yma
examples/tensorflow/object_detection/ssd_mobilenet_v1/quantization/ptq/coco_tools.py:463
↓ 2 callersFunction_RleCompress
Compresses mask using Run-length encoding provided by pycocotools. Args: masks: uint8 numpy array of shape [mask_height, mask_width] with v
examples/tensorflow/object_detection/mask_rcnn_inception_v2/quantization/ptq/coco_tools.py:479
↓ 2 callersFunction_RleCompress
Compresses mask using Run-length encoding provided by pycocotools. Args: masks: uint8 numpy array of shape [mask_height, mask_width] with v
examples/tensorflow/object_detection/faster_rcnn_resnet50/quantization/ptq/coco_tools.py:479
↓ 2 callersFunction_RleCompress
Compresses mask using Run-length encoding provided by pycocotools. Args: masks: uint8 numpy array of shape [mask_height, mask_width] with v
examples/tensorflow/object_detection/ssd_mobilenet_v1/quantization/ptq/coco_tools.py:479
↓ 2 callersMethod__init__
(self)
test/torch/quantization/test_pt2e_quant.py:45
↓ 2 callersMethod__init__
(self, dim=16)
test/torch/algorithms/fp8_quant_xpu/unit_tests/test_xpu_basic.py:37
↓ 2 callersMethod__init__
(self)
test/torch/algorithms/fp8_quant/unit_tests/test_deepspeed.py:23
↓ 2 callersMethod__init__
(self)
test/common/test_common.py:77
↓ 2 callersMethod__init__
(self, layer)
neural_compressor/torch/algorithms/mixed_low_precision/custom_methods/gptq.py:184
↓ 2 callersMethod__init__
Init GPTQ.
neural_compressor/torch/algorithms/weight_only/gptq.py:1095
↓ 2 callersMethod__init__
Initialize a BaseModel. Args: model (object): raw model format. For Tensorflow model, could be path to frozen pb file,
neural_compressor/tensorflow/utils/model_wrappers.py:792
↓ 2 callersMethod__len__
(self)
examples/pytorch/diffusion_model/diffusers/framepack/main.py:91
↓ 2 callersMethod__repr__
Return the string representation of the QTensor object.
neural_compressor/torch/algorithms/weight_only/hqq/qtensor.py:113
↓ 2 callersMethod_adjust_activation
Insert the Mul node after the activation before the weight node. Args: scale: smooth scale with the shape (ic,) input
neural_compressor/tensorflow/algorithms/smoother/scaler.py:51
↓ 2 callersFunction_apply_pre_optimization
Retrieves sq info to absorb the scale to the layer at output channel. Args: model (QuantizationInterceptionModule): a prepared model.
neural_compressor/torch/algorithms/smooth_quant/smooth_quant.py:346
↓ 2 callersMethod_batch_appends
(self, items)
neural_compressor/torch/algorithms/layer_wise/modified_pickle.py:944
↓ 2 callersFunction_batch_generator
( data_filename, data_directory, days, batch_size, split, drop_last, max_ind_range )
examples/pytorch/recommendation/dlrm/static_quant/ipex/data_loader_terabyte.py:91
↓ 2 callersMethod_batch_setitems
(self, items)
neural_compressor/torch/algorithms/layer_wise/modified_pickle.py:984
↓ 2 callersMethod_build_woq_model
Build weight-only quantization model.
neural_compressor/torch/algorithms/weight_only/save_load.py:420
↓ 2 callersFunction_calculate_fan_in_and_fan_out
(shape)
examples/pytorch/recommendation/dlrm_v2/fp8_quant/cpu/dlrm_model.py:28
↓ 2 callersMethod_compute_batch_min_max
Compute batch min/max from inputs, respecting mask. Args: inputs (jnp.ndarray): Input tensor. mask (Optional[jnp.ndar
neural_compressor/jax/quantization/layers_dynamic.py:149
↓ 2 callersFunction_create_evaluator_for_eval_fns
(eval_fns: Optional[Union[Callable, Dict, List[Dict]]] = None)
test/torch/test_autotune.py:47
↓ 2 callersMethod_create_new_const_node
Create new Const node.
neural_compressor/tensorflow/quantization/utils/graph_rewriter/int8/scale_propagation.py:53
↓ 2 callersFunction_dtype_min_max
Return (min, max) representable values for dtype, cast to out_dtype.
test/jax/jax_test_utility.py:16
↓ 2 callersMethod_dump_model_op_stats
Dump the whole model's OPs statistics information for analysis.
neural_compressor/tensorflow/algorithms/static_quant/tensorflow.py:292
↓ 2 callersFunction_escape_token
r"""Replace characters that aren't in the alphabet and append "_" to token. Apply three transformations to the token: 1. Replace underline char
examples/tensorflow/nlp/transformer_lt/quantization/ptq/utils/tokenizer.py:251
↓ 2 callersFunction_feature_for_efid
(img_bgr: np.ndarray)
examples/pytorch/diffusion_model/diffusers/wan/evaluate_manifest_no_gt.py:251
↓ 2 callersMethod_find_relu_node
Find Relu node algorithm to identify the positive input.
neural_compressor/tensorflow/quantization/utils/graph_rewriter/qdq/insert_qdq_pattern.py:226
↓ 2 callersMethod_freeze_requantization_ranges
Freeze requantization ranges after doing quantization.
neural_compressor/tensorflow/quantization/utils/graph_converter.py:748
↓ 2 callersMethod_from_single_config
Expand a single config into a list of configs. Args: config (BaseConfig): Configuration to expand. Returns:
neural_compressor/common/base_tuning.py:219
↓ 2 callersFunction_generate_alphabet_dict
Create set of characters that appear in any element in the iterable.
examples/tensorflow/nlp/transformer_lt/quantization/ptq/utils/tokenizer.py:442
↓ 2 callersMethod_generate_calibration_data
Generate the calibration data.
neural_compressor/tensorflow/quantization/utils/graph_converter.py:712
↓ 2 callersMethod_generate_sampler
Create a sampler based on dataset capabilities. Args: dataset: Dataset object to inspect. distributed (bool): Whether
neural_compressor/tensorflow/utils/data.py:369
↓ 2 callersFunction_generate_subtokens
Create a list of subtokens in decreasing order of frequency. Args: token_counts: dict mapping str tokens -> int count alphabet: set of char
examples/tensorflow/nlp/transformer_lt/quantization/ptq/utils/tokenizer.py:578
↓ 2 callersMethod_get_add_time_ids
( self, original_size, crops_coords_top_left, target_size, dtype, text_encoder_projection_dim=None
examples/pytorch/diffusion_model/diffusers/stable_diffusion/smooth_quant/sdxl_smooth_quant.py:38
↓ 2 callersMethod_get_add_time_ids
( self, original_size, crops_coords_top_left, target_size, dtype, text_encoder_projection_dim=None
examples/pytorch/diffusion_model/diffusers/stable_diffusion/smooth_quant/main.py:26
↓ 2 callersMethod_get_all_hook_module_names
Obtain all the modules that could be hooked based on given op_types.
neural_compressor/torch/algorithms/smooth_quant/utility.py:1368
↓ 2 callersMethod_get_all_layer_names
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:2478
↓ 2 callersMethod_get_best_indexes
Get the n-best logits from a list.
examples/tensorflow/nlp/bert_large_squad_model_zoo/quantization/ptq/data_process.py:716
↓ 2 callersMethod_get_example_input
Retrieve an example input from the dataloader or return the pre-stored example inputs. Returns: Union[torch.Tensor, None]: The
neural_compressor/torch/algorithms/smooth_quant/utility.py:2495
↓ 2 callersFunction_get_format_params
Get parameters of the format. Allowed formats: - intX: 2 <= X <= 32, assume sign-magnitude, 1.xxx representation - floatX/fpX:
neural_compressor/torch/algorithms/mx_quant/utils.py:126
↓ 2 callersMethod_get_fp32_print_node_names
Get the print node name of the fp32 graph.
neural_compressor/tensorflow/quantization/utils/graph_converter.py:511
↓ 2 callersFunction_get_graph_from_saved_model_v2
The version 2 function that get graph from the original keras model. Args: saved_model_dir (string): model path of a temporary saved_mode
neural_compressor/tensorflow/utils/model_wrappers.py:364
↓ 2 callersFunction_get_graph_from_saved_model_v3
The version 3 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:337
↓ 2 callersFunction_get_log_msg
Map a Mode enum value to a human-readable log message. Args: mode (Mode): Execution mode enum. Returns: str | None: Log mess
neural_compressor/common/utils/logger.py:153
↓ 2 callersFunction_get_max_norm
Valid only for floats that define NaN.
neural_compressor/torch/algorithms/mx_quant/utils.py:116
↓ 2 callersMethod_get_maxval_per_channel
Get the max values per input channel. Args: tensor_data: The input tensors percentile: The percentile of calibration
neural_compressor/tensorflow/algorithms/smoother/calibration.py:185
↓ 2 callersFunction_get_min_norm
Valid for all float formats.
neural_compressor/torch/algorithms/mx_quant/utils.py:110
↓ 2 callersFunction_get_ngrams
Calculates n-grams. Args: n: which n-grams to calculate text: An array of tokens Returns: A set of n-grams
examples/tensorflow/nlp/transformer_lt/quantization/ptq/utils/metrics.py:315
↓ 2 callersFunction_get_ngrams_with_counter
Extracts all n-grams up to a given maximum order from an input segment. Args: segment: text segment from which n-grams will be extracted. m
examples/tensorflow/nlp/transformer_lt/quantization/ptq/utils/metrics.py:210
↓ 2 callersMethod_get_op_name_op_type_config
(self)
neural_compressor/torch/quantization/config.py:92
↓ 2 callersMethod_get_op_name_op_type_config
Split local configs into op-type and op-name mappings. Returns: tuple[dict, dict]: Mapping of op types to configs and op names to
neural_compressor/common/base_config.py:569
← previousnext →501–600 of 4,695, ranked by callers