Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow noop tensor expand #67

Closed
wants to merge 6 commits into from
Closed

Conversation

swfsql
Copy link
Contributor

@swfsql swfsql commented Jun 17, 2024

Example related to #64

@swfsql swfsql closed this Jun 17, 2024
@swfsql
Copy link
Contributor Author

swfsql commented Jun 20, 2024

I'm re-opening because there is a simpler test, and also because if the PR is closed no new commits appear on it (which makes sense).

The added test is a R1<1> -> R1<1> (noop) expansion, and the test fails with:

assertion `left == right` failed
  left: ShapeTracker { dims: [1], indexes: [0], fake: [false], mask: [(0, 2147483647)], padding: [(0, 0)] }
 right: ShapeTracker { dims: [1, 1], indexes: [1, 0], fake: [false, true], mask: [(0, 2147483647), (0, 2147483647)], padding: [(0, 0), (0, 0)] }

Indicating that the noop expansion had changed the shape (undesired).

@swfsql swfsql reopened this Jun 20, 2024
@swfsql
Copy link
Contributor Author

swfsql commented Jun 20, 2024

I added a check on src == dst during shape expansion, and made it stop the actual shape modification in case it is the same.
But although the small test now passes, I still have some shape error in another test which is not a minimal example, so I'll keep trying to reduce or notice what is the error

@swfsql swfsql changed the title linear bias error example allow noop tensor expand Jun 20, 2024
@jafioti
Copy link
Owner

jafioti commented Jul 8, 2024

@swfsql I've just pushed a really large change which moves away from const generic shapes and to only using ShapeTracker runtime shape tracking. That means this PR is probably not nessecary anymore since we don't have a .expand() anymore, it's now .expand(axis, size).

I'm still interested in const generic shape tracking, but currently rust doesn't have enough support for const generic expressions, which made the code very complex (as you're seeing) and some models unrepresentable. Once better support on the rust langauge level is stablized, we can bring it back in.

@jafioti jafioti closed this Feb 7, 2025
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.

2 participants