Closed mtsokol closed 2 months ago
@willow-ahrens Here's the output of the debug mode for .*
broadcasting that works correctly:
plan = c[:, :, nothing] .* a[:, nothing, :] .* b[nothing, :, :];
compute(plan, verbose=true);
And here's the output of the debug mode for broadcast
broadcasting (used internally by finch-tensor
) that we're debugging:
plan = broadcast(*, broadcast(*, c[:, :, nothing], a[:, nothing, :]), b[nothing, :, :]);
compute(plan, verbose=true);
I think the key difference (that I found with https://www.diffchecker.com) is in:
A6[i11, i12, i20] << Finch.FinchNotation.InitWriter{0.0}() >>= (*)((*)(A0[i11, i12], A2[i11, i20]), A4[i12, i20])
vs
A7[i21, i30, i31] << Finch.FinchNotation.InitWriter{0.0}() >>= (*)((*)(A0[i21, 1], A2[i21, 1]), A5[i30, i31])
For some reason for broadcast(...)
a 1
was placed there instead of the index. WDYT?
I think it's during broadcasting that an index would be replaced with 1
, right @willow-ahrens? That would mean that the "broadcast indices" are somehow at an incorrect location.
Hi @willow-ahrens,
Here's a reproduction code for broadcasting issue that I found while implementing SDDMM: