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

TST: Update torch.compile tests and docs #2332

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

BenjaminBossan
Copy link
Member

We have tests to check if torch.compile works for various PEFT methods and "advanced" features (QLoRA, merging, ...). These tests are not run on a regular basis, but are triggered manually. As such, it was time to revisit them.

So far, a few of these tests were marked as xfailing. All these tests are passing now. The reasons for this:

  • Presumably: New PyTorch version (I haven't checked older); to wit, running the torch.compile tests without changes leads to failures because of strict xfail
  • Loosening some tolerances
  • Remove a spurious argument added by torch.compile
  • Slightly adjust order of when torch.compile is called

The docs have been updated to reflect these new findings.

Note that the torch.compile tests don't run on regular CI. I ran the tests locally and they passed for me.

We have tests to check if torch.compile works for various PEFT methods
and "advanced" features (QLoRA, merging, ...). These tests are not run
on a regular basis, but are triggered manually. As such, it was time to
revisit them.

So far, a few of these tests were marked as xfailing. All these tests
are passing now. The reasons for this:

- Presumably: New PyTorch version (I haven't checked older)
- Loosening some tolerances
- Remove a spurious argument added by torch.compile
- Slightly adjust order of when torch.compile is called

The docs have been updated to reflect these new findings.
Copy link
Collaborator

@githubnemo githubnemo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, one question out of interest

model.add_adapter("other", config)
model = self.compile(model, {})
model.eval()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it a requirement to only call compile once?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From my testing, torch.compile needs to be called after loading all adapters. I extended the docs to say so in my last commit.

... when using multiple adapters
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.

2 participants