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

Received a fatal error!! #16

Open
znsoftm opened this issue Aug 11, 2022 · 10 comments
Open

Received a fatal error!! #16

znsoftm opened this issue Aug 11, 2022 · 10 comments

Comments

@znsoftm
Copy link

znsoftm commented Aug 11, 2022

test fewshot.py, get the below fatal error.

pytorch 1.10.0

for step, inputs in enumerate(train_dataloader):
            if use_cuda:
                inputs = inputs.cuda()
            logits = prompt_model(inputs)
            labels = inputs['label']
            loss = loss_func(logits, labels)
            loss.backward()  # it causes the fatal error.
            torch.nn.utils.clip_grad_norm_(prompt_model.parameters(), 1.0)
        
            tot_loss += loss.item()
            
            optimizer1.step()

one of the variables needed for gradient computation has been modified by an inplace operation: [torch.cuda.FloatTensor [20, 1076]], which is output 0 of SoftmaxBackward0, is at version 1; expected version 0 instead. Hint: the backtrace further above shows the operation that failed to compute its gradient. The variable in question was changed in there or anywhere later. Good luck!

@znsoftm
Copy link
Author

znsoftm commented Aug 11, 2022

Browsed much materials, pytorch 1.4 or below can support it. wish somebody can fix it.

@ShengdingHu
Copy link
Collaborator

I run on pytorch 1.9.0. But it is strange that it requires 1.4 or below to solve the bug. Can you start a new virtual environment and test it?

@znsoftm
Copy link
Author

znsoftm commented Aug 16, 2022

Is it correct on pytorch 1.9.0?
To create a virtual env is difficult. Pytorch 1.4 or below is not compatible with cuda 11.7. Guess need to downgrade my cuda? (not cudatoolkit)

@znsoftm
Copy link
Author

znsoftm commented Aug 16, 2022

After verification, pytorch 1.9 does not work!
pytorch 1.9, cuda 11.7, python 3.8. nvidia 3090

@znsoftm
Copy link
Author

znsoftm commented Aug 16, 2022

Maybe you guys should fix it in openprompt.

@znsoftm
Copy link
Author

znsoftm commented Aug 16, 2022

For torch 1.4, we found that transofrmers complains torch>=1.5.0 is required for a normal functioning of this module, but found torch==1.4.0+cu92.
Could you please tell us what configuration you are using ?

@znsoftm
Copy link
Author

znsoftm commented Aug 16, 2022

openprompt 1.0.1 pytorch 1.9, cuda 11.6/7
for fewshot.py, it doesn't work.
For pytorch 1.4, it is impossible, because transformer 4.2 needs the version 1.5 of pytorch.
please verify the combination: pytorch 1.9 or above, cuda 11.6/7 openprompt 1.01 ( up-to-date)

@Knightzhr
Copy link

can u run fewshot.py? i have the same error

@znsoftm
Copy link
Author

znsoftm commented Mar 25, 2023

No, we can not.

@BaoZi-chu
Copy link

I had the same issue, did anyone fix it

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

No branches or pull requests

4 participants