MCPcopy Create free account

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

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

↓ 2 callersFunctionevaluate
( model, # model.pt path(s) source=args.dataset_location, imgsz=640, # inference size (pixels)
examples/tensorflow/object_detection/yolo_v5/quantization/ptq/main.py:99
↓ 2 callersFunctionevaluate
Custom evaluate function to estimate the accuracy of the model. Args: model (tf.Graph or string or INC.model.TensorflowCheckpointModel):
examples/tensorflow/object_detection/ssd_mobilenet_v1/quantization/ptq/main.py:52
↓ 2 callersFunctionevaluate
Custom evaluate function to estimate the accuracy of the model. Args: model (tf.Graph_def): The input model graph Returns:
examples/tensorflow/graph_networks/graphsage/quantization/ptq/main.py:104
↓ 2 callersFunctionevaluate
Evaluate function that inference the model to apply calibration or benchmarking. Args: model (tf.python.trackable.autotrackable): The mod
examples/tensorflow/nlp/large_language_models/quantization/ptq/gpt-j/main.py:263
↓ 2 callersFunctionevaluate
Custom evaluate function to inference the model for specified metric on validation dataset. Args: model (tf.keras.Model): The input m
examples/tensorflow/keras/image_recognition/resnet_v2_50/quantization/ptq/main.py:76
↓ 2 callersFunctionevaluate
Custom evaluate function to inference the model for specified metric on validation dataset. Args: model (tf.keras.Model): The input
examples/tensorflow/keras/image_recognition/inception_v3/quantization/ptq/main.py:76
↓ 2 callersFunctionevaluation_func
(model, measurer=None)
examples/tensorflow/recommendation/wide_deep_large_ds/quantization/ptq/main.py:113
↓ 2 callersMethodfasterquant
Run quantization. Args: W (tensor): weight tensor. block_size (int): Execute quantization per block, block shape = [C
neural_compressor/torch/algorithms/weight_only/gptq.py:1143
↓ 2 callersFunctionfeat
(img)
examples/pytorch/diffusion_model/diffusers/wan/evaluate_manifest_no_gt.py:234
↓ 2 callersFunctionfetch_batch
(dataloader)
examples/pytorch/recommendation/dlrm_v2/fp8_quant/cpu/main.py:50
↓ 2 callersMethodfetch_cache_and_scales
(self, cache, blocks, scales=None)
neural_compressor/torch/algorithms/fp8_quant/_quant_common/helper_modules.py:1268
↓ 2 callersFunctionfind_safetensors_files
Get safetensors file list.
neural_compressor/torch/algorithms/fp8_quant/save_load.py:490
↓ 2 callersFunctionfinish_measurements
(model)
neural_compressor/torch/algorithms/fp8_quant/prepare_quant/prepare_model.py:76
↓ 2 callersMethodforward_impl
(self, qinput, scale_input, qother, scale_other, out=None)
neural_compressor/torch/algorithms/fp8_quant/_quant_common/helper_modules.py:131
↓ 2 callersFunctionforward_wrapper
The forward wrapper.
neural_compressor/torch/algorithms/weight_only/utility.py:566
↓ 2 callersMethodfree
Free memory.
neural_compressor/torch/algorithms/weight_only/gptq.py:1353
↓ 2 callersMethodfrom_fwk_configs
Create a ConfigSet object from a single config or a list of configs. Args: fwk_configs: A single config or a list of configs.
neural_compressor/common/base_tuning.py:272
↓ 2 callersMethodgather_single_batch_from_dict
Gather single batch from a dict. Args: data_dict (dict): data dict. idx (int): index Returns: di
neural_compressor/torch/algorithms/weight_only/gptq.py:484
↓ 2 callersMethodgather_single_batch_from_list
Gather single batch from a list. Args: data_dict (dict): data list. idx (int): index Returns: li
neural_compressor/torch/algorithms/weight_only/gptq.py:500
↓ 2 callersMethodgen_valid_sampling_log
Generate the valid sampling log. Args: log_path: the valid sampling log file path. Returns: the sampling min max
neural_compressor/tensorflow/quantization/utils/graph_util.py:1019
↓ 2 callersFunctiongenerate_activation_observer
This is a helper method to generate an activation observer. Args: scheme (str): Quantization scheme to be used. algorithm (st
neural_compressor/torch/algorithms/static_quant/utility.py:227
↓ 2 callersMethodgenerate_int32_bias_for_conv
Static method that generate int32 bias for conv op. Args: bias_tensor: bias node tensor. channel_size: channel size.
neural_compressor/tensorflow/quantization/utils/graph_util.py:893
↓ 2 callersMethodgenerate_int32_bias_for_matmul_per_channel
Static method that generate per-channel int32 bias for matmul op. Args: bias_tensor: bias node tensor. weights_tensor
neural_compressor/tensorflow/quantization/utils/graph_util.py:979
↓ 2 callersMethodgenerate_internal_patterns
Translate the patterns defined in the yaml to internal pattern expression.
neural_compressor/tensorflow/algorithms/static_quant/tensorflow.py:1416
↓ 2 callersFunctiongenerate_model_info
(model)
neural_compressor/torch/algorithms/fp8_quant/_core/patching_common.py:47
↓ 2 callersMethodget_absorb_to_layer
Get absorbed layers of a model. Args: model: torch model example_input: used to trace torch model. op_typ
neural_compressor/torch/algorithms/weight_only/utility.py:917
↓ 2 callersFunctionget_accuracy
(model_name_or_path, tokenizer=None, eval_tasks="mmlu", limit=None)
examples/pytorch/nlp/huggingface_models/language-modeling/quantization/auto_round/llama3/quantize.py:70
↓ 2 callersMethodget_all_configs
Get all registered configurations. Returns: Dict[str, Dict[str, Dict[str, object]]]: A dictionary containing all registered confi
neural_compressor/common/base_config.py:115
↓ 2 callersFunctionget_args
()
examples/tensorflow/semantic_image_segmentation/3dunet-mlperf/quantization/ptq/main.py:47
↓ 2 callersMethodget_calibrated_range
Return the calibrated min/max range as a tensor. Returns: jnp.ndarray: Tensor containing min and max values.
neural_compressor/jax/quantization/layers_static.py:139
↓ 2 callersMethodget_config_set_for_tuning
(cls)
test/common/test_common.py:157
↓ 2 callersFunctionget_daring_anteater
( tokenizer: transformers.AutoTokenizer, split="train", max_length=4096, train_size=0, eva
examples/pytorch/nlp/huggingface_models/language-modeling/quantization/llm_qat/utils.py:47
↓ 2 callersFunctionget_dataloader
Gets desired dataloader from dlrm_main command line options. Currently, this function is able to return either a DataLoader wrapped around a
examples/pytorch/recommendation/dlrm_v2/fp8_quant/cpu/data_process/dlrm_dataloader.py:139
↓ 2 callersFunctionget_default_AutoRound_config
Get the default configuration of AutoRound. Args: processor_type (Optional[Union[str, torch_utils.ProcessorType]], optional): The user-sp
neural_compressor/torch/quantization/config.py:1118
↓ 2 callersFunctionget_default_awq_config
Generate the default awq config. Returns: the default awq config.
neural_compressor/torch/quantization/config.py:674
↓ 2 callersFunctionget_default_hqq_config
Generate the default HQQ config. Returns: the default HQQ config.
neural_compressor/torch/quantization/config.py:1730
↓ 2 callersMethodget_default_quantized_func
(self)
neural_compressor/torch/algorithms/fp8_quant/_core/quantized_func_wrappers/xpu/xpu_quantized_func_wrapper.py:68
↓ 2 callersFunctionget_dict_at_depth
Get all sub-dicts that are at a specified depth in a nested dict.
neural_compressor/torch/algorithms/static_quant/utility.py:494
↓ 2 callersFunctionget_double_quant_config_dict
Query config dict of double_quant according to double_quant_type. Args: double_quant_type (str, optional): double_quant type. Defaults to
neural_compressor/torch/utils/utility.py:149
↓ 2 callersFunctionget_example_inputs
(model, dataloader)
examples/pytorch/image_recognition/torchvision_models/quantization/static_quant/ipex/utils.py:6
↓ 2 callersFunctionget_external_row_parallel_collective_func
Return the row-parallel all-reduce collective from external runtime. Returns: Callable: The tensor-model-parallel all-reduce function.
neural_compressor/torch/algorithms/fp8_quant/_core/external_func_impl.py:47
↓ 2 callersFunctionget_fp8_hw_alligned_scales_by_device
(dtype, device)
neural_compressor/torch/algorithms/fp8_quant/_core/fp_utils.py:125
↓ 2 callersFunctionget_gpt_j
()
test/torch/test_autotune.py:83
↓ 2 callersFunctionget_inc_fp8config
Get INC FP8 Config. Args: model: empty model. from_neuralmagic(bool, optional): whether provided from nerualmagic modelhub.
neural_compressor/torch/algorithms/fp8_quant/save_load.py:566
↓ 2 callersMethodget_installed_neural_compressor_version
(cls)
neural_compressor/jax/quantization/saving.py:78
↓ 2 callersFunctionget_internal_config
( *, mode: QuantMode, scale_method: ScaleMethodString, lp_dtype: torch.dtype, device_type:
test/torch/algorithms/fp8_quant/tester.py:339
↓ 2 callersFunctionget_kron_hadamard
(size)
neural_compressor/torch/algorithms/mixed_low_precision/custom_methods/quarot.py:98
↓ 2 callersFunctionget_layer_names_in_block
Retrieves the names of layers within each block of the model. Returns: list: A list of strings, where each string is the name of a layer
neural_compressor/torch/utils/utility.py:379
↓ 2 callersMethodget_matched_nodes
Search the matched nodes with the specified patterns. Args: patterns ([string list]): The patterns should be illustrated as below
neural_compressor/tensorflow/quantization/utils/graph_rewriter/generic/pre_optimize.py:281
↓ 2 callersMethodget_mixed_precision_combination
Get the valid mixed precisions. Returns: [string list]: valid precision list.
neural_compressor/tensorflow/algorithms/static_quant/tensorflow.py:1364
↓ 2 callersFunctionget_mod_extra_config_dict
(model)
neural_compressor/torch/algorithms/fp8_quant/_core/save_measure/save_files.py:29
↓ 2 callersMethodget_model_info
Get concrete node names for supported operators. Args: model (keras.Model): Keras model to inspect. Returns:
neural_compressor/jax/quantization/config.py:275
↓ 2 callersFunctionget_model_param_buffers
(model)
test/torch/quantization/fp8_quant/test_save_load.py:15
↓ 2 callersFunctionget_model_param_buffers
(model)
test/torch/algorithms/fp8_quant_cpu/unit_tests/test_cpu_save_load.py:33
↓ 2 callersFunctionget_model_param_buffers
(model)
test/torch/algorithms/fp8_quant/unit_tests/test_save_load.py:18
↓ 2 callersMethodget_module_type
(cls)
test/torch/algorithms/fp8_quant/test_register_apis.py:73
↓ 2 callersMethodget_module_type
Only necessary for the newly registered patched module that doesn't in _mod_default_dict. Return the module type for the module, which is used
neural_compressor/torch/algorithms/fp8_quant/patched_module_base.py:206
↓ 2 callersFunctionget_named_children
Get all the name and children of given model.
neural_compressor/torch/algorithms/layer_wise/utils.py:88
↓ 2 callersFunctionget_new_rank_state_dict
Get new rank state_dict for world_size. Args: all_rank_state_dict (dict): {0: state_dict, 1: state_dict, ...} for all ranks. mode
neural_compressor/torch/algorithms/fp8_quant/save_load.py:791
↓ 2 callersFunctionget_non_persistent_buffers
Get all non-persistent buffers in the model. Args: model (torch.nn.Module): PyTorch model Returns: dict: A dictionary contai
neural_compressor/torch/utils/utility.py:629
↓ 2 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/keras.py:628
↓ 2 callersMethodget_output_config
(self)
neural_compressor/torch/algorithms/fp8_quant/_core/scale_methods/ops_quantizer.py:171
↓ 2 callersMethodget_pack_fn
Get the pack function for the specified number of bits. Args: nbits (int): The number of bits. Returns: func
neural_compressor/torch/algorithms/weight_only/hqq/bitpack.py:205
↓ 2 callersMethodget_params_dict
Get a dictionary containing the parameters and their values for the current instance. Returns: A dictionary containing the parame
neural_compressor/torch/quantization/config.py:1044
↓ 2 callersFunctionget_parent
Get the parent node(s) of a given node. Args: node (Node): The node whose parent(s) are to be retrieved. all_parents (bool, o
neural_compressor/torch/algorithms/smooth_quant/utility.py:328
↓ 2 callersFunctionget_parent
Get parent of node.
neural_compressor/torch/algorithms/weight_only/utility.py:691
↓ 2 callersFunctionget_patched_mod_list
()
neural_compressor/torch/algorithms/fp8_quant/common.py:67
↓ 2 callersMethodget_postprocess_result
Get the post processed results.
examples/tensorflow/nlp/bert_large_squad_model_zoo/quantization/ptq/data_process.py:577
↓ 2 callersMethodget_prepared_dataloader
(self)
examples/pytorch/nlp/huggingface_models/language-modeling/quantization/weight_only/utils.py:17
↓ 2 callersFunctionget_quantizable_ops_from_cfgs
Get quantizable ops from configs, combine fused ops as one op. Args: ops_name (list): list of op names. op_infos_from_cfgs (d
neural_compressor/torch/algorithms/static_quant/utility.py:572
↓ 2 callersFunctionget_quantizable_ops_recursively
Get all quantizable ops from model. Args: model (object): input model example_inputs (dict|list|tuple|torch.Tensor): used to
neural_compressor/torch/algorithms/smooth_quant/utility.py:45
↓ 2 callersFunctionget_rank_state_dict
(state_dict, local_rank, world_size)
neural_compressor/torch/algorithms/fp8_quant/save_load.py:525
↓ 2 callersMethodget_scalar_quantized_func
(self)
neural_compressor/torch/algorithms/fp8_quant/_core/quantized_func_wrappers/hpu/hpu_quantized_func_wrapper.py:45
↓ 2 callersFunctionget_scale
Compute the quantization scale for a weight tensor. Args: orig_weight (jnp.ndarray): Weight tensor to analyze. dtype (jnp.dtype):
neural_compressor/jax/utils/utility.py:219
↓ 2 callersMethodget_sorted_accelerators
Get registered accelerators sorted by priority.
neural_compressor/torch/utils/auto_accelerator.py:83
↓ 2 callersFunctionget_test_vectors
(*, dtype: torch.dtype, N: int, D_in: int, atol: float = 0.02, rtol: float = 0.01)
test/torch/algorithms/fp8_quant/unit_tests/test_layers/test_linear.py:17
↓ 2 callersFunctionget_test_vectors
(*, dtype: torch.dtype, atol)
test/torch/algorithms/fp8_quant/unit_tests/test_layers/test_matmul.py:13
↓ 2 callersMethodget_unpack_fn
Get the unpack function for the specified number of bits. Args: nbits (int): The number of bits. Returns: fu
neural_compressor/torch/algorithms/weight_only/hqq/bitpack.py:217
↓ 2 callersFunctionget_user_model
()
examples/pytorch/nlp/huggingface_models/language-modeling/quantization/smooth_quant/run_clm_no_trainer.py:130
↓ 2 callersFunctionget_user_model
()
examples/pytorch/nlp/huggingface_models/language-modeling/quantization/static_quant/ipex/run_clm_no_trainer.py:133
↓ 2 callersFunctionget_woq_tuning_config
Generate the config set for WOQ tuning. Returns: the list of WOQ quant config.
neural_compressor/torch/quantization/config.py:2047
↓ 2 callersMethodincremental_node_val_feed_dict
(self, size, iter_num, test=False)
examples/tensorflow/graph_networks/graphsage/quantization/ptq/utils.py:102
↓ 2 callersFunctioninit_conv
(instance, mod_extra_config)
neural_compressor/torch/algorithms/fp8_quant/_quant_common/helper_modules.py:1360
↓ 2 callersMethodinit_linear
(self, mod_extra_config)
neural_compressor/torch/algorithms/fp8_quant/_quant_common/helper_modules.py:175
↓ 2 callersFunctioninit_model
(world_size)
test/torch/quantization/fp8_quant/test_save_load.py:110
↓ 2 callersFunctioninput_fn
Generate an input function for the Estimator.
examples/tensorflow/recommendation/wide_deep_large_ds/quantization/ptq/main.py:87
↓ 2 callersMethodinteract_features
(self, x, ly)
examples/pytorch/recommendation/dlrm/static_quant/ipex/dlrm_s_pytorch.py:293
↓ 2 callersFunctioninvert
(x)
neural_compressor/torch/algorithms/fp8_quant/_core/fp_utils.py:228
↓ 2 callersMethodinvert_perm
Compute the inverse of a permutation vector. Args: perm (Tensor): A 1D tensor containing a permutation of indices. Retur
neural_compressor/torch/algorithms/weight_only/gptq.py:1463
↓ 2 callersMethodinvert_scales
(scale=None)
neural_compressor/torch/algorithms/fp8_quant/_core/scale_methods/scales_method.py:49
↓ 2 callersFunctionis_calc_scale_with_cguid
Check whether scale calculation uses cguid logic. Returns: bool: True when cguid-based scale calculation is enabled.
neural_compressor/torch/algorithms/fp8_quant/_core/common.py:353
↓ 2 callersMethodis_calibrated
Check if the observer has valid calibration data. Returns: bool: True if calibrated, False if min (and internally max) are still
neural_compressor/jax/quantization/layers_static.py:147
↓ 2 callersFunctionis_ckpt_format
Check the model_path format is ckpt or not. Args: model_path (string): the model folder path Returns: string: return the ckp
neural_compressor/tensorflow/quantization/utils/utility.py:78
↓ 2 callersFunctionis_gaudi3
()
test/torch/algorithms/fp8_quant/test_hpu_utils.py:39
↓ 2 callersFunctionis_habana_framework_installed
Check if Habana framework is installed. Only check for the habana_frameworks package without importing it to avoid initializing lazy-mode-rel
test/torch/quantization/test_autoround_hpu.py:13
↓ 2 callersFunctionis_hpu_available
Returns whether hpex is available.
neural_compressor/torch/utils/environ.py:78
↓ 2 callersFunctionis_leaf
Judge whether a module has no child-modules. Args: module: torch.nn.Module Returns: a bool: whether a module has no child-mo
neural_compressor/torch/algorithms/weight_only/gptq.py:53
↓ 2 callersFunctionis_xpu_available
()
test/torch/quantization/test_autoround_xpu.py:8
↓ 2 callersFunctionitex_installed
Check if the Intel® Extension for TensorFlow has been installed.
neural_compressor/tensorflow/utils/utility.py:108
↓ 2 callersMethodload_batch
(self, sample_list=None)
examples/pytorch/recommendation/dlrm_v2/fp8_quant/cpu/data_process/multi_hot_criteo.py:331
← previousnext →701–800 of 4,695, ranked by callers