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

No loss ids in truncated sequence (GPT2 model) #279

Open
ngavcc opened this issue Jun 6, 2023 · 0 comments
Open

No loss ids in truncated sequence (GPT2 model) #279

ngavcc opened this issue Jun 6, 2023 · 0 comments

Comments

@ngavcc
Copy link

ngavcc commented Jun 6, 2023

I am using GPT2 model + MixedTemplate for a text classification task
When i am training, an exception occur at reshape tensor operation
I have made some inspection and i realized that when input text is too long, it turn out that all value in loss_ids is zero, and model failed to train (exception at reshape tensor when model getting output for "mask" position)
This is an example of batch data (from PromptDataLoader), when i use batch size = 2048, i got loss_ids of shape torch.Size([2048, 128]), but when i sum it's elements value (loss_ids.sum()), i only get tensor(2047). that means one data instance get no loss_ids

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

1 participant