facebookresearch / optimizers

For optimization algorithm research and development.
Other
442 stars 31 forks source link

Fix setuptools config #39

Closed francois-rozet closed 1 week ago

francois-rozet commented 1 week ago

Closes #38.

The issue is that setuptools is not allowed to search for sub-modules (notably utils) with the current configuration. Using package discovery solves this issue.

facebook-github-bot commented 1 week ago

Hi @francois-rozet!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

facebook-github-bot commented 1 week ago

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

runame commented 1 week ago

Thanks for the fix, was just about to tackle this issue!

Can you modify the tests to not use -e, so they will catch if something with the setup breaks again? The lines to change are here and here.

runame commented 1 week ago

Thanks for adjusting the tests! I didn't include the mypy type checking because it will detect a duplicate module in build/lib/. So I think we should just keep using -e for this one, otherwise we have to use the --exclude flag or something like that.

Not sure what happened to the GPU tests though.

francois-rozet commented 1 week ago

I didn't include the mypy type checking

My bad, I'll revert.

Not sure what happened to the GPU tests though.

Not sure either :/ I did not change anything else in the codebase, so it seems weird that it would fail? Can you launch the tests on the master branch?

francois-rozet commented 1 week ago

Note that the "profiler function will be ignored" error is also present in the main branch, but not the segmentation fault.

runame commented 1 week ago

Yes, the issue seems unrelated to that. I just reran the test on main and it still works (see here).

tsunghsienlee commented 1 week ago

I didn't include the mypy type checking

My bad, I'll revert.

Not sure what happened to the GPU tests though.

Not sure either :/ I did not change anything else in the codebase, so it seems weird that it would fail? Can you launch the tests on the master branch?

I am reruning the GPU tests now in CI, let's see how it works. This should not affect GPU tests.

tsunghsienlee commented 1 week ago

It seems dropping the -e caused this GPU tests failure. Maybe we could consider bring back -e for .github/workflows/gpu-tests.yaml for now so we could merge this?

runame commented 1 week ago

Agreed. But we should check if this issue also occurs outside of the GitHub runner, i.e. if installing without -e and running the tests on GPU causes the same issue on a different machine.

francois-rozet commented 1 week ago

Let's go for that (but keep in mind that this bug should be investigated). I am away from my laptop, but if you make a code suggestion (in a review comment) I can merge it from my phone.

tsunghsienlee commented 1 week ago

BTW, I don't think -e should affect how the test works but especially after I read the https://stackoverflow.com/questions/35064426/when-would-the-e-editable-option-be-useful-with-pip-install. However, our CPU tests are still passing but GPU tests are not tell something we might want to investigate later then.

facebook-github-bot commented 1 week ago

@tsunghsienlee has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

tsunghsienlee commented 1 week ago

Thanks @francois-rozet and @runame , let's merge this for now to unblock others.

facebook-github-bot commented 1 week ago

@tsunghsienlee merged this pull request in facebookresearch/optimizers@8a3feef1b045f786b4aefd31635ad65c178b9911.