Add support for Moonshine ONNX export (& seq2seq models with non-legacy cache & Tensor.repeat_interleave)#2162
Merged
Merged
Conversation
4 tasks
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
Tensor.repeat_interleave)Tensor.repeat_interleave)
Contributor
Author
|
Edit: Fixed ✅ (current failing tests unrelated) |
Comment on lines
+201
to
+202
| # TracerWarning: Using len to get tensor shape might cause the trace to be incorrect. Recommended usage would be tensor.shape[0]. Passing a tensor of different shape might lead to errors or silently give incorrect results. | ||
| PatchingSpec(torch.Tensor, "__len__", lambda x: x.shape[0], torch.Tensor.__len__), |
Member
There was a problem hiding this comment.
GREAT ! Thanks for omitting this !
| # is of type tensor. By default, it is assumed that the output names mentioned in the ONNX config | ||
| # match the outputs in order. | ||
| filterd_outputs = {} | ||
| filtered_outputs = {} |
Member
There was a problem hiding this comment.
nice catch ! I'm embarrassed by the amount of times I've modified this file without seeing this x)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
This PR does the following:
torch.Tensor.repeat_interleave, which are unable to export due to a bug in pytorch:torch.onnx.export(dynamo=False) fails with uninformative error when exportingapply_rotary_pos_emb/repeat_interleavepytorch/pytorch#145100. Note that this bug most likely won't be fixed as the pytorch team transitions to the new dynamo-based exporter.Fixes # (issue)
Before submitting
Who can review?