MCPcopy Create free account

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

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

↓ 2 callersFunction_get_path
(pretrained_model_name_or_path)
neural_compressor/torch/algorithms/layer_wise/utils.py:188
↓ 2 callersFunction_get_test_only_config
Should NOT be used externally. Return a new config used only for the tests.
test/torch/algorithms/fp8_quant/tester.py:305
↓ 2 callersMethod_get_valid_log
Get valid sampling log. :return: get the valid sampling log output.
neural_compressor/tensorflow/quantization/utils/graph_rewriter/int8/freeze_value.py:68
↓ 2 callersMethod_ignore_insert_qdq_pattern
For some cases we don't need to insert QDQ patterns.
neural_compressor/tensorflow/quantization/utils/graph_rewriter/qdq/insert_qdq_pattern.py:731
↓ 2 callersMethod_insert_qdq_pattern_for_each_input
Takes one float input to an op, and converts it to quantized form.
neural_compressor/tensorflow/quantization/utils/graph_rewriter/qdq/insert_qdq_pattern.py:362
↓ 2 callersMethod_instantiate
(self, klass, args)
neural_compressor/torch/algorithms/layer_wise/modified_pickle.py:1521
↓ 2 callersMethod_is_match_conv
Detect the rule matched nodes collections. Returns: [List] -- [the matched rule] [String] -- [the list contains the m
neural_compressor/tensorflow/quantization/utils/quantize_graph/qdq/fuse_qdq_conv.py:1915
↓ 2 callersMethod_is_match_deconv
Detect the rule matched nodes collections. Returns: [List] -- [the matched rule] [String] -- [the list contains the m
neural_compressor/tensorflow/quantization/utils/quantize_graph/qdq/fuse_qdq_deconv.py:467
↓ 2 callersMethod_is_match_matmul
Detect the rule matched nodes collections. Returns: [List] -- [the matched rule] [String] -- [the list contains the m
neural_compressor/tensorflow/quantization/utils/quantize_graph/qdq/fuse_qdq_matmul.py:927
↓ 2 callersMethod_is_op_type
Check whether the identifier represents an operator type. Args: name (str): Operator identifier. Returns: bo
neural_compressor/common/base_config.py:636
↓ 2 callersFunction_list_to_index_dict
Create dictionary mapping list items to their indices in the list.
examples/tensorflow/nlp/transformer_lt/quantization/ptq/utils/tokenizer.py:370
↓ 2 callersMethod_log
Setup the logger format and handler.
neural_compressor/common/utils/logger.py:62
↓ 2 callersFunction_make_test_inputs
Create representative test inputs.
test/jax/test_qdq_split.py:33
↓ 2 callersFunction_matmul
Matrix multiply matching JAX's accumulation behavior. JAX accumulates bfloat16 matmul in float32 and casts the result back to bfloat16. Repli
test/jax/jax_test_utility.py:22
↓ 2 callersMethod_model_call
:param inps: torch.Tensor A torch tensor of shape [batch, (sequence_ctx + sequence_cont)] or of shape [batch, sequenc
neural_compressor/evaluation/lm_eval/models/huggingface.py:893
↓ 2 callersMethod_op_type_to_str
Convert an operator type to a string key. Args: op_type (Callable): Operator type or callable object. Returns:
neural_compressor/common/base_config.py:620
↓ 2 callersFunction_parse_ckpt_bn_input
Parse ckpt batch norm inputs to match correct moving mean and variance. Args: graph_def (graph_def): original graph_def Returns:
neural_compressor/tensorflow/quantization/utils/utility.py:93
↓ 2 callersMethod_post_clean
Delete the temporarily files generated during the quantization process. :return: None
neural_compressor/tensorflow/quantization/utils/graph_converter.py:832
↓ 2 callersMethod_qdq_model_unwrapper_for_auto
Unwrap all the modules from QDQ (Quantize-Dequantize) operations. Returns: None
neural_compressor/torch/algorithms/smooth_quant/utility.py:1416
↓ 2 callersMethod_quantize
(model, quant_config, *args, **kwargs)
test/common/test_common.py:381
↓ 2 callersFunction_read_value
Return numeric value whether variable has `.value` or is a plain array.
test/jax/test_accuracy.py:31
↓ 2 callersFunction_register_pattern_pair
(dtype: torch.dtype)
neural_compressor/torch/algorithms/pt2e_quant/half_precision_rewriter.py:119
↓ 2 callersMethod_save_hpu_format_tensor
(self, model)
neural_compressor/torch/algorithms/weight_only/save_load.py:1044
↓ 2 callersMethod_set_weights
Set fp32 weights to qmodel.
neural_compressor/tensorflow/algorithms/static_quant/keras.py:94
↓ 2 callersMethod_setup
Init quantizer.
neural_compressor/torch/algorithms/qat/quant_linear.py:40
↓ 2 callersFunction_split_string_to_tokens
Splits text to a list of string tokens.
examples/tensorflow/nlp/transformer_lt/quantization/ptq/utils/tokenizer.py:221
↓ 2 callersFunction_split_token_to_subtokens
Splits a token into subtokens defined in the subtoken dict.
examples/tensorflow/nlp/transformer_lt/quantization/ptq/utils/tokenizer.py:375
↓ 2 callersMethod_subtoken_ids_to_tokens
Convert list of int subtoken ids to a list of string tokens.
examples/tensorflow/nlp/transformer_lt/quantization/ptq/utils/tokenizer.py:166
↓ 2 callersMethod_tuning_cfg_to_fw
Parse the neural_compressor wrapped configuration to Tensorflow. Args: tuning_cfg (dict): configuration for quantization.
neural_compressor/tensorflow/algorithms/static_quant/tensorflow.py:122
↓ 2 callersFunction_unicode_to_native
Convert string from unicode to native format (required in Python 2).
examples/tensorflow/nlp/transformer_lt/quantization/ptq/utils/tokenizer.py:213
↓ 2 callersFunctionaccuracy
Computes the accuracy over the k top predictions for the specified values of k
examples/pytorch/image_recognition/torchvision_models/quantization/static_quant/ipex/main.py:533
↓ 2 callersFunctionaccuracy
Computes the accuracy over the k top predictions for the specified values of k
examples/pytorch/cv/fp8_quant/main.py:373
↓ 2 callersFunctionaccuracy
Computes the accuracy over the k top predictions for the specified values of k
examples/pytorch/cv/mixed_precision/main.py:349
↓ 2 callersFunctionaccuracy
Computes the accuracy over the k top predictions for the specified values of k
examples/pytorch/cv/static_quant/main.py:421
↓ 2 callersMethodadd_batch
Add inputs and outputs to gptq object.
neural_compressor/torch/algorithms/weight_only/gptq.py:1111
↓ 2 callersFunctionadd_fp8_support
Extend a dtype size function to support FP8 dtypes. Args: function (Callable): Function that returns the size of a dtype in bits. Re
neural_compressor/jax/utils/utility.py:51
↓ 2 callersFunctionadd_scale_registry
Update scale registry
neural_compressor/torch/algorithms/fp8_quant/_core/scale_handler.py:24
↓ 2 callersMethodadjust_weight
Adjust weight of LLM saved_model by scale.
neural_compressor/tensorflow/utils/model_wrappers.py:1328
↓ 2 callersMethodapply_batchmatmulv2_fusion
Apply dequantize + batchmatmul/batchmatmulv2 + quantizev2 fusion. Dequantize + BatchMatMulV2 + QuantizeV2
neural_compressor/tensorflow/quantization/utils/quantize_graph/qdq/fuse_qdq_matmul.py:560
↓ 2 callersMethodapply_conv3d_add_addn_fusion
Apply Conv3D Add Addn fusion. Dequantize + Conv3D + BiasAdd + Add + QuantizeV2 Dequantize + Conv3D + BiasAdd + AddV2 + QuantizeV2
neural_compressor/tensorflow/quantization/utils/quantize_graph/qdq/fuse_qdq_conv.py:384
↓ 2 callersMethodapply_emb
(self, emb_l, *emb_args)
examples/pytorch/recommendation/dlrm/static_quant/ipex/dlrm_s_pytorch.py:265
↓ 2 callersFunctionawq_reverse_reorder_int_tensor
Awq tensor convert tool. Reverse_reorder_int_tensor
neural_compressor/torch/algorithms/weight_only/utility.py:1245
↓ 2 callersMethodbatch
Dataset return data per batch.
examples/tensorflow/object_detection/mask_rcnn_inception_v2/quantization/ptq/data_process.py:662
↓ 2 callersMethodbatch
Dataset return data per batch.
examples/tensorflow/object_detection/faster_rcnn_resnet50/quantization/ptq/data_process.py:550
↓ 2 callersMethodbatch
Dataset return data per batch.
examples/tensorflow/object_detection/ssd_mobilenet_v1/quantization/ptq/data_process.py:550
↓ 2 callersMethodbatch
Dataset return data per batch.
examples/tensorflow/image_recognition/mobilenet_v2/quantization/ptq/data_process.py:406
↓ 2 callersMethodbatch
Dataset return data per batch.
examples/tensorflow/image_recognition/resnet_v2_50/quantization/ptq/data_process.py:406
↓ 2 callersMethodbatch
Dataset return data per batch.
examples/tensorflow/image_recognition/vision_transformer/quantization/ptq/data_process.py:471
↓ 2 callersMethodbatch
Dataset return data per batch.
examples/tensorflow/image_recognition/inception_v3/quantization/ptq/data_process.py:406
↓ 2 callersMethodbatch
Dataset return data per batch.
examples/tensorflow/nlp/bert_large_squad_model_zoo/quantization/ptq/data_process.py:316
↓ 2 callersMethodbatch
Dataset return data per batch.
examples/tensorflow/keras/image_recognition/resnet_v2_50/quantization/ptq/data_process.py:438
↓ 2 callersMethodbatch
Dataset return data per batch.
examples/tensorflow/keras/image_recognition/inception_v3/quantization/ptq/data_process.py:438
↓ 2 callersFunctionbleu_tokenize
(string)
examples/tensorflow/nlp/transformer_lt/quantization/ptq/main.py:81
↓ 2 callersFunctionblock_wise_calibration
Calibration model on hpu block-by-block to reduce device memory usage. Args: model (torch.nn.Module): prepared model. dataloader
neural_compressor/torch/utils/block_wise.py:117
↓ 2 callersFunctionbuild_graph
()
test/tensorflow/test_model_wrappers.py:14
↓ 2 callersMethodbuild_model_include_conv_and_linear
(bias=True)
test/torch/quantization/test_pt2e_quant.py:61
↓ 2 callersFunctionbuild_quant_linear
Manually construct a QuantLinear since the class does not define an __init__. Steps: 1. Instantiate the module 2. Register parameter
test/torch/algorithms/qat/test_quantizer_and_linear.py:39
↓ 2 callersMethodbuild_saved_model
Build Tensorflow saved model. Args: root (str, optional): path to saved model. Defaults to None. Returns: ro
neural_compressor/tensorflow/utils/model_wrappers.py:1140
↓ 2 callersFunctioncalculate_scale_rounding_with_cguid
(x, scaleMode, **kwargs)
neural_compressor/torch/algorithms/fp8_quant/_core/fp_utils.py:33
↓ 2 callersFunctioncalib_func
(model)
test/torch/quantization/fp8_quant/test_fp8_static_quant.py:31
↓ 2 callersMethodcall_q
Q-side of split QDQ: observe inputs during calibration. During calibration, runs the observer on inputs. After post_quantization_clea
neural_compressor/jax/quantization/layers_static.py:326
↓ 2 callersFunctioncallback
(d)
examples/pytorch/diffusion_model/diffusers/framepack/main.py:225
↓ 2 callersFunctioncausal_lm_make_replace_generate_function
Replace generate function for calibration and restore on demand. Args: self (keras.Model): Causal language model instance to modify.
neural_compressor/jax/utils/utility.py:409
↓ 2 callersFunctionchange_to_cur_file_dir
()
test/torch/quantization/fp8_quant/test_fp8_static_quant.py:22
↓ 2 callersMethodcheck_const_inputs
Check the node has the const input. Args: node_name (string): node name Returns: bool: True if the node has
neural_compressor/tensorflow/quantization/utils/graph_rewriter/generic/fold_constant.py:137
↓ 2 callersFunctioncheck_tests_to_skip
(scale_method, scale_format, dynamic_quantization, device_type=None)
test/torch/algorithms/fp8_quant/unit_tests/test_layers/test_linear.py:43
↓ 2 callersFunctionclassify_image
(model, image, top_k=1)
test/jax/test_vit.py:35
↓ 2 callersFunctionclean_rank_files
Clean files saved by each rank after gathering.
neural_compressor/torch/algorithms/fp8_quant/save_load.py:126
↓ 2 callersFunctioncompare_parameters_buffers
(model1, model2, atol=1e-8)
test/torch/quantization/fp8_quant/test_save_load.py:24
↓ 2 callersMethodconfigure
Configure the quantizer.
neural_compressor/torch/algorithms/weight_only/gptq.py:1375
↓ 2 callersFunctionconstruct_function_from_graph_def
Rebuild function from graph_def. Args: func: The original concrete function get from saved_model. graph_def: The optimized graph
neural_compressor/tensorflow/quantization/utils/utility.py:519
↓ 2 callersMethodconvert
Converts a prepared model to a quantized model. Args: model (torch.nn.Module): The prepared model to be converted.
neural_compressor/torch/algorithms/base_algorithm.py:69
↓ 2 callersMethodconvert
Convert the calibrated model into qdq mode. Args: model (GraphModule): The prepared model. Returns: GraphMod
neural_compressor/torch/algorithms/pt2e_quant/core.py:86
↓ 2 callersMethodconvert
Converts a prepared model to a quantized model. Args: model (QuantizationInterceptionModule): the prepared model to be convert
neural_compressor/torch/algorithms/static_quant/static_quant.py:136
↓ 2 callersFunctionconvert_dtype_str2torch
(str_dtype)
neural_compressor/transformers/quantization/utils.py:46
↓ 2 callersFunctionconvert_dtype_torch2str
(dtype)
neural_compressor/transformers/quantization/utils.py:59
↓ 2 callersFunctionconvert_examples_to_features
Loads a data file into a list of `InputBatch`s.
examples/tensorflow/nlp/bert_large_squad_model_zoo/quantization/ptq/create_tf_record.py:198
↓ 2 callersMethodconvert_from_fp8
(config)
neural_compressor/torch/quantization/config.py:1938
↓ 2 callersMethodconvert_from_weight_only
(obj)
neural_compressor/torch/algorithms/mixed_low_precision/modules.py:100
↓ 2 callersFunctionconvert_weight_to_vllm_compatible
To convert INC fp8 model weight format to the vllm compatible format quantized by llm-compressor. Args: state_dict (dict): state_dict from
neural_compressor/torch/algorithms/fp8_quant/save_load.py:208
↓ 2 callersFunctioncreate_calibration_data
Create calibration data for static quantization.
test/jax/test_save_load.py:48
↓ 2 callersFunctioncreate_files_names
(config, fname = None)
neural_compressor/torch/algorithms/fp8_quant/_core/save_measure/save_files.py:81
↓ 2 callersMethodcreate_mlp
(self, ln, sigmoid_layer)
examples/pytorch/recommendation/dlrm/static_quant/ipex/dlrm_s_pytorch.py:172
↓ 2 callersFunctioncreate_test_graph
()
test/tensorflow/quantization/ptq/test_graph_conv_as_output.py:10
↓ 2 callersFunctioncreate_test_graph
(bf16_graph=True)
test/tensorflow/quantization/ptq/test_bf16_convert.py:16
↓ 2 callersFunctiondecode_long
r"""Decode a long from a two's complement little-endian binary string. >>> decode_long(b'') 0 >>> decode_long(b"\xff\x00") 255 >>
neural_compressor/torch/algorithms/layer_wise/modified_pickle.py:398
↓ 2 callersMethoddefault_tune_setup
Setup default auto-tune settings. Returns: dict: A dictionary of operation-wise loss values with respect to alpha values.
neural_compressor/torch/algorithms/smooth_quant/utility.py:1728
↓ 2 callersMethoddetect_block
Traverse the model definition and return the attention blocks and ffn blocks. Returns: blocks: A dict include the detected att
neural_compressor/torch/algorithms/static_quant/utility.py:646
↓ 2 callersMethoddisable
Bypass the module.
neural_compressor/torch/algorithms/qat/tensor_quantizer.py:143
↓ 2 callersFunctiondispatch_model_on_devices
(model)
examples/pytorch/nlp/huggingface_models/language-modeling/quantization/auto_round/llama3/quantize.py:52
↓ 2 callersFunctiondlrm_wrap
(X, *emb_args)
examples/pytorch/recommendation/dlrm/static_quant/ipex/dlrm_s_pytorch.py:117
↓ 2 callersMethoddo_transformation
Execute BF16 convert. Returns: Transformed graph
neural_compressor/tensorflow/quantization/utils/graph_rewriter/bf16/bf16_convert.py:279
↓ 2 callersFunctiondowload_hf_model
Download hugging face model from hf hub.
neural_compressor/torch/utils/utility.py:298
↓ 2 callersFunctiondq_q_weight
dequantize and quantize weight with different scales.
neural_compressor/torch/algorithms/fp8_quant/save_load.py:801
↓ 2 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/static_quant/utility.py:458
↓ 2 callersMethodenable
Enable the module.
neural_compressor/torch/algorithms/qat/tensor_quantizer.py:147
↓ 2 callersMethodensure_tensor_name_has_port
Makes sure that a tensor name has :0 if no explicit port exists.
neural_compressor/tensorflow/quantization/utils/quantize_graph_common.py:314
↓ 2 callersMethodeval_fn
(model)
test/common/test_common.py:365
↓ 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/mask_rcnn_inception_v2/quantization/ptq/main.py:53
↓ 2 callersFunctionevaluate
Custom evaluate function to estimate the accuracy of the model. Args: model (tf.Graph): The input model graph. Returns:
examples/tensorflow/object_detection/faster_rcnn_resnet50/quantization/ptq/main.py:52
← previousnext →601–700 of 4,695, ranked by callers