Anurag1734/cuda-error-resolution-analysis
07
1[2 {3 "post_stream": {4 "posts": [5 {6 "id": 385139,7 "name": "Vicenté Llavata",8 "username": "Toumic",9 "avatar_template": "/user_avatar/discuss.pytorch.org/toumic/{size}/56815_2.png",10 "created_at": "2023-01-29T14:38:50.878Z",11 "cooked": "<p>Je travaille sur un code Python qui a pour résultat, un jeu de gammes chromatiques(12 1/2 tons), heptatoniques(7 1/2 tons), et tétracordiques(4 1/2 tons), basé sur une seule octave (de 12 1/2 tons).</p>\n<p>Comme je débute ici avec PyTorch, j’aimerais savoir quel tutoriel aborder.<br>\nAfin de développer un calculateur intelligent gammologique.</p>\n<p>Si vous ne comprenez pas les notes, en gros il s’agit d’un espace de 12 1/2 tons. Sur lequel viennent s’accorder une grande séries de gammes variées.</p>\n<p>EDIT by <code>ptrblck</code>:<br>\nFrom Google translate:<br>\nI’m working on Python code that results in a set of chromatic (12 1/2 tones), heptatonic (7 1/2 tones), and tetrachord (4 1/2 tones) scales, based on a single octave (from 12 1/2 tones).</p>\n<p>As I am new here with PyTorch, I would like to know which tutorial to approach.<br>\nIn order to develop an intelligent gammological calculator.</p>\n<p>If you don’t understand the notes, basically it’s a 12 1/2 tone space. On which come to agree a large series of varied scales.</p>",12 "post_number": 1,13 "post_type": 1,14 "posts_count": 1,15 "updated_at": "2023-01-29T21:04:27.484Z",16 "reply_count": 0,17 "reply_to_post_number": null,18 "quote_count": 0,19 "incoming_link_count": 9,20 "reads": 9,21 "readers_count": 8,22 "score": 46.8,23 "yours": false,24 "topic_id": 171317,25 "topic_slug": "les-gammes-musicales",26 "display_username": "Vicenté Llavata",27 "primary_group_name": null,28 "flair_name": null,29 "flair_url": null,30 "flair_bg_color": null,31 "flair_color": null,32 "flair_group_id": null,33 "badges_granted": [],34 "version": 2,35 "can_edit": false,36 "can_delete": false,37 "can_recover": false,38 "can_see_hidden_post": false,39 "can_wiki": false,40 "read": true,41 "user_title": null,42 "bookmarked": false,43 "actions_summary": [],44 "moderator": false,45 "admin": false,46 "staff": false,47 "user_id": 62885,48 "hidden": false,49 "trust_level": 0,50 "deleted_at": null,51 "user_deleted": false,52 "edit_reason": null,53 "can_view_edit_history": true,54 "wiki": false,55 "post_url": "/t/les-gammes-musicales/171317/1",56 "can_accept_answer": false,57 "can_unaccept_answer": false,58 "accepted_answer": false,59 "topic_accepted_answer": null,60 "can_vote": false61 }62 ],63 "stream": [64 38513965 ]66 },67 "timeline_lookup": [68 [69 1,70 100071 ]72 ],73 "suggested_topics": [74 {75 "fancy_title": "Torch::jit::load error file_name!=nullptr",76 "id": 217824,77 "title": "Torch::jit::load error file_name!=nullptr",78 "slug": "torch-load-error-file-name-nullptr",79 "posts_count": 1,80 "reply_count": 0,81 "highest_post_number": 1,82 "image_url": null,83 "created_at": "2025-03-13T22:18:25.486Z",84 "last_posted_at": "2025-03-13T22:18:25.523Z",85 "bumped": true,86 "bumped_at": "2025-03-13T22:18:25.523Z",87 "archetype": "regular",88 "unseen": false,89 "pinned": false,90 "unpinned": null,91 "visible": true,92 "closed": false,93 "archived": false,94 "bookmarked": null,95 "liked": null,96 "unicode_title": "Torch::jit::load error file_name!=nullptr",97 "tags_descriptions": {},98 "like_count": 0,99 "views": 37,100 "category_id": 1,101 "featured_link": null,102 "has_accepted_answer": false,103 "posters": [104 {105 "extras": "latest single",106 "description": "Original Poster, Most Recent Poster",107 "user": {108 "id": 83260,109 "username": "Sanjib",110 "name": "Sanjib",111 "avatar_template": "/letter_avatar_proxy/v4/letter/s/b4bc9f/{size}.png",112 "trust_level": 1113 }114 }115 ]116 },117 {118 "fancy_title": "Conflict between `dataclass` and `nn.Module`",119 "id": 214355,120 "title": "Conflict between `dataclass` and `nn.Module`",121 "slug": "conflict-between-dataclass-and-nn-module",122 "posts_count": 5,123 "reply_count": 3,124 "highest_post_number": 5,125 "image_url": null,126 "created_at": "2024-12-18T09:04:16.994Z",127 "last_posted_at": "2024-12-21T14:26:31.242Z",128 "bumped": true,129 "bumped_at": "2024-12-21T14:26:31.242Z",130 "archetype": "regular",131 "unseen": false,132 "pinned": false,133 "unpinned": null,134 "visible": true,135 "closed": false,136 "archived": false,137 "bookmarked": null,138 "liked": null,139 "tags_descriptions": {},140 "like_count": 0,141 "views": 239,142 "category_id": 1,143 "featured_link": null,144 "has_accepted_answer": false,145 "posters": [146 {147 "extras": "latest",148 "description": "Original Poster, Most Recent Poster",149 "user": {150 "id": 59323,151 "username": "Zephyrus",152 "name": "Zephyrus",153 "avatar_template": "/user_avatar/discuss.pytorch.org/zephyrus/{size}/53193_2.png",154 "trust_level": 1155 }156 },157 {158 "extras": null,159 "description": "Frequent Poster",160 "user": {161 "id": 41396,162 "username": "soulitzer",163 "name": "",164 "avatar_template": "/letter_avatar_proxy/v4/letter/s/839c29/{size}.png",165 "trust_level": 2166 }167 }168 ]169 },170 {171 "fancy_title": "Row deletion of sparse tensors",172 "id": 212904,173 "title": "Row deletion of sparse tensors",174 "slug": "row-deletion-of-sparse-tensors",175 "posts_count": 2,176 "reply_count": 0,177 "highest_post_number": 2,178 "image_url": null,179 "created_at": "2024-11-13T04:14:57.924Z",180 "last_posted_at": "2024-11-14T08:37:50.696Z",181 "bumped": true,182 "bumped_at": "2024-11-14T08:37:50.696Z",183 "archetype": "regular",184 "unseen": false,185 "pinned": false,186 "unpinned": null,187 "visible": true,188 "closed": false,189 "archived": false,190 "bookmarked": null,191 "liked": null,192 "tags_descriptions": {},193 "like_count": 0,194 "views": 142,195 "category_id": 1,196 "featured_link": null,197 "has_accepted_answer": true,198 "posters": [199 {200 "extras": "latest single",201 "description": "Original Poster, Most Recent Poster, Accepted Answer",202 "user": {203 "id": 80876,204 "username": "ParticularCrumble",205 "name": "",206 "avatar_template": "/user_avatar/discuss.pytorch.org/particularcrumble/{size}/72593_2.png",207 "trust_level": 1208 }209 }210 ]211 },212 {213 "fancy_title": "Is there any efficient way to build a dataset from zip archive file?",214 "id": 217690,215 "title": "Is there any efficient way to build a dataset from zip archive file?",216 "slug": "is-there-any-efficient-way-to-build-a-dataset-from-zip-archive-file",217 "posts_count": 1,218 "reply_count": 0,219 "highest_post_number": 1,220 "image_url": null,221 "created_at": "2025-03-11T09:42:48.063Z",222 "last_posted_at": "2025-03-11T09:42:48.107Z",223 "bumped": true,224 "bumped_at": "2025-03-11T09:42:48.107Z",225 "archetype": "regular",226 "unseen": false,227 "pinned": false,228 "unpinned": null,229 "visible": true,230 "closed": false,231 "archived": false,232 "bookmarked": null,233 "liked": null,234 "tags_descriptions": {},235 "like_count": 0,236 "views": 24,237 "category_id": 1,238 "featured_link": null,239 "has_accepted_answer": false,240 "posters": [241 {242 "extras": "latest single",243 "description": "Original Poster, Most Recent Poster",244 "user": {245 "id": 23907,246 "username": "Eta_C",247 "name": "",248 "avatar_template": "/user_avatar/discuss.pytorch.org/eta_c/{size}/17667_2.png",249 "trust_level": 2250 }251 }252 ]253 },254 {255 "fancy_title": "Errors in Pytorch Profiler Example",256 "id": 218316,257 "title": "Errors in Pytorch Profiler Example",258 "slug": "errors-in-pytorch-profiler-example",259 "posts_count": 2,260 "reply_count": 0,261 "highest_post_number": 2,262 "image_url": null,263 "created_at": "2025-03-27T06:16:41.593Z",264 "last_posted_at": "2025-03-27T12:42:32.491Z",265 "bumped": true,266 "bumped_at": "2025-03-27T12:42:32.491Z",267 "archetype": "regular",268 "unseen": false,269 "pinned": false,270 "unpinned": null,271 "visible": true,272 "closed": false,273 "archived": false,274 "bookmarked": null,275 "liked": null,276 "tags_descriptions": {},277 "like_count": 0,278 "views": 93,279 "category_id": 1,280 "featured_link": null,281 "has_accepted_answer": false,282 "posters": [283 {284 "extras": null,285 "description": "Original Poster",286 "user": {287 "id": 83486,288 "username": "ravikamtalwar",289 "name": "Ravi",290 "avatar_template": "/user_avatar/discuss.pytorch.org/ravikamtalwar/{size}/76362_2.png",291 "trust_level": 0292 }293 },294 {295 "extras": "latest",296 "description": "Most Recent Poster",297 "user": {298 "id": 3534,299 "username": "ptrblck",300 "name": "",301 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",302 "admin": true,303 "moderator": true,304 "trust_level": 2305 }306 }307 ]308 }309 ],310 "tags_descriptions": {},311 "fancy_title": "Les gammes musicales",312 "id": 171317,313 "title": "Les gammes musicales",314 "posts_count": 1,315 "created_at": "2023-01-29T14:38:50.795Z",316 "views": 287,317 "reply_count": 0,318 "like_count": 0,319 "last_posted_at": "2023-01-29T14:38:50.878Z",320 "visible": true,321 "closed": false,322 "archived": false,323 "has_summary": false,324 "archetype": "regular",325 "slug": "les-gammes-musicales",326 "category_id": 1,327 "word_count": 186,328 "deleted_at": null,329 "user_id": 62885,330 "featured_link": null,331 "pinned_globally": false,332 "pinned_at": null,333 "pinned_until": null,334 "image_url": null,335 "slow_mode_seconds": 0,336 "draft": null,337 "draft_key": "topic_171317",338 "draft_sequence": null,339 "unpinned": null,340 "pinned": false,341 "current_post_number": 1,342 "highest_post_number": 1,343 "deleted_by": null,344 "actions_summary": [345 {346 "id": 4,347 "count": 0,348 "hidden": false,349 "can_act": false350 },351 {352 "id": 8,353 "count": 0,354 "hidden": false,355 "can_act": false356 },357 {358 "id": 10,359 "count": 0,360 "hidden": false,361 "can_act": false362 },363 {364 "id": 7,365 "count": 0,366 "hidden": false,367 "can_act": false368 }369 ],370 "chunk_size": 20,371 "bookmarked": false,372 "topic_timer": null,373 "message_bus_last_id": 0,374 "participant_count": 1,375 "show_read_indicator": false,376 "thumbnails": null,377 "slow_mode_enabled_until": null,378 "can_vote": false,379 "vote_count": 0,380 "user_voted": false,381 "discourse_zendesk_plugin_zendesk_id": null,382 "discourse_zendesk_plugin_zendesk_url": "https://your-url.zendesk.com/agent/tickets/",383 "details": {384 "can_edit": false,385 "notification_level": 1,386 "participants": [387 {388 "id": 62885,389 "username": "Toumic",390 "name": "Vicenté Llavata",391 "avatar_template": "/user_avatar/discuss.pytorch.org/toumic/{size}/56815_2.png",392 "post_count": 1,393 "primary_group_name": null,394 "flair_name": null,395 "flair_url": null,396 "flair_color": null,397 "flair_bg_color": null,398 "flair_group_id": null,399 "trust_level": 0400 }401 ],402 "created_by": {403 "id": 62885,404 "username": "Toumic",405 "name": "Vicenté Llavata",406 "avatar_template": "/user_avatar/discuss.pytorch.org/toumic/{size}/56815_2.png"407 },408 "last_poster": {409 "id": 62885,410 "username": "Toumic",411 "name": "Vicenté Llavata",412 "avatar_template": "/user_avatar/discuss.pytorch.org/toumic/{size}/56815_2.png"413 }414 },415 "bookmarks": []416 },417 {418 "post_stream": {419 "posts": [420 {421 "id": 385161,422 "name": "Daniel Kusuma",423 "username": "ksmdanl",424 "avatar_template": "/user_avatar/discuss.pytorch.org/ksmdanl/{size}/47578_2.png",425 "created_at": "2023-01-29T20:36:32.400Z",426 "cooked": "<p>I have two segmentation networks and need to obtain the gradients of the output with respect to the input. It works on one model. On the second model, however, it throws a checkpointing error, which is interesting since there’s no checkpoint performed.</p>\n<p><code>RuntimeError: Checkpointing is not compatible with .grad() or when an </code>inputs<code>parameter is passed to .backward(). Please use .backward() and do not pass its</code>inputs<code> argument.</code></p>\n<p>I added a minimal code snippet to make the case more clearer. <code>net_a</code> and <code>net_b</code> are the segmentation networks.</p>\n<pre><code class=\"lang-auto\">net_a = NetA()\n#net_b = NetB()\nnet_a.eval()\n\nwith torch.no_grad():\n x = torch.rand(1, 3, 768, 768)\n y = torch.LongTensor(1,768,768).random_(0, 19)\n\nloss = nn.CrossEntropyLoss()\nx = x.clone().detach()\ny = y.clone().detach()\n\nx_ = x.clone().detach()\nx_.requires_grad = True\ny_ = net_a(x_)\ny_ = y_['logits']\n\nloss = loss(y_, y)\nprint(loss.requires_grad, x_.requires_grad)\ngrad_ = torch.autograd.grad(loss, x_, retain_graph=False, create_graph=False)[0]\n</code></pre>\n<p>What might cause this behaviour? Both nets are structured very similarly hence the confusion up until now. Looking forward for a discussion!</p>",427 "post_number": 1,428 "post_type": 1,429 "posts_count": 2,430 "updated_at": "2023-01-29T20:36:32.400Z",431 "reply_count": 0,432 "reply_to_post_number": null,433 "quote_count": 0,434 "incoming_link_count": 433,435 "reads": 11,436 "readers_count": 10,437 "score": 2162.2,438 "yours": false,439 "topic_id": 171329,440 "topic_slug": "checkpointing-is-not-compatible-with-grad",441 "display_username": "Daniel Kusuma",442 "primary_group_name": null,443 "flair_name": null,444 "flair_url": null,445 "flair_bg_color": null,446 "flair_color": null,447 "flair_group_id": null,448 "badges_granted": [],449 "version": 1,450 "can_edit": false,451 "can_delete": false,452 "can_recover": false,453 "can_see_hidden_post": false,454 "can_wiki": false,455 "read": true,456 "user_title": null,457 "bookmarked": false,458 "actions_summary": [],459 "moderator": false,460 "admin": false,461 "staff": false,462 "user_id": 52161,463 "hidden": false,464 "trust_level": 2,465 "deleted_at": null,466 "user_deleted": false,467 "edit_reason": null,468 "can_view_edit_history": true,469 "wiki": false,470 "post_url": "/t/checkpointing-is-not-compatible-with-grad/171329/1",471 "can_accept_answer": false,472 "can_unaccept_answer": false,473 "accepted_answer": false,474 "topic_accepted_answer": null,475 "can_vote": false476 },477 {478 "id": 385162,479 "name": "",480 "username": "ptrblck",481 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",482 "created_at": "2023-01-29T20:46:23.199Z",483 "cooked": "<p>Could you make the code snippet executable by adding the missing pieces so that we could reproduce and bug it, please?</p>",484 "post_number": 2,485 "post_type": 1,486 "posts_count": 2,487 "updated_at": "2023-01-29T20:46:23.199Z",488 "reply_count": 0,489 "reply_to_post_number": null,490 "quote_count": 0,491 "incoming_link_count": 8,492 "reads": 10,493 "readers_count": 9,494 "score": 42.0,495 "yours": false,496 "topic_id": 171329,497 "topic_slug": "checkpointing-is-not-compatible-with-grad",498 "display_username": "",499 "primary_group_name": null,500 "flair_name": null,501 "flair_url": null,502 "flair_bg_color": null,503 "flair_color": null,504 "flair_group_id": null,505 "badges_granted": [],506 "version": 1,507 "can_edit": false,508 "can_delete": false,509 "can_recover": false,510 "can_see_hidden_post": false,511 "can_wiki": false,512 "read": true,513 "user_title": "",514 "bookmarked": false,515 "actions_summary": [],516 "moderator": true,517 "admin": true,518 "staff": true,519 "user_id": 3534,520 "hidden": false,521 "trust_level": 2,522 "deleted_at": null,523 "user_deleted": false,524 "edit_reason": null,525 "can_view_edit_history": true,526 "wiki": false,527 "post_url": "/t/checkpointing-is-not-compatible-with-grad/171329/2",528 "can_accept_answer": false,529 "can_unaccept_answer": false,530 "accepted_answer": false,531 "topic_accepted_answer": null532 }533 ],534 "stream": [535 385161,536 385162537 ]538 },539 "timeline_lookup": [540 [541 1,542 1000543 ]544 ],545 "suggested_topics": [546 {547 "fancy_title": "The gradient value from custom backward is different from param.grad",548 "id": 212870,549 "title": "The gradient value from custom backward is different from param.grad",550 "slug": "the-gradient-value-from-custom-backward-is-different-from-param-grad",551 "posts_count": 1,552 "reply_count": 0,553 "highest_post_number": 1,554 "image_url": null,555 "created_at": "2024-11-12T14:34:16.758Z",556 "last_posted_at": "2024-11-12T14:34:16.858Z",557 "bumped": true,558 "bumped_at": "2024-11-12T14:34:16.858Z",559 "archetype": "regular",560 "unseen": false,561 "pinned": false,562 "unpinned": null,563 "visible": true,564 "closed": false,565 "archived": false,566 "bookmarked": null,567 "liked": null,568 "tags_descriptions": {},569 "like_count": 0,570 "views": 132,571 "category_id": 7,572 "featured_link": null,573 "has_accepted_answer": false,574 "posters": [575 {576 "extras": "latest single",577 "description": "Original Poster, Most Recent Poster",578 "user": {579 "id": 80858,580 "username": "spbob0418",581 "name": "승현 김",582 "avatar_template": "/user_avatar/discuss.pytorch.org/spbob0418/{size}/73959_2.png",583 "trust_level": 1584 }585 }586 ]587 },588 {589 "fancy_title": "Second order derivative with torch.autograd.function",590 "id": 213752,591 "title": "Second order derivative with torch.autograd.function",592 "slug": "second-order-derivative-with-torch-autograd-function",593 "posts_count": 2,594 "reply_count": 0,595 "highest_post_number": 2,596 "image_url": null,597 "created_at": "2024-12-03T16:14:45.025Z",598 "last_posted_at": "2024-12-03T22:09:09.293Z",599 "bumped": true,600 "bumped_at": "2024-12-03T22:09:09.293Z",601 "archetype": "regular",602 "unseen": false,603 "pinned": false,604 "unpinned": null,605 "visible": true,606 "closed": false,607 "archived": false,608 "bookmarked": null,609 "liked": null,610 "tags_descriptions": {},611 "like_count": 0,612 "views": 229,613 "category_id": 7,614 "featured_link": null,615 "has_accepted_answer": false,616 "posters": [617 {618 "extras": null,619 "description": "Original Poster",620 "user": {621 "id": 63171,622 "username": "bpfrd",623 "name": "bpfrd",624 "avatar_template": "/user_avatar/discuss.pytorch.org/bpfrd/{size}/57126_2.png",625 "trust_level": 1626 }627 },628 {629 "extras": "latest",630 "description": "Most Recent Poster",631 "user": {632 "id": 34294,633 "username": "AlphaBetaGamma96",634 "name": "",635 "avatar_template": "/letter_avatar_proxy/v4/letter/a/3da27b/{size}.png",636 "trust_level": 2637 }638 }639 ]640 },641 {642 "fancy_title": "Behaviour of autograd with broadcasted tensors",643 "id": 214536,644 "title": "Behaviour of autograd with broadcasted tensors",645 "slug": "behaviour-of-autograd-with-broadcasted-tensors",646 "posts_count": 4,647 "reply_count": 2,648 "highest_post_number": 4,649 "image_url": null,650 "created_at": "2024-12-22T11:19:47.602Z",651 "last_posted_at": "2024-12-23T15:00:12.122Z",652 "bumped": true,653 "bumped_at": "2024-12-23T15:00:12.122Z",654 "archetype": "regular",655 "unseen": false,656 "pinned": false,657 "unpinned": null,658 "visible": true,659 "closed": false,660 "archived": false,661 "bookmarked": null,662 "liked": null,663 "tags_descriptions": {},664 "like_count": 0,665 "views": 166,666 "category_id": 7,667 "featured_link": null,668 "has_accepted_answer": true,669 "posters": [670 {671 "extras": null,672 "description": "Original Poster",673 "user": {674 "id": 81662,675 "username": "Manecarr",676 "name": "TTNecArr",677 "avatar_template": "/user_avatar/discuss.pytorch.org/manecarr/{size}/74680_2.png",678 "trust_level": 1679 }680 },681 {682 "extras": "latest",683 "description": "Most Recent Poster, Accepted Answer",684 "user": {685 "id": 41396,686 "username": "soulitzer",687 "name": "",688 "avatar_template": "/letter_avatar_proxy/v4/letter/s/839c29/{size}.png",689 "trust_level": 2690 }691 }692 ]693 },694 {695 "fancy_title": "Complex derivative of real-to-real function",696 "id": 213260,697 "title": "Complex derivative of real-to-real function",698 "slug": "complex-derivative-of-real-to-real-function",699 "posts_count": 2,700 "reply_count": 0,701 "highest_post_number": 2,702 "image_url": null,703 "created_at": "2024-11-21T09:43:11.066Z",704 "last_posted_at": "2024-11-21T10:01:54.973Z",705 "bumped": true,706 "bumped_at": "2024-11-21T10:01:54.973Z",707 "archetype": "regular",708 "unseen": false,709 "pinned": false,710 "unpinned": null,711 "visible": true,712 "closed": false,713 "archived": false,714 "bookmarked": null,715 "liked": null,716 "tags_descriptions": {},717 "like_count": 0,718 "views": 147,719 "category_id": 7,720 "featured_link": null,721 "has_accepted_answer": true,722 "posters": [723 {724 "extras": "latest single",725 "description": "Original Poster, Most Recent Poster, Accepted Answer",726 "user": {727 "id": 81044,728 "username": "sadda",729 "name": "Lukáš Adam",730 "avatar_template": "/user_avatar/discuss.pytorch.org/sadda/{size}/74110_2.png",731 "trust_level": 0732 }733 }734 ]735 },736 {737 "fancy_title": "Most efficient way to re-use grad computations in a layer which is a linear combination of linear layers",738 "id": 219274,739 "title": "Most efficient way to re-use grad computations in a layer which is a linear combination of linear layers",740 "slug": "most-efficient-way-to-re-use-grad-computations-in-a-layer-which-is-a-linear-combination-of-linear-layers",741 "posts_count": 3,742 "reply_count": 0,743 "highest_post_number": 3,744 "image_url": null,745 "created_at": "2025-04-20T17:22:38.368Z",746 "last_posted_at": "2025-04-20T17:48:15.387Z",747 "bumped": true,748 "bumped_at": "2025-04-20T18:24:07.162Z",749 "archetype": "regular",750 "unseen": false,751 "pinned": false,752 "unpinned": null,753 "visible": true,754 "closed": false,755 "archived": false,756 "bookmarked": null,757 "liked": null,758 "tags_descriptions": {},759 "like_count": 0,760 "views": 53,761 "category_id": 7,762 "featured_link": null,763 "has_accepted_answer": false,764 "posters": [765 {766 "extras": "latest",767 "description": "Original Poster, Most Recent Poster",768 "user": {769 "id": 83919,770 "username": "nikitaved",771 "name": "Nikitaved",772 "avatar_template": "/user_avatar/discuss.pytorch.org/nikitaved/{size}/76721_2.png",773 "trust_level": 1774 }775 },776 {777 "extras": null,778 "description": "Frequent Poster",779 "user": {780 "id": 3534,781 "username": "ptrblck",782 "name": "",783 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",784 "admin": true,785 "moderator": true,786 "trust_level": 2787 }788 }789 ]790 }791 ],792 "tags_descriptions": {},793 "fancy_title": "Checkpointing is not compatible with .grad()",794 "id": 171329,795 "title": "Checkpointing is not compatible with .grad()",796 "posts_count": 2,797 "created_at": "2023-01-29T20:36:32.320Z",798 "views": 1235,799 "reply_count": 0,800 "like_count": 0,801 "last_posted_at": "2023-01-29T20:46:23.199Z",802 "visible": true,803 "closed": false,804 "archived": false,805 "has_summary": false,806 "archetype": "regular",807 "slug": "checkpointing-is-not-compatible-with-grad",808 "category_id": 7,809 "word_count": 200,810 "deleted_at": null,811 "user_id": 52161,812 "featured_link": null,813 "pinned_globally": false,814 "pinned_at": null,815 "pinned_until": null,816 "image_url": null,817 "slow_mode_seconds": 0,818 "draft": null,819 "draft_key": "topic_171329",820 "draft_sequence": null,821 "unpinned": null,822 "pinned": false,823 "current_post_number": 1,824 "highest_post_number": 2,825 "deleted_by": null,826 "actions_summary": [827 {828 "id": 4,829 "count": 0,830 "hidden": false,831 "can_act": false832 },833 {834 "id": 8,835 "count": 0,836 "hidden": false,837 "can_act": false838 },839 {840 "id": 10,841 "count": 0,842 "hidden": false,843 "can_act": false844 },845 {846 "id": 7,847 "count": 0,848 "hidden": false,849 "can_act": false850 }851 ],852 "chunk_size": 20,853 "bookmarked": false,854 "topic_timer": null,855 "message_bus_last_id": 0,856 "participant_count": 2,857 "show_read_indicator": false,858 "thumbnails": null,859 "slow_mode_enabled_until": null,860 "can_vote": false,861 "vote_count": 0,862 "user_voted": false,863 "discourse_zendesk_plugin_zendesk_id": null,864 "discourse_zendesk_plugin_zendesk_url": "https://your-url.zendesk.com/agent/tickets/",865 "details": {866 "can_edit": false,867 "notification_level": 1,868 "participants": [869 {870 "id": 3534,871 "username": "ptrblck",872 "name": "",873 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png",874 "post_count": 1,875 "primary_group_name": null,876 "flair_name": null,877 "flair_url": null,878 "flair_color": null,879 "flair_bg_color": null,880 "flair_group_id": null,881 "admin": true,882 "moderator": true,883 "trust_level": 2884 },885 {886 "id": 52161,887 "username": "ksmdanl",888 "name": "Daniel Kusuma",889 "avatar_template": "/user_avatar/discuss.pytorch.org/ksmdanl/{size}/47578_2.png",890 "post_count": 1,891 "primary_group_name": null,892 "flair_name": null,893 "flair_url": null,894 "flair_color": null,895 "flair_bg_color": null,896 "flair_group_id": null,897 "trust_level": 2898 }899 ],900 "created_by": {901 "id": 52161,902 "username": "ksmdanl",903 "name": "Daniel Kusuma",904 "avatar_template": "/user_avatar/discuss.pytorch.org/ksmdanl/{size}/47578_2.png"905 },906 "last_poster": {907 "id": 3534,908 "username": "ptrblck",909 "name": "",910 "avatar_template": "/user_avatar/discuss.pytorch.org/ptrblck/{size}/1823_2.png"911 }912 },913 "bookmarks": []914 },915 {916 "post_stream": {917 "posts": [918 {919 "id": 385146,920 "name": "Andrei Moraru",921 "username": "AndreiMoraru123",922 "avatar_template": "/user_avatar/discuss.pytorch.org/andreimoraru123/{size}/56817_2.png",923 "created_at": "2023-01-29T17:37:22.260Z",924 "cooked": "<p>Hi. I am having a hard time wrapping my head around quantizing models. To the point, I have a basic ResNet model that I want to optimize:</p>\n<pre><code class=\"lang-auto\">encoder = EncoderCNN()\nencoder.load_state_dict(torch.load(os.path.join('models', encoder_file)))\n\nencoder.eval()\nencoder.to(device)\n\ndummy_input = torch.randn(1, 3, 480, 480, device='cuda')\nwith torch.jit.optimized_execution(True):\n encoder = torch.jit.trace(encoder, dummy_input)\n encoder.save(\"models/encoder.pt\")\n\nencoder = torch.jit.load(os.path.join('models', 'encoder.pt'), map_location=torch.device('cuda'))\n</code></pre>\n<p>And this is how I figured I would quantize it:</p>\n<pre><code class=\"lang-auto\">if use_fbgemm:\n quantization_config = torch.quantization.get_default_qconfig('fbgemm')\n torch.backends.quantized.engine = 'fbgemm'\n\nelse:\n quantization_config = torch.quantization.get_default_qconfig('qnnpack')\n torch.backends.quantized.engine = 'qnnpack'\n\nquantization_config.quant_min = 0.0\nquantization_config.quant_max = 1.0\nencoder.qconfig = quantization_config\n\ntorch.quantization.prepare(encoder, inplace=True)\ntorch.quantization.convert(encoder, inplace=True) # This line gets a warning\n</code></pre>\n<p>But the last line throws the warning</p>\n<blockquote>\n<p>UserWarning: Please use quant_min and quant_max to specify the range for observers. reduce_range will be deprecated in a future release of PyTorch.\"</p>\n</blockquote>\n<p>This is located in <code>torch\\ao\\quantization\\observer.py:216</code> and the following lines don’t help:</p>\n<pre><code class=\"lang-auto\">quantization_config.quant_min = 0.0\nquantization_config.quant_max = 1.0\n</code></pre>\n<p>The <a href=\"https://pytorch.org/docs/stable/generated/torch.quantization.convert.html\" rel=\"noopener nofollow ugc\">doc</a> on this was not very clear to me, and I tried to change it to:</p>\n<pre><code class=\"lang-auto\">torch.quantization.prepare(encoder, inplace=True)\ntorch.quantization.convert(encoder, inplace=True,\n convert_custom_config_dict={'_custom_module_class':\n {'EncoderCNN': encoder} # I want this as my Custom Module?\n }\n )\n</code></pre>\n<p>But the warning persists. And perhaps more importantly, I am also not making my model any faster judging by FPS, so I suppose I have set this up wrong to begin with.</p>\n<p>If you could point me to any docs or examples that go through something like this, I would be thankful.</p>\n<p>I know there already are <a href=\"https://pytorch.org/vision/main/models/resnet_quant.html\" rel=\"noopener nofollow ugc\">quantized ResNet models</a> available, but it’s important for me that I can apply this to a custom network with modified layers.</p>\n<p>Thank you</p>",925 "post_number": 1,926 "post_type": 1,927 "posts_count": 1,928 "updated_at": "2023-01-29T20:14:55.033Z",929 "reply_count": 0,930 "reply_to_post_number": null,931 "quote_count": 0,932 "incoming_link_count": 643,933 "reads": 16,934 "readers_count": 15,935 "score": 3188.2,936 "yours": false,937 "topic_id": 171320,938 "topic_slug": "quantization-config",939 "display_username": "Andrei Moraru",940 "primary_group_name": null,941 "flair_name": null,942 "flair_url": null,943 "flair_bg_color": null,944 "flair_color": null,945 "flair_group_id": null,946 "badges_granted": [],947 "version": 3,948 "can_edit": false,949 "can_delete": false,950 "can_recover": false,951 "can_see_hidden_post": false,952 "can_wiki": false,953 "link_counts": [954 {955 "url": "https://pytorch.org/vision/main/models/resnet_quant.html",956 "internal": false,957 "reflection": false,958 "title": "Quantized ResNet — Torchvision main documentation",959 "clicks": 9960 },961 {962 "url": "https://pytorch.org/docs/stable/generated/torch.quantization.convert.html",963 "internal": false,964 "reflection": false,965 "title": "convert — PyTorch 1.13 documentation",966 "clicks": 3967 }968 ],969 "read": true,970 "user_title": "",971 "bookmarked": false,972 "actions_summary": [],973 "moderator": false,974 "admin": false,975 "staff": false,976 "user_id": 59728,977 "hidden": false,978 "trust_level": 1,979 "deleted_at": null,980 "user_deleted": false,981 "edit_reason": null,982 "can_view_edit_history": true,983 "wiki": false,984 "post_url": "/t/quantization-config/171320/1",985 "can_accept_answer": false,986 "can_unaccept_answer": false,987 "accepted_answer": false,988 "topic_accepted_answer": null,989 "can_vote": false990 }991 ],992 "stream": [993 385146994 ]995 },996 "timeline_lookup": [997 [998 1,999 10001000 ]1001 ],1002 "suggested_topics": [1003 {1004 "fancy_title": "My model is taking too much time in calculating FFT to find top k ",1005 "id": 222783,1006 "title": "My model is taking too much time in calculating FFT to find top k ",1007 "slug": "my-model-is-taking-too-much-time-in-calculating-fft-to-find-top-k",1008 "posts_count": 2,1009 "reply_count": 0,1010 "highest_post_number": 2,1011 "image_url": null,1012 "created_at": "2025-08-31T12:50:21.150Z",1013 "last_posted_at": "2025-09-02T14:05:19.246Z",1014 "bumped": true,1015 "bumped_at": "2025-09-02T14:05:19.246Z",1016 "archetype": "regular",1017 "unseen": false,1018 "pinned": false,1019 "unpinned": null,1020 "visible": true,1021 "closed": false,1022 "archived": false,1023 "bookmarked": null,1024 "liked": null,1025 "tags_descriptions": {},1026 "like_count": 0,1027 "views": 30,1028 "category_id": 17,1029 "featured_link": null,1030 "has_accepted_answer": false,1031 "posters": [1032 {1033 "extras": null,1034 "description": "Original Poster",1035 "user": {1036 "id": 85701,1037 "username": "M.A_Shanawaz",1038 "name": "M.A. Shanawaz",1039 "avatar_template": "/user_avatar/discuss.pytorch.org/m.a_shanawaz/{size}/78095_2.png",1040 "trust_level": 01041 }1042 },1043 {1044 "extras": "latest",1045 "description": "Most Recent Poster",1046 "user": {1047 "id": 67276,1048 "username": "Arunprakash-A",1049 "name": "Arun Prakash A",1050 "avatar_template": "/user_avatar/discuss.pytorch.org/arunprakash-a/{size}/78115_2.png",1051 "trust_level": 21052 }1053 }1054 ]1055 },1056 {1057 "fancy_title": "How to do qat after ptq in PyTorch2 quantization?",1058 "id": 219288,1059 "title": "How to do qat after ptq in PyTorch2 quantization?",1060 "slug": "how-to-do-qat-after-ptq-in-pytorch2-quantization",1061 "posts_count": 2,1062 "reply_count": 0,1063 "highest_post_number": 2,1064 "image_url": null,1065 "created_at": "2025-04-21T06:49:18.701Z",1066 "last_posted_at": "2025-04-25T22:48:14.009Z",1067 "bumped": true,1068 "bumped_at": "2025-04-25T22:48:14.009Z",1069 "archetype": "regular",1070 "unseen": false,1071 "pinned": false,1072 "unpinned": null,1073 "visible": true,1074 "closed": false,1075 "archived": false,1076 "bookmarked": null,1077 "liked": null,1078 "tags_descriptions": {},1079 "like_count": 1,1080 "views": 109,1081 "category_id": 17,1082 "featured_link": null,1083 "has_accepted_answer": false,1084 "posters": [1085 {1086 "extras": null,1087 "description": "Original Poster",1088 "user": {1089 "id": 76080,1090 "username": "xiguadong",1091 "name": "xiguadong",1092 "avatar_template": "/user_avatar/discuss.pytorch.org/xiguadong/{size}/70244_2.png",1093 "trust_level": 11094 }1095 },1096 {1097 "extras": "latest",1098 "description": "Most Recent Poster",1099 "user": {1100 "id": 21770,1101 "username": "jerryzh168",1102 "name": "Jerry Zhang",1103 "avatar_template": "/user_avatar/discuss.pytorch.org/jerryzh168/{size}/15217_2.png",1104 "trust_level": 21105 }1106 }1107 ]1108 },1109 {1110 "fancy_title": "Help Needed: High Inference Time & CPU Usage in VGG19 QAT model vs. Baseline",1111 "id": 217884,1112 "title": "Help Needed: High Inference Time & CPU Usage in VGG19 QAT model vs. Baseline",1113 "slug": "help-needed-high-inference-time-cpu-usage-in-vgg19-qat-model-vs-baseline",1114 "posts_count": 1,1115 "reply_count": 0,1116 "highest_post_number": 1,1117 "image_url": null,1118 "created_at": "2025-03-15T15:34:25.765Z",1119 "last_posted_at": "2025-03-15T15:34:25.801Z",1120 "bumped": true,1121 "bumped_at": "2025-03-15T15:45:37.338Z",1122 "archetype": "regular",1123 "unseen": false,1124 "pinned": false,1125 "unpinned": null,1126 "visible": true,1127 "closed": false,1128 "archived": false,1129 "bookmarked": null,1130 "liked": null,1131 "tags_descriptions": {},1132 "like_count": 0,1133 "views": 48,1134 "category_id": 17,1135 "featured_link": null,1136 "has_accepted_answer": false,1137 "posters": [1138 {1139 "extras": "latest single",1140 "description": "Original Poster, Most Recent Poster",1141 "user": {1142 "id": 83292,1143 "username": "Auniik",1144 "name": "Anik Datta",1145 "avatar_template": "/user_avatar/discuss.pytorch.org/auniik/{size}/76179_2.png",1146 "trust_level": 01147 }1148 }1149 ]1150 },1151 {1152 "fancy_title": "[MPS] When device=‘mps’, aten.linear.default op is not decomposed",1153 "id": 220573,1154 "title": "[MPS] When device='mps', aten.linear.default op is not decomposed",1155 "slug": "mps-when-device-mps-aten-linear-default-op-is-not-decomposed",1156 "posts_count": 2,1157 "reply_count": 0,1158 "highest_post_number": 2,1159 "image_url": null,1160 "created_at": "2025-06-04T14:40:40.468Z",1161 "last_posted_at": "2025-06-05T01:55:02.908Z",1162 "bumped": true,1163 "bumped_at": "2025-06-05T01:55:02.908Z",1164 "archetype": "regular",1165 "unseen": false,1166 "pinned": false,1167 "unpinned": null,1168 "visible": true,1169 "closed": false,1170 "archived": false,1171 "bookmarked": null,1172 "liked": null,1173 "tags_descriptions": {},1174 "like_count": 0,1175 "views": 46,1176 "category_id": 17,1177 "featured_link": null,1178 "has_accepted_answer": false,1179 "posters": [1180 {1181 "extras": "latest single",1182 "description": "Original Poster, Most Recent Poster",1183 "user": {1184 "id": 84580,1185 "username": "saeonnuri",1186 "name": "Saeonnuri",1187 "avatar_template": "/user_avatar/discuss.pytorch.org/saeonnuri/{size}/77264_2.png",1188 "trust_level": 11189 }1190 }1191 ]1192 },1193 {1194 "fancy_title": "Should I perform quantization after activation functions like sigmoid and SiLU?",1195 "id": 222960,1196 "title": "Should I perform quantization after activation functions like sigmoid and SiLU?",1197 "slug": "should-i-perform-quantization-after-activation-functions-like-sigmoid-and-silu",1198 "posts_count": 1,1199 "reply_count": 0,1200 "highest_post_number": 1,