Skip to content

More ops#1

Merged
kali merged 26 commits into
masterfrom
more_ops
Apr 23, 2018
Merged

More ops#1
kali merged 26 commits into
masterfrom
more_ops

Conversation

@kali
Copy link
Copy Markdown
Collaborator

@kali kali commented Apr 14, 2018

No description provided.

@kali kali merged commit d36c342 into master Apr 23, 2018
@kali kali deleted the more_ops branch April 23, 2018 19:51
tbluche added a commit that referenced this pull request Jul 5, 2019
kali pushed a commit that referenced this pull request Jul 12, 2019
kali pushed a commit that referenced this pull request Oct 10, 2020
Grabbing the latest version
kali added a commit that referenced this pull request Apr 28, 2026
The change_axes impl on MultiBroadcastTo introduced in 106f605
("more decluttering around broadcast and axes op") accepted any
AxisOp whose change_shape succeeds on self.shape, and (worse) used
recip() for the io=Input case so an Rm at the input grew self.shape
instead of shrinking it. This let an Rm propagate through a broadcast
into a Source with a non-trivial dim.

Reproducer: \`tract trunet_dummy.nnef.tgz --nnef-tract-core --pulse 1
-O bench\`. ChangeAxes proposes Rm(1) on a Const initial-state, the
change traverses a MultiBroadcastTo into a Scan input, the Scan
recurses into its body, and a Source whose dim 1 is the streaming
symbol S bails with "Removing non-trivial axis #1 of dim: 1,S,32".
Scan's try_body_axes_change passes that bail through with `?`, so the
whole declutter pass aborts, and the bundle CI entrypoint that runs
trunet net_bench dies under set -e.

Fix: only accept axis changes on MultiBroadcastTo when the touched
axes are passthrough — i.e. input and output shapes agree there.
Touching a true broadcast axis (input=1, output=N) cannot be safely
propagated in either direction. The recip() switch is dropped: for
MultiBroadcastTo the input-side and output-side shapes track each
other directly.

Also reject Move on rank-mismatched inputs.

trunet net_bench now passes; tract-core lib (231) and test-unit-core
(777) stay green.
kali added a commit that referenced this pull request Apr 29, 2026
The change_axes impl on MultiBroadcastTo introduced in 106f605
("more decluttering around broadcast and axes op") accepted any
AxisOp whose change_shape succeeds on self.shape, and (worse) used
recip() for the io=Input case so an Rm at the input grew self.shape
instead of shrinking it. This let an Rm propagate through a broadcast
into a Source with a non-trivial dim.

Reproducer: \`tract trunet_dummy.nnef.tgz --nnef-tract-core --pulse 1
-O bench\`. ChangeAxes proposes Rm(1) on a Const initial-state, the
change traverses a MultiBroadcastTo into a Scan input, the Scan
recurses into its body, and a Source whose dim 1 is the streaming
symbol S bails with "Removing non-trivial axis #1 of dim: 1,S,32".
Scan's try_body_axes_change passes that bail through with `?`, so the
whole declutter pass aborts, and the bundle CI entrypoint that runs
trunet net_bench dies under set -e.

Fix: only accept axis changes on MultiBroadcastTo when the touched
axes are passthrough — i.e. input and output shapes agree there.
Touching a true broadcast axis (input=1, output=N) cannot be safely
propagated in either direction. The recip() switch is dropped: for
MultiBroadcastTo the input-side and output-side shapes track each
other directly.

Also reject Move on rank-mismatched inputs.

trunet net_bench now passes; tract-core lib (231) and test-unit-core
(777) stay green.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant