-
Notifications
You must be signed in to change notification settings - Fork 536
dynamic_dim error - The following dimensions have been specialized and CANNOT be dynamic #1379
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
@kimishpatel What makes executorch decide: I tried to use dynamic_dim support and failed. I will try disabling memory planning next. I am not optimistic. What do you advise I do at this point? Should I simply sit tight and wait for (I am not sure what)? I can' believe that the model I use is one-of-a-kind. In fact, it's a pretty mainstream model. It would be very useful to have a "cookbook" for addressing issues such as the ones I have encountewred unless you believe I ran into them because it's still early in the executorch development cycle. Thanks for your help and patience |
Journey of eager/python model to executorch includes
Failure you see is happening in the first step. @angelayi can you take a look, please? Another thing I suspect is how dec_source_mask and dec_target_mask need to also specify dynamic dim as it may related to dec_input. @angelayi can you help with this? If they are then maybe we need better error messages.
No this totally makes sense. SInce this is in export @angelayi do you know if issues of this nature hvae been addressed before. On executorch side, as we see issues of this nature, we need to add them to FAQ and redirect appropriaately. @adonnini thanks for going through all this trouble. It is super helpful to us as well. |
It will also be useful if you share your |
@ here is my executorch related code:
|
@kimishpatel thanks for your response. At this point, you should assume that decoder input is dynamic. Please let me know if you need additional information or you need me to do anything. Thanks |
@adonnini Kimish mentioned this before, but it seems like the shape of |
I will double check to be sure. I will let you know if they are not. Thanks. |
@angelayi I double checked. |
@adonnini did you change your constraints to be the following?
|
@angelayi my constraints are currently:
Do you want me to change them to:
? |
@angelayi I changed the constraints as you suggested. Execution failed . the tracebac log included this:
I made the change suggested above. Execution still failed. Below is the complete traceback log. Please note that in my code passes[] is commented out:
|
I can send out a fix for that on the export side, but I don't think executorch can handle those ops either. cc @larryliu0820 |
@angelayi where/when could I get the fix? |
@angelayi Thanks. I know it may not be the "best practice" way of doing things, but could I simply replace on my system the modules you changed with your commit with the updated ones? |
@adonnini I'm not sure what you mean, but if it works for you then it should be fine! |
Fixes #108830 and pytorch/executorch#1379 (comment) Pull Request resolved: #115854 Approved by: https://github.com/zhxchen17
@angelayi my simplistic approach to using the updated torch.export was completely off-base.. The fixes don't have anything to do with executorch per se. I forgot that key point. |
Fixes pytorch#108830 and pytorch/executorch#1379 (comment) Pull Request resolved: pytorch#115854 Approved by: https://github.com/zhxchen17
Fixes #108830 and pytorch/executorch#1379 (comment) Pull Request resolved: #115854 Approved by: https://github.com/zhxchen17
Fixes pytorch#108830 and pytorch/executorch#1379 (comment) Pull Request resolved: pytorch#115854 Approved by: https://github.com/zhxchen17
@angelayi I commented out Please let me know if/what I should do to help address this issue. Thanks
|
@angelayi I tried using the 12/22 nightly build in case the bug had been fixed. The result was the same |
Hi @angelayi can you suggest a next step I could take to resolve the problem? I am a bit stuck and cannot proceed with some of my work until I resolve this issue. Thanks |
Can you update everything to the latest nightlies? |
@angelayi Thanks. I am in the process of following your instructions. Completed steps 1 and 2. |
@adonnini You mentioned that you "commented out import torchvision in the trainer as it is not used (because I commented out other code that depended on it)". I thought that meant that you modified model code? |
@angelayi Ah, I see. Sorry. OK. I did run the modified model. On to steps 3 and 4 |
@angelayi unfortunately code execution still fails Below you will find:
Please let me know if you need anything else or if I should do something else. Thanks CODE
TRACEBACK LOG PRODUCED USING
TRACEBACK LOG PRODUCED SETTING
|
Seems like we've reached a new error message -- It looks like it's pointing to the line:
What is this |
ok, I found your repo and made a minimum repro:
Why are you using Variable? It looks like it's deprecated: https://pytorch.org/docs/stable/autograd.html#variable-deprecated But also it seems like you're just using it to set |
After reading this comment, please red the next one which I am about to post The "Variable" issue could be a red herring. I am aware that Variable is deprecated. I ran into the same error when lowering the model onto an Android device using pytorch mobile and torchscript. When running the training code, execution failed with this error after running five epochs (the first four epochs were successful). The solution was to comment out the validation loop executed after each training execution within the epoch loop. Before using the above solution, I tried fixing the "Variable" problem replacing in model.py
with
this was a "clumsy" solution (please keep in mind that I am a Java developer) but it did the job. However, execution then failed with another error. The same happened in this case. I used the same solution as described above. The validation loop is sill commented out. However, execution still failed. Below you will find the latest traceback log. Please note that the statement with Variable in model.py does not cause any problems when running the model with all executorch code commented out. Thanks TRACEBACK LOG
|
@angelayi
I changed it to
where
Now, execution fails producing the traceback log reported below. Thanks TRACEBACK LOG
def specializations(enc_input, dec_input, dec_source_mask, dec_target_mask):
def specify_constraints(enc_input, dec_input, dec_source_mask, dec_target_mask):
def specializations(enc_input, dec_input, dec_source_mask, dec_target_mask):
def specify_constraints(enc_input, dec_input, dec_source_mask, dec_target_mask):
|
Makes sense, I think any old code with
Just to clarify, ExecuTorch does not have training support right now. It's only for inference.
Regarding the first error, it looks like your code first calls
Regarding the second error, the error message tells you how to fix it. While tracing, it was found that dec_input, dec_source_mask, and dec_target_mask were found to be equal to each other. So you need to add the following additional constraints:
|
@angelayi Thanks! I made the changes you suggested. Below you will find the code changes I made and the traceback log produced after the changes. I am sorry about this. Thanks for all your help in helping me resolve this problem. CODE CHANGES
TRACEBACK LOG
|
I tried an experiment. I went back to first principles, so to speak, and changed the executorch code in my training module to follow exactly what is contained in
I wonder what you make of this. Thanks CODE
TRACEBACK LOG
|
@adonnini I looked at your last response for like 30 seconds so ignore if it doenst make sense. to_backend API now takes instance of the class and not just class (doc will have to be updated) . So no XnnpackPartitioner but XnnpackPartitioner(). |
@kimishpatel Thanks! I made the change
to
The same error occurred. I seem to remember that |
@adonnini Here are the APIs for to_backend. Since you're using the partitioner, you should be doing
or
|
@angelayi Thanks. I had already tried to use I also tried using it worked too. Here is my code:
B
However, unfortunately, in both cases execution failed when saving the file on disk with the following traceback:
|
you need to do
|
@angelayi Progress! with one small change to your suggestion, |
@angelayi I aleady went through the process described in |
sounds good! :> |
I added dynamic_dim support to my model. Execution failed. Please find the full traceback log below.
My constrains are defined as follows:
Is there a way to resolvew this error? How should I proceed?
Thanks
def specializations(enc_input, dec_input, dec_source_mask, dec_target_mask):
# enc_input:
assert enc_input.size()[0] == 27
assert enc_input.size()[1] == 7
assert enc_input.size()[2] == 2
The text was updated successfully, but these errors were encountered: