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

When wrapping T5 (from huggingfaces' transformers) with Pytorch-lightning, the loss changes. Meanwhile different max length (all of them are large than the actual length) of the source sentence lead to different loss value? #12533

Closed
SinclairCoder opened this issue Mar 30, 2022 · 0 comments
Labels
needs triage Waiting to be triaged by maintainers

Comments

@SinclairCoder
Copy link

🐛 Bug

Bug #1: Different losses when using T5 (from huggingfaces' transformers) with Pytorch-lightning or not. I think they should be the same.

  • Test the result of huggingfaces' transformers: here
  • Test the result of pytorch-lightning: here

Bug #2: Different losses when using different max_input_len (all of them are larger than actual sentence length) with pytorch-lightning, but huggingfaces' transformers could output the same loss.

  • Test the results of huggingfaces' transformers using different max_input_len: here . The loss is the same.
  • Test the result of pytorch-lightning: here. The loss is significantly different from each other.

To Reproduce

See the description above.

Expected behavior

See the description above.

Environment

  • PyTorch Lightning Version (e.g., 1.5.0): 1.6.0
  • PyTorch Version (e.g., 1.10): 1.10.0
  • Python version (e.g., 3.9): 3.7.11
  • OS (e.g., Linux): Linux
  • CUDA/cuDNN version: 11.3
  • GPU models and configuration: NVIDIA RTX 3090
  • How you installed PyTorch (conda, pip, source): conda
  • If compiling from source, the output of torch.__config__.show():
  • Any other relevant information:

Additional context

@SinclairCoder SinclairCoder added the needs triage Waiting to be triaged by maintainers label Mar 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage Waiting to be triaged by maintainers
Projects
None yet
Development

No branches or pull requests

1 participant