Repository navigation
Commit 04f9002
[ET-VK] Fix squeeze_copy of the outermost dim under dynamic shapes
add_squeeze_copy_dims_node() skips dim 0 and falls back to
add_clone_node(). resize_clone_node() only propagates sizes when input
and output have the same dim count, which a squeeze never does, so the
output keeps the extents it was built with.
With static shapes that is invisible. With dynamic shapes the output
holds its upper-bound extents while consumers read it at the real size,
so the copy lands in the wrong places and roughly half the output comes
back zeroed -- silently, with no error.
Route dim 0 through the permute path like every other squeeze dim;
resize_permute_node() already has an explicit branch for the
rank-reducing case.
Repro: any model that ends up with torch.cat(list(x), -1) over a rank-4
tensor with a dynamic dim. The unbind lowers to slice_copy plus
squeeze_copy.dims, and the second slice comes back zeroed for every
extent below the bound. Reduced to a 15-line case: y[1:2] is correct
while y[1:2].squeeze(0) returns exactly half zeros (cosine 0.704 = sqrt
of 0.5 against the reference), correct only at the bound.
Verified on a Galaxy S26 Ultra (Adreno 840): the reduced case goes from
0.704 to 1.000000 at extents 200, 500 and 1000, and a TTS model whose
classifier-free-guidance batch is built this way goes from cosine 0.36
to 0.99993 against its CPU reference.1 parent eadb4c3 commit 04f9002
1 file changed
Lines changed: 12 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
27 | 26 | | |
28 | 27 | | |
29 | 28 | | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
34 | 40 | | |
35 | 41 | | |
36 | 42 | | |
37 | 43 | | |
38 | 44 | | |
39 | 45 | | |
40 | | - | |
| 46 | + | |
41 | 47 | | |
42 | 48 | | |
43 | 49 | | |
| |||
0 commit comments