Commit f04147c
[Conv] Backport CK split_k reduction workspace for grouped bwd/wrw solvers
Backport of the workspace portion of PR #1426 (commit e290adb,
ALMIOPEN-706) to ROCm 7.0.2. MIOpen previously sized the CK workspace for
the grouped bwd, grouped wrw, and 3D grouped wrw solvers via
GetCKAlphaBetaWorkspace (the alpha/beta backward-weights workspace query).
That query does not account for CK's split_k reduction workspace, so once
a tuned split_k>1 configuration was selected the reduction ran against an
under-allocated workspace and could return silently wrong results.
This change:
- Adds NextCKSplitkValue with CK's split_k autodeduce value (-1).
- Adds GetCKSplitkWorkspaceSize / GetCKSplitkMaxWorkspaceSize and queries
CK for the actual per-instance workspace size across the split_k sweep.
- Uses that CK workspace size in GetWorkspaceSize (falling back to
GetCKAlphaBetaWorkspace only when CK reports 0) and binds a
correctly-sized workspace pointer in the NCHW/NHWC invoker factories.
- Removes the generic-search assertion that workspace size must be
independent of the PerformanceConfig.
Verified via an A/B on the grouped bwd numerical tests: workspace-requiring
split_k>1 CK configurations are now selected and produce correct results
on int32-safe shapes. Shapes whose total element count exceeds INT_MAX
additionally require the large-tensor CK instances; after this change they
fault rather than return silently wrong results, and are not fully
resolved here (see ALMIOPEN-2305).
Also folds in the follow-up fix from mainline commit 54f9acb
(SreecharanGundaboluAMD, #3414): GetCKSplitkMaxWorkspaceSize must
initialize the sweep at split_k=1, not CkSplitkAutoDeduce. Starting at
the autodeduce sentinel makes NextCKSplitkValue return true on the first
step, so the loop evaluates only the autodeduce workspace and never
sweeps split_k=1,2,...,128 -- under-reporting the max workspace and
reintroducing the under-allocation this change is meant to fix. Also
widens the workspace accumulator to std::size_t to avoid int truncation
for >2GB workspaces.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent a1e0e6f commit f04147c
7 files changed
Lines changed: 225 additions & 65 deletions
File tree
- projects/miopen
- src
- include/miopen
- conv
- solver
- solver/conv
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| 28 | + | |
27 | 29 | | |
28 | 30 | | |
29 | 31 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4643 | 4643 | | |
4644 | 4644 | | |
4645 | 4645 | | |
| 4646 | + | |
| 4647 | + | |
| 4648 | + | |
| 4649 | + | |
4646 | 4650 | | |
4647 | 4651 | | |
4648 | 4652 | | |
| |||
4815 | 4819 | | |
4816 | 4820 | | |
4817 | 4821 | | |
| 4822 | + | |
| 4823 | + | |
4818 | 4824 | | |
4819 | 4825 | | |
4820 | 4826 | | |
| |||
4909 | 4915 | | |
4910 | 4916 | | |
4911 | 4917 | | |
| 4918 | + | |
| 4919 | + | |
4912 | 4920 | | |
4913 | 4921 | | |
4914 | 4922 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
498 | 498 | | |
499 | 499 | | |
500 | 500 | | |
501 | | - | |
502 | | - | |
503 | | - | |
504 | | - | |
505 | | - | |
506 | | - | |
507 | | - | |
508 | | - | |
509 | | - | |
510 | 501 | | |
511 | 502 | | |
512 | 503 | | |
| |||
Lines changed: 76 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
| |||
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
53 | 76 | | |
| 77 | + | |
54 | 78 | | |
55 | 79 | | |
56 | 80 | | |
| |||
337 | 361 | | |
338 | 362 | | |
339 | 363 | | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
340 | 393 | | |
341 | 394 | | |
342 | 395 | | |
| |||
781 | 834 | | |
782 | 835 | | |
783 | 836 | | |
784 | | - | |
| 837 | + | |
| 838 | + | |
785 | 839 | | |
786 | 840 | | |
787 | 841 | | |
788 | 842 | | |
789 | 843 | | |
790 | | - | |
| 844 | + | |
791 | 845 | | |
792 | 846 | | |
793 | 847 | | |
| |||
796 | 850 | | |
797 | 851 | | |
798 | 852 | | |
799 | | - | |
800 | | - | |
801 | | - | |
802 | | - | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
803 | 858 | | |
804 | 859 | | |
805 | 860 | | |
| |||
1116 | 1171 | | |
1117 | 1172 | | |
1118 | 1173 | | |
1119 | | - | |
1120 | | - | |
1121 | | - | |
1122 | | - | |
1123 | | - | |
1124 | 1174 | | |
1125 | 1175 | | |
1126 | 1176 | | |
1127 | 1177 | | |
1128 | 1178 | | |
1129 | 1179 | | |
1130 | 1180 | | |
| 1181 | + | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
1131 | 1192 | | |
1132 | 1193 | | |
1133 | 1194 | | |
| |||
1234 | 1295 | | |
1235 | 1296 | | |
1236 | 1297 | | |
1237 | | - | |
1238 | | - | |
1239 | 1298 | | |
1240 | 1299 | | |
1241 | 1300 | | |
| |||
1272 | 1331 | | |
1273 | 1332 | | |
1274 | 1333 | | |
1275 | | - | |
1276 | | - | |
| 1334 | + | |
| 1335 | + | |
| 1336 | + | |
1277 | 1337 | | |
1278 | 1338 | | |
1279 | 1339 | | |
| |||
1334 | 1394 | | |
1335 | 1395 | | |
1336 | 1396 | | |
1337 | | - | |
| 1397 | + | |
1338 | 1398 | | |
1339 | 1399 | | |
1340 | 1400 | | |
| |||
Lines changed: 60 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
308 | 308 | | |
309 | 309 | | |
310 | 310 | | |
311 | | - | |
312 | | - | |
313 | | - | |
314 | | - | |
315 | | - | |
316 | | - | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
317 | 315 | | |
318 | 316 | | |
319 | 317 | | |
320 | 318 | | |
321 | 319 | | |
322 | 320 | | |
323 | | - | |
324 | | - | |
325 | | - | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
326 | 324 | | |
327 | | - | |
328 | | - | |
329 | | - | |
| 325 | + | |
330 | 326 | | |
331 | 327 | | |
332 | 328 | | |
333 | 329 | | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
334 | 337 | | |
335 | 338 | | |
336 | 339 | | |
| |||
469 | 472 | | |
470 | 473 | | |
471 | 474 | | |
472 | | - | |
| 475 | + | |
473 | 476 | | |
474 | 477 | | |
475 | 478 | | |
| |||
536 | 539 | | |
537 | 540 | | |
538 | 541 | | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
539 | 584 | | |
540 | 585 | | |
541 | 586 | | |
542 | 587 | | |
543 | | - | |
| 588 | + | |
| 589 | + | |
544 | 590 | | |
545 | 591 | | |
546 | 592 | | |
| |||
0 commit comments