Skip to content

Conversation

@SunMarc
Copy link
Member

@SunMarc SunMarc commented May 28, 2025

What does this PR do?

This PR does the following:

  • Move FlashAttentionKwargs and ForCausalKwargs to generic folder
  • Better handle kwargs check for gradient accumulation ( now we also check that we have the LossKwargs typing, otherwise, we disable the fix)
  • Extend forward function with LossKwargs typing
  • Better tests to see which model still needs to be fixed !

How to test

RUN_SLOW=True CUDA_VISIBLE_DEVICES=0 pytest tests/models/ -k "test_model_accepts_loss_kwargs" -s -vvvvv

Remaining work :

176 failed, 154 passed, 75 skipped, 95268 deselected, 8 warnings in 84.25s (0:01:24)

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

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

Successfully merging this pull request may close these issues.

3 participants