CARVIEW |
Select Language
HTTP/2 200
date: Wed, 23 Jul 2025 06:35:15 GMT
content-type: text/html; charset=utf-8
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With,Accept-Encoding, Accept, X-Requested-With
x-repository-download: git clone https://github.com/intel/neural-compressor.git
etag: W/"2239e17ca3a3b8755032c91f498bf9c9"
cache-control: max-age=0, private, must-revalidate
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: no-referrer-when-downgrade
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
server: github.com
content-encoding: gzip
accept-ranges: bytes
set-cookie: _gh_sess=dlzOOCnE7%2BuwPUvaIJjHeM5WOKGa1%2B%2BFKAHo%2B6b82NAoVs6OB2HxyIPV9ctw1LKeeoALgAo8G5IY%2F6CAht1iD5VoRwIUvIuRAJpVhD5VWE%2FmT3NU%2Fj9yBYLVFUbOFFqg2LqhKDrzBZgIVPXwkQubMC%2FiJvwAeejWdr0D%2FR4IceYw84WTjAQjtdsmwX2HpujEKe%2B6CR4s4zDILXdr9sM2nr1SdGwsMWo7Qac%2BtGqWXGEn%2BvoVgb6FEQxqGFu45WV7E2MKKsB9LybEO9LUztXjcQ%3D%3D--p7QGYeL3Su%2BWpmvY--SwVQ4Wr2NY9uud%2Bfr1EMJQ%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
set-cookie: _octo=GH1.1.1529549980.1753252513; Path=/; Domain=github.com; Expires=Thu, 23 Jul 2026 06:35:13 GMT; Secure; SameSite=Lax
set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Thu, 23 Jul 2026 06:35:13 GMT; HttpOnly; Secure; SameSite=Lax
x-github-request-id: 841C:256CA9:5365E1:6B68CE:688082A1
support peft model quantization with SmoothQuant (#1282) · intel/neural-compressor@5e21b70 · GitHub


![pre-commit-ci[bot]](https://avatars.githubusercontent.com/in/68672?v=4&size=40)
authored
Copy file name to clipboardExpand all lines: .azure-pipelines/scripts/ut/env_setup.sh
Copy file name to clipboardExpand all lines: neural_compressor/adaptor/pytorch.py
Copy file name to clipboardExpand all lines: neural_compressor/adaptor/pytorch_ipex.yaml
Copy file name to clipboardExpand all lines: neural_compressor/adaptor/torch_utils/smooth_quant.py
Skip to content
Navigation Menu
{{ message }}
-
Notifications
You must be signed in to change notification settings - Fork 277
Commit 5e21b70
support peft model quantization with SmoothQuant (#1282)
Peft model will use below arch: Linears in Linear. This pull request supports this arch with smoothquant.
```
(v): Linear(
in_features=32, out_features=32, bias=False
(lora_dropout): ModuleDict(
(default): Dropout(p=0.1, inplace=False)
)
(lora_A): ModuleDict(
(default): Linear(in_features=32, out_features=8, bias=False)
)
(lora_B): ModuleDict(
(default): Linear(in_features=8, out_features=32, bias=False)
)
(lora_embedding_A): ParameterDict()
(lora_embedding_B): ParameterDict()
```
BTW,
when IPEX version<=1.13, HistogramObserver doesn't support asym scheme, the zero_point is 0 for asym uint8, while the MinMaxObserver works well.
Also,
IPEX SmoothQuant Observer can only use save/load_qconf_summary once. The save_qconf_summary API will freeze the scale used in model and calibration won't work anymore. The load_qconf_summary will overwrite the scales used in model but only work in the first call. Here we implement normal observer to workaround this issue.
---------
Signed-off-by: changwangss <chang1.wang@intel.com>
Signed-off-by: Xin He <xin3.he@intel.com>
Signed-off-by: y <xin3.he@intel.com>
Signed-off-by: chensuyue <suyue.chen@intel.com>
Co-authored-by: changwangss <chang1.wang@intel.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: chen, suyue <suyue.chen@intel.com>1 parent 21668df commit 5e21b70Copy full SHA for 5e21b70
File tree
Expand file treeCollapse file tree
8 files changed
+15163
-165
lines changedFilter options
- .azure-pipelines/scripts/ut
- neural_compressor/adaptor
- torch_utils
- test
- algorithm
Expand file treeCollapse file tree
8 files changed
+15163
-165
lines changed.azure-pipelines/scripts/ut/env_setup.sh
Copy file name to clipboardExpand all lines: .azure-pipelines/scripts/ut/env_setup.sh+1-1Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
92 | 92 |
| |
93 | 93 |
| |
94 | 94 |
| |
95 |
| - | |
| 95 | + | |
96 | 96 |
| |
97 | 97 |
| |
98 | 98 |
| |
|
neural_compressor/adaptor/pytorch.py
Copy file name to clipboardExpand all lines: neural_compressor/adaptor/pytorch.py+22-17Lines changed: 22 additions & 17 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1833 | 1833 |
| |
1834 | 1834 |
| |
1835 | 1835 |
| |
1836 |
| - | |
| 1836 | + | |
1837 | 1837 |
| |
1838 | 1838 |
| |
1839 | 1839 |
| |
| |||
1858 | 1858 |
| |
1859 | 1859 |
| |
1860 | 1860 |
| |
1861 |
| - | |
| 1861 | + | |
1862 | 1862 |
| |
1863 | 1863 |
| |
1864 | 1864 |
| |
1865 | 1865 |
| |
| 1866 | + | |
1866 | 1867 |
| |
1867 | 1868 |
| |
1868 | 1869 |
| |
| |||
1876 | 1877 |
| |
1877 | 1878 |
| |
1878 | 1879 |
| |
1879 |
| - | |
| 1880 | + | |
1880 | 1881 |
| |
1881 | 1882 |
| |
1882 | 1883 |
| |
1883 | 1884 |
| |
| 1885 | + | |
| 1886 | + | |
| 1887 | + | |
1884 | 1888 |
| |
1885 |
| - | |
| 1889 | + | |
1886 | 1890 |
| |
1887 | 1891 |
| |
1888 | 1892 |
| |
| |||
2858 | 2862 |
| |
2859 | 2863 |
| |
2860 | 2864 |
| |
2861 |
| - | |
| 2865 | + | |
2862 | 2866 |
| |
2863 | 2867 |
| |
2864 | 2868 |
| |
| |||
2949 | 2953 |
| |
2950 | 2954 |
| |
2951 | 2955 |
| |
2952 |
| - | |
| 2956 | + | |
2953 | 2957 |
| |
2954 | 2958 |
| |
2955 | 2959 |
| |
| |||
3112 | 3116 |
| |
3113 | 3117 |
| |
3114 | 3118 |
| |
3115 |
| - | |
| 3119 | + | |
3116 | 3120 |
| |
3117 | 3121 |
| |
3118 | 3122 |
| |
| |||
3268 | 3272 |
| |
3269 | 3273 |
| |
3270 | 3274 |
| |
3271 |
| - | |
| 3275 | + | |
3272 | 3276 |
| |
3273 | 3277 |
| |
3274 | 3278 |
| |
3275 | 3279 |
| |
3276 | 3280 |
| |
3277 |
| - | |
| 3281 | + | |
| 3282 | + | |
3278 | 3283 |
| |
3279 | 3284 |
| |
3280 | 3285 |
| |
3281 | 3286 |
| |
3282 | 3287 |
| |
3283 |
| - | |
| 3288 | + | |
3284 | 3289 |
| |
3285 | 3290 |
| |
3286 | 3291 |
| |
| |||
3296 | 3301 |
| |
3297 | 3302 |
| |
3298 | 3303 |
| |
3299 |
| - | |
| 3304 | + | |
3300 | 3305 |
| |
3301 | 3306 |
| |
3302 | 3307 |
| |
| |||
3313 | 3318 |
| |
3314 | 3319 |
| |
3315 | 3320 |
| |
3316 |
| - | |
| 3321 | + | |
| 3322 | + | |
| 3323 | + | |
| 3324 | + | |
| 3325 | + | |
3317 | 3326 |
| |
3318 | 3327 |
| |
3319 |
| - | |
| 3328 | + | |
3320 | 3329 |
| |
3321 | 3330 |
| |
3322 | 3331 |
| |
| |||
3337 | 3346 |
| |
3338 | 3347 |
| |
3339 | 3348 |
| |
3340 |
| - | |
3341 |
| - | |
3342 |
| - | |
3343 |
| - | |
3344 | 3349 |
| |
3345 | 3350 |
| |
3346 | 3351 |
| |
|
neural_compressor/adaptor/pytorch_ipex.yaml
Copy file name to clipboardExpand all lines: neural_compressor/adaptor/pytorch_ipex.yaml+2-2Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
48 | 48 |
| |
49 | 49 |
| |
50 | 50 |
| |
51 |
| - | |
| 51 | + | |
52 | 52 |
| |
53 |
| - | |
| 53 | + | |
54 | 54 |
| |
55 | 55 |
| |
56 | 56 |
| |
|
neural_compressor/adaptor/torch_utils/smooth_quant.py
Copy file name to clipboardExpand all lines: neural_compressor/adaptor/torch_utils/smooth_quant.py+40-71Lines changed: 40 additions & 71 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
182 | 182 |
| |
183 | 183 |
| |
184 | 184 |
| |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
185 | 191 |
| |
186 | 192 |
| |
187 | 193 |
| |
| |||
200 | 206 |
| |
201 | 207 |
| |
202 | 208 |
| |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
203 | 215 |
| |
204 | 216 |
| |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
205 | 222 |
| |
206 | 223 |
| |
207 | 224 |
| |
| |||
222 | 239 |
| |
223 | 240 |
| |
224 | 241 |
| |
225 |
| - | |
| 242 | + | |
226 | 243 |
| |
227 | 244 |
| |
228 | 245 |
| |
| |||
281 | 298 |
| |
282 | 299 |
| |
283 | 300 |
| |
284 |
| - | |
| 301 | + | |
285 | 302 |
| |
286 | 303 |
| |
287 | 304 |
| |
| |||
372 | 389 |
| |
373 | 390 |
| |
374 | 391 |
| |
375 |
| - | |
| 392 | + | |
376 | 393 |
| |
377 | 394 |
| |
378 | 395 |
| |
| |||
547 | 564 |
| |
548 | 565 |
| |
549 | 566 |
| |
| 567 | + | |
| 568 | + | |
550 | 569 |
| |
551 | 570 |
| |
552 | 571 |
| |
| |||
670 | 689 |
| |
671 | 690 |
| |
672 | 691 |
| |
673 |
| - | |
| 692 | + | |
674 | 693 |
| |
675 | 694 |
| |
676 | 695 |
| |
| |||
680 | 699 |
| |
681 | 700 |
| |
682 | 701 |
| |
| 702 | + | |
| 703 | + | |
683 | 704 |
| |
684 |
| - | |
685 |
| - | |
686 |
| - | |
687 |
| - | |
688 |
| - | |
| 705 | + | |
| 706 | + | |
689 | 707 |
| |
690 | 708 |
| |
691 | 709 |
| |
692 | 710 |
| |
693 | 711 |
| |
694 |
| - | |
| 712 | + | |
| 713 | + | |
695 | 714 |
| |
696 | 715 |
| |
697 | 716 |
| |
698 | 717 |
| |
699 | 718 |
| |
700 | 719 |
| |
701 | 720 |
| |
| 721 | + | |
| 722 | + | |
702 | 723 |
| |
703 | 724 |
| |
704 | 725 |
| |
| |||
921 | 942 |
| |
922 | 943 |
| |
923 | 944 |
| |
924 |
| - | |
| 945 | + | |
925 | 946 |
| |
926 | 947 |
| |
927 | 948 |
| |
| |||
953 | 974 |
| |
954 | 975 |
| |
955 | 976 |
| |
| 977 | + | |
956 | 978 |
| |
957 | 979 |
| |
958 | 980 |
| |
959 |
| - | |
| 981 | + | |
960 | 982 |
| |
961 |
| - | |
| 983 | + | |
962 | 984 |
| |
963 | 985 |
| |
964 | 986 |
| |
| |||
969 | 991 |
| |
970 | 992 |
| |
971 | 993 |
| |
972 |
| - | |
| 994 | + | |
973 | 995 |
| |
974 | 996 |
| |
975 | 997 |
| |
| |||
1061 | 1083 |
| |
1062 | 1084 |
| |
1063 | 1085 |
| |
1064 |
| - | |
| 1086 | + | |
1065 | 1087 |
| |
1066 | 1088 |
| |
1067 | 1089 |
| |
1068 | 1090 |
| |
1069 | 1091 |
| |
1070 | 1092 |
| |
1071 | 1093 |
| |
| 1094 | + | |
1072 | 1095 |
| |
1073 |
| - | |
1074 |
| - | |
1075 |
| - | |
1076 |
| - | |
1077 |
| - | |
1078 |
| - | |
1079 |
| - | |
1080 |
| - | |
1081 |
| - | |
1082 |
| - | |
1083 |
| - | |
1084 |
| - | |
1085 |
| - | |
| 1096 | + | |
| 1097 | + | |
1086 | 1098 |
| |
1087 | 1099 |
| |
1088 | 1100 |
| |
| |||
1334 | 1346 |
| |
1335 | 1347 |
| |
1336 | 1348 |
| |
1337 |
| - | |
1338 |
| - | |
1339 |
| - | |
1340 |
| - | |
1341 |
| - | |
1342 |
| - | |
1343 |
| - | |
1344 |
| - | |
1345 |
| - | |
1346 |
| - | |
1347 |
| - | |
1348 |
| - | |
1349 |
| - | |
1350 |
| - | |
1351 |
| - | |
1352 |
| - | |
1353 |
| - | |
1354 |
| - | |
1355 |
| - | |
1356 |
| - | |
1357 |
| - | |
1358 |
| - | |
1359 |
| - | |
1360 |
| - | |
1361 |
| - | |
1362 |
| - | |
1363 |
| - | |
1364 |
| - | |
1365 |
| - | |
1366 |
| - | |
1367 |
| - | |
1368 |
| - | |
1369 |
| - | |
1370 |
| - | |
1371 |
| - | |
1372 |
| - | |
1373 |
| - | |
1374 |
| - | |
1375 |
| - | |
1376 |
| - | |
1377 |
| - | |
1378 |
| - | |
1379 |
| - |
You can’t perform that action at this time.
0 commit comments