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

Import integration libraries first #7650

Merged
merged 9 commits into from Oct 9, 2020
Merged

Import integration libraries first #7650

merged 9 commits into from Oct 9, 2020

Conversation

dsblank
Copy link
Contributor

@dsblank dsblank commented Oct 7, 2020

What does this PR do?

This PR restores the order of importing 3rd-party integrations before other ML frameworks, and before any other transformer modules.

Before PR:

  • importing comet_ml later causes an error

After PR:

  • using comet_ml functionality is restored

Copy link
Collaborator

@sgugger sgugger left a comment

Choose a reason for hiding this comment

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

Thanks for the PR and sorry to have moved your imports. Will remember that for next time (though not sure there will be a next time since I'm done with the Trainer cleanup :-) )

While I understand the need for testing, I'm not sure about adding integrations to our "testing" dependency env (and have those tests for integration run on every commit). Maybe creating another dependency env that we would install on our slow tests would be better.

setup.py Outdated
@@ -90,7 +90,9 @@
extras["all"] = extras["serving"] + ["tensorflow", "torch"]

extras["retrieval"] = ["faiss-cpu", "datasets"]
extras["testing"] = ["pytest", "pytest-xdist", "timeout-decorator", "parameterized", "psutil"] + extras["retrieval"]
extras["testing"] = ["pytest", "pytest-xdist", "timeout-decorator", "parameterized", "psutil", "comet_ml"] + extras[
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not fond of adding integrations to the "testing" extra dependency as they are already quite a few of them (between logging and hyperparameter search) and it would then slow down our CI quite a bit to install everything (on every commit).

We can add a "testing-integrations" flag if we want to add some tests that we run on a slower schedule (like once a day).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Totally agree! I think we'll create a new repo for testing, and run often so we can catch errors likes this. Shall I remove the test commits, or do you want to cherry pick?

Copy link
Collaborator

Choose a reason for hiding this comment

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

If you can remove them it's easier for me to merge :-)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No problem, will do.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

All done! (since I touched setup.py, black insists on reformatting it. Not sure how to get it back to original state without re-running black on it, without creating a new PR.)

Copy link
Collaborator

Choose a reason for hiding this comment

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

As long as the CI is happy, I'm good with the change ;-) Thanks!

@sgugger sgugger merged commit 9618cd6 into huggingface:master Oct 9, 2020
fabiocapsouza pushed a commit to fabiocapsouza/transformers that referenced this pull request Nov 15, 2020
* Import intergration libraries first

* isort and black happiness

* flake8 happiness

* Add a test

* Black reformat

* Ignore import order in tests

* A heavy-handed method of disabling comet for tests

* Remove comet_ml tests

* Run black on setup.py
fabiocapsouza added a commit to fabiocapsouza/transformers that referenced this pull request Nov 15, 2020
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.

None yet

2 participants