Repository navigation
Commit afc7957
Vulkan: do not partition constant_pad_nd with a symbolic pad
A pad amount derived from a dynamic dimension is serialized as a VALUELIST of
Int/SymInt, and Pad.cpp reads the list with get_int_list(), which requires a
literal IntList. The partitioner claims the node regardless, so the model
lowers and then aborts at prepack:
Exception raised from toIntList at .../graph/containers/Value.h:272:
(isIntList()) is false! Expected value to have type IntList, got VALUELIST
This is reachable from ordinary code. Any model that pads a dynamic sequence up
to the static length its LSTM wants hits it, which is how kokoro's synthesizer
fails: `F.pad(x, (0, 0, 0, target - seq_len))`.
Supporting it properly is more than swapping in extract_int_or_symint_list(),
the way Split.cpp, View.cpp and Expand.cpp read their symbolic lists.
add_constant_pad_nd_node() folds the amounts into a per-dim offset and bakes
that into a params buffer at build time, so the dispatch would use stale
offsets even if the list were read symbolically; the buffer has to be refreshed
on resize first. Decline the node until then, so it falls back rather than
aborting.
The existing test_vulkan_backend_constant_pad_nd pads by a literal
(1, 2, 3, 4, 5, 6), so no test covered a symbolic pad. The new case aborts on
main and falls back cleanly with this change.1 parent 5c5c9ee commit afc7957
2 files changed
Lines changed: 48 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1507 | 1507 | | |
1508 | 1508 | | |
1509 | 1509 | | |
| 1510 | + | |
| 1511 | + | |
| 1512 | + | |
| 1513 | + | |
| 1514 | + | |
| 1515 | + | |
| 1516 | + | |
| 1517 | + | |
| 1518 | + | |
| 1519 | + | |
| 1520 | + | |
| 1521 | + | |
| 1522 | + | |
| 1523 | + | |
| 1524 | + | |
| 1525 | + | |
| 1526 | + | |
| 1527 | + | |
| 1528 | + | |
| 1529 | + | |
| 1530 | + | |
1510 | 1531 | | |
1511 | 1532 | | |
1512 | 1533 | | |
1513 | 1534 | | |
1514 | 1535 | | |
1515 | 1536 | | |
| 1537 | + | |
1516 | 1538 | | |
1517 | 1539 | | |
1518 | 1540 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1479 | 1479 | | |
1480 | 1480 | | |
1481 | 1481 | | |
| 1482 | + | |
| 1483 | + | |
| 1484 | + | |
| 1485 | + | |
| 1486 | + | |
| 1487 | + | |
| 1488 | + | |
| 1489 | + | |
| 1490 | + | |
| 1491 | + | |
| 1492 | + | |
| 1493 | + | |
| 1494 | + | |
| 1495 | + | |
| 1496 | + | |
| 1497 | + | |
| 1498 | + | |
| 1499 | + | |
| 1500 | + | |
| 1501 | + | |
| 1502 | + | |
| 1503 | + | |
| 1504 | + | |
| 1505 | + | |
| 1506 | + | |
| 1507 | + | |
1482 | 1508 | | |
1483 | 1509 | | |
1484 | 1510 | | |
| |||
0 commit comments