-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathXQuantConfig.html
More file actions
128 lines (118 loc) · 9.51 KB
/
XQuantConfig.html
File metadata and controls
128 lines (118 loc) · 9.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<!DOCTYPE html>
<html lang="en" data-content_root="../../../">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<title>XQuant Configuration — MCT Documentation: ver 2.6.0</title>
<link rel="stylesheet" type="text/css" href="../../../static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="../../../static/bizstyle.css?v=5283bb3d" />
<link rel="stylesheet" type="text/css" href="../../../static/css/custom.css?v=01243f34" />
<script src="../../../static/documentation_options.js?v=ae39cb24"></script>
<script src="../../../static/doctools.js?v=9bcbadda"></script>
<script src="../../../static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../../../static/bizstyle.js"></script>
<link rel="index" title="Index" href="../../../genindex.html" />
<link rel="search" title="Search" href="../../../search.html" />
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<!--[if lt IE 9]>
<script src="static/css3-mediaqueries.js"></script>
<![endif]-->
</head><body>
<div class="related" role="navigation" aria-label="Related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../../../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="nav-item nav-item-0"><a href="../../../index.html">MCT Documentation: ver 2.6.0</a> »</li>
<li class="nav-item nav-item-this"><a href="">XQuant Configuration</a></li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="xquant-configuration">
<span id="ug-xquantconfig"></span><h1>XQuant Configuration<a class="headerlink" href="#xquant-configuration" title="Link to this heading">¶</a></h1>
<dl class="py class">
<dt class="sig sig-object py" id="model_compression_toolkit.xquant.common.xquant_config.XQuantConfig">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">model_compression_toolkit.xquant.common.xquant_config.</span></span><span class="sig-name descname"><span class="pre">XQuantConfig</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">report_dir</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">custom_similarity_metrics</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">quantize_reported_dir</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">threshold_quantize_error</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">{'mse':</span> <span class="pre">0.1,</span> <span class="pre">'cs':</span> <span class="pre">0.1,</span> <span class="pre">'sqnr':</span> <span class="pre">0.1}</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">is_detect_under_threshold_quantize_error</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">{'mse':</span> <span class="pre">False,</span> <span class="pre">'cs':</span> <span class="pre">True,</span> <span class="pre">'sqnr':</span> <span class="pre">True}</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">threshold_degrade_layer_ratio</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0.5</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">threshold_zscore_outlier_removal</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">5.0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">threshold_ratio_unbalanced_concatenation</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">16.0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">threshold_bitwidth_mixed_precision_with_model_output_loss_objective</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">2</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#model_compression_toolkit.xquant.common.xquant_config.XQuantConfig" title="Link to this definition">¶</a></dt>
<dd><p>Configuration for generating the report.
It allows to set the log dir that the report will be saved in and to add similarity metrics
to measure between tensors of the two models.</p>
<p>Initializes the configuration for explainable quantization.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>report_dir</strong> (<em>str</em>) – Directory where the reports will be saved.</p></li>
<li><p><strong>custom_similarity_metrics</strong> (<em>Dict</em><em>[</em><em>str</em><em>, </em><em>Callable</em><em>]</em>) – Custom similarity metrics to be computed between tensors of the two models. The dictionary keys are similarity metric names and the values are callables that implement the similarity metric computation.</p></li>
<li><p><strong>quantize_reported_dir</strong> (<em>str</em>) – Directory where the the quantization log will be saved.</p></li>
<li><p><strong>threshold_quantize_error</strong> (<em>Dict</em><em>[</em><em>str</em><em>, </em><em>float</em><em>]</em>) – Threshold values for detecting degradation in accuracy.</p></li>
<li><p><strong>is_detect_under_threshold_quantize_error</strong> (<em>Dict</em><em>[</em><em>str</em><em>, </em><em>bool</em><em>]</em>) – For each threshold specified in threshold_quantize_error, True: detect the layer as degraded when the error is below the threshold.; False: detect the layer as degraded when the error is above the threshold.</p></li>
<li><p><strong>threshold_degrade_layer_ratio</strong> (<em>float</em>) – If the number of layers detected as degraded is large, skips the judge degradation causes Specify the ratio here.</p></li>
<li><p><strong>threshold_zscore_outlier_removal</strong> (<em>float</em>) – Used in judge degradation causes (Outlier Removal). Threshold for z_score to detect outliers.</p></li>
<li><p><strong>threshold_ratio_unbalanced_concatenation</strong> (<em>float</em>) – Used in judge degradation causes (unbalanced “concatnation”). Threshold for the multiplier of range width between concatenated layers.</p></li>
<li><p><strong>threshold_bitwidth_mixed_precision_with_model_output_loss_objective</strong> (<em>int</em>) – Used in judge degradation causes (Mixed precision with model output loss objective). Bitwidth of the final layer to judge insufficient bitwidth.</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>The following parameters are only used in the <strong>xquant_report_troubleshoot_pytorch_experimental</strong> function.</p>
<ul class="simple">
<li><p>quantize_reported_dir</p></li>
<li><p>threshold_quantize_error</p></li>
<li><p>is_detect_under_threshold_quantize_error</p></li>
<li><p>threshold_degrade_layer_ratio</p></li>
<li><p>threshold_zscore_outlier_removal</p></li>
<li><p>threshold_ratio_unbalanced_concatenation</p></li>
<li><p>threshold_bitwidth_mixed_precision_with_model_output_loss_objective</p></li>
</ul>
</div>
</section>
<div class="clearer"></div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="Main">
<div class="sphinxsidebarwrapper">
<div>
<h3><a href="../../../index.html">Table of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">XQuant Configuration</a><ul>
<li><a class="reference internal" href="#model_compression_toolkit.xquant.common.xquant_config.XQuantConfig"><code class="docutils literal notranslate"><span class="pre">XQuantConfig</span></code></a></li>
</ul>
</li>
</ul>
</div>
<search id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="../../../search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
<input type="submit" value="Go" />
</form>
</div>
</search>
<script>document.getElementById('searchbox').style.display = "block"</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="Related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../../../genindex.html" title="General Index"
>index</a></li>
<li class="nav-item nav-item-0"><a href="../../../index.html">MCT Documentation: ver 2.6.0</a> »</li>
<li class="nav-item nav-item-this"><a href="">XQuant Configuration</a></li>
</ul>
</div>
<div class="footer" role="contentinfo">
© Copyright 2022, Sony Semiconductor Solutions.
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 8.1.3.
</div>
</body>
</html>