Commit d665c19
Fix pipelined sampling corruption: use per-call execution descriptor
The MPSGraphCompositeSampler reused a single
MPSGraphExecutableExecutionDescriptor across all pipelined steps.
Under pipelined execution (depth > 1), overlapping runAsync calls
on the same executable corrupt intermediate scratch buffers when
sharing a descriptor, producing garbled output (word repetitions,
doubled punctuation) with temperature > 0.
Create a fresh descriptor per encode() call, matching the pattern
MPSGraphArgmaxSampler already uses.1 parent cba2c84 commit d665c19
1 file changed
Lines changed: 5 additions & 4 deletions
Lines changed: 5 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
496 | 496 | | |
497 | 497 | | |
498 | 498 | | |
499 | | - | |
500 | 499 | | |
501 | 500 | | |
502 | 501 | | |
| |||
678 | 677 | | |
679 | 678 | | |
680 | 679 | | |
681 | | - | |
682 | 680 | | |
683 | 681 | | |
684 | 682 | | |
| |||
725 | 723 | | |
726 | 724 | | |
727 | 725 | | |
728 | | - | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
729 | 730 | | |
730 | 731 | | |
731 | 732 | | |
| |||
743 | 744 | | |
744 | 745 | | |
745 | 746 | | |
746 | | - | |
| 747 | + | |
747 | 748 | | |
748 | 749 | | |
749 | 750 | | |
| |||
0 commit comments