-
Notifications
You must be signed in to change notification settings - Fork 537
ConstraintViolationError #6782
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
Comments
Hi, @adonnini. Can you provide the dynamic shape constraints that you pass into export, as well as information about the model that you are exporting? Thanks! |
@GregoryComer thanks for the follow-up You can find the entire model with instructions on how to run it here Here is the line where I pass the model and the inputs
where Thanks |
According to this error message, it seems like one of your input tensor is having an unexpected size. Can you please print out the tensor shapes for It's a bit hard to tell from reading your code https://github.com/adonnini/adonnini-trajectory-prediction-transformers-masterContextQ/tree/main |
@larryliu0820 , Thanks for getting back to me The printout of the four variables themselves is very big. I thought that the information about the shapes is what your really wanted given your question. Below, you will find the output of the four print statements of the shapes of the four variables. Please note that the model runs successfully when excluding the executorch related code. Even with the executorch code, the frist epoch completes successfully. By the way, the fact that the shapes of dim 1 of enc_input and dec_input is different is not an issue for the model. As I said, the train_minimum.py runs successfully without the executorch code. You can try it yourself. Thanks
|
@angelayi do you have any suggestions? Is it worth an issue in pytorch/pytorch? |
By specifying To fix this you can make each of the dims different, or you can try a new thing, |
@angelayi Thanks for your suggestion. After making the change you suggested (I should have seen the error, Thanks), execution failes producing the error log reported below. @larryliu0820 I think the ball may be back in the executorch court. FYI, below you will also find the executorch related code (in train-minimum.py) ERROR LOG
CODE
|
Can you use the new torch.export.export API?
and the rest should be the same |
@larryliu0820 , I made the change you suggested. Execution failed with the same error. Please find below the error log and the code change I made. Did I make a mistake in making the change? ERROR LOG
CODE
|
What I meant is you can skip this line:
And do |
@larryliu0820 Sorry. I re-ran the code with the corrected code. There was progress (I think). Execution failed. ERROR LOG
CODE
|
@metascroy This goes into At the same time @adonnini we can also skip this pass - change your code to:
|
@larryliu0820 I made the change. Please find below update code and (big) error log. CODE
ERROR LOG(see attached file) |
@adonnini :) this is not helpful for debugging because it seems like it's just a graph dump. Someone from our side need to repro this locally and debug. I don't have the time right now but if you want to wait I may get back next week. |
@larryliu0820 Thanks for your help. I really appreciate it. I understand about your priorities. Would you mind if I check in with you in 1-2 weeks? |
@adonnini yeah ping me next week I'll spend some time repro your issue |
@larryliu0820 as we said, Just a reminder to take a look at this issue when you get a chance. Thanks |
@larryliu0820 Will you be able to take a look at this issue in the coming week? Sorry to bother you. Thanks |
@larryliu0820 sorry to bother you again. I know you must be very busy. Could you please take a look at this issue? Thanks |
This error means the tensor being viewed is dynamic, but the shape passed to the view was static. I wonder if it has something to do with the new Dim.AUTO feature @angelayi recommended not working with how ET does shape analysis. @adonnini, can you try making each of the dims different as Angela first recommended for the constrain violation error instead of using Dim.AUTO. |
@metascroy, I changed my code:
Unfortunately, execution failes with the same error. Please see traceback log below. Ami I wrong in thinking that by defining Thanks, Alex TRACEBACK LOG
|
I'm not familiar with your model, but the way you defined it says that enc_input, dec_input, dec_source_mask, and dec_target_mask must all have dimension 1 being equal (dim1_x). It does not look like this is the case, which is why you get a constraint violation error (12 != 7). Can you instead define up to 4 different dimension variables to capture the input shapes in your program, e.g.,
You need one dim variable for each variable dimension. If some of the dimensions are equal, you'd use fewer dim variables.
This says that the last 3 tensors must be the same size (dec_seq_length) at dimension 1, but the first tensor has a different dynamic size there (enc_seq_length). This is just for illustration. You need to define the dynamic inputs for your model. |
@metascroy , Thanks very much for your feedback. I really appreciate it. I followed your suggestion (to the letter). Not unexpectedly, execution still fails. You will find the traceback log below. It still appears that dynamic shapes are not handled correctly. I could follow the suggestion contained in the traceback log but I don't think it would not work as the shapes are dynamic. Should I change the range with starting value 2 instead of 1? Please let me know what you think and what I did wrong. Thanks TRACEBACK LOG
|
@metascroy, are you back from the holiday break? If you are you are probably swamped. I hope you will have a chance to take a look at my response to your message immediately above. Thanks |
I hope someone is still looking at this issue. I just set up Executorch 0.5 and ran my model again. Execution failed with the same Below you will find the complete execution and error log. Please let me k now if you have any questions and what I should do next. Thanks EXECUTION AND ERROR LOG
|
@adonnini I'm trying to understand where the issue with your flow is: Can you share your export command, with dynamic shapes and provided example_inputs. |
Thanks for getting back to me. I appreciate it. To start with, below you will find all the Executorch related code I am using to create the model. I am sorry I am not sure what you mean by "provided example_inputs". Could you please clarify? Please let me know if you need anything else. Thanks EXECUTORCH RELATED CODE IN MODEL TRAINING MODULE
|
By example inputs, I just meant the stuff passed to export. It looks like you linked this repo for reproducing your error: https://github.com/adonnini/adonnini-trajectory-prediction-transformers-masterContextQ/ But I don't see the above code in the repo. What python file do I run to reproduce your error? |
You can find the "stuff" passed to export here: You can find the values of the variables here: The code I sent you is in The instructions for running the model (and the executorch code) are in |
@metascroy I realize this is not a priority. Did oyu get a chance to run my code following the links and instructions I gave you in my last message three weeks ago? Please let me know if you have any questions or need anything else. Thanks |
Hi,
I just upgraded to executorch 0.4 and ran my code which previously failed as described in
#1350
Now it fails with
ConstraintViolationError
Please find the error log below.
Please let me know if you need additional information.
Thanks
ERROR LOG
The text was updated successfully, but these errors were encountered: