Install 3rd party libraries in CI for lint#3580
Install 3rd party libraries in CI for lint#3580contramundum53 merged 32 commits intooptuna:masterfrom
Conversation
|
|
Codecov Report
@@ Coverage Diff @@
## master #3580 +/- ##
=======================================
Coverage 90.56% 90.57%
=======================================
Files 164 164
Lines 12646 12652 +6
=======================================
+ Hits 11453 11459 +6
Misses 1193 1193
📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more |
| def on_init_start(self, trainer: Trainer) -> None: | ||
| self.is_ddp_backend = trainer._accelerator_connector.distributed_backend is not None | ||
| self.is_ddp_backend = ( | ||
| trainer._accelerator_connector.distributed_backend is not None # type: ignore |
There was a problem hiding this comment.
distributed_backend has been removed. Lightning-AI/pytorch-lightning#10017
See also #3418.
|
Checks CI passed. Now, this PR is ready for review. |
|
@toshihikoyanase Could you review this PR? |
toshihikoyanase
left a comment
There was a problem hiding this comment.
Thank you for your PR. The type checking in Python is getting more and more popular, and it may be a good time to introduce more strict checking. On the other hand, I'm not confident with the change in terms of developers' experience.
The change will increase the duration of the checks jobs from 1 min to 15 min. I see some developers use the jobs instead of a local linter and their turn-around time will also increase. Also, the required CI jobs might be more fragile to the update of third-party libraries.
Not a strong opinion, but how about adding this strict checks job to daily CI?
Currently, the daily CI is mainly checked by the committers and it hardly affects external developers.
|
This pull request has not seen any recent activity. |
|
I talked with @not522 , and they will move this strict lint to daily CI. Keep this PR as it is, please. |
|
This pull request has not seen any recent activity. |
|
If we install recent optuna/integration/xgboost.py:79: error: Name "xgb.core.CallbackEnv" is not defined
optuna/integration/xgboost.py:100: error: Name "xgb.core.CallbackEnv" is not definedhttps://github.com/optuna/optuna/runs/6552734319?check_suite_focus=true On the other hand, the errors will not be raised when we do not install optuna/integration/xgboost.py:7[9](https://github.com/optuna/optuna/runs/6912328489?check_suite_focus=true#step:8:10): error: Unused "type: ignore" comment
optuna/integration/xgboost.py:100: error: Unused "type: ignore" commenthttps://github.com/optuna/optuna/runs/6912328489?check_suite_focus=true IMO, we can omit the type check of older xgboost, for example, by using |
This reverts commit d4bb34d.
|
I found following errors.
For 1, we need to wait. |
| python -m pip install -U pip | ||
| pip install --progress-bar off -U .[checking] | ||
| pip install --progress-bar off -U .[optional] | ||
| pip install --progress-bar off -U .[integration] --extra-index-url https://download.pytorch.org/whl/cpu | ||
| pip install --progress-bar off -U .[benchmark] | ||
| pip install --progress-bar off -U bayesmark | ||
| pip install --progress-bar off -U kurobako |
There was a problem hiding this comment.
Skip installing naslib because it requires specific library versions.
|
All checks are passed. PTAL. |
| check_untyped_defs = True | ||
| no_implicit_optional = True | ||
| warn_redundant_casts = True | ||
| warn_unused_ignores = True |
There was a problem hiding this comment.
[Notes] .github/workflows/checks-integration.yml checks with this option (warn_unused_ignores) and unnecessary # type: ignore will be detected there.
toshihikoyanase
left a comment
There was a problem hiding this comment.
Thank you for your update. The change looks great to me.
Some changes are not intuitive to me, and I left some notes just for reminder.
| accuracy = sum( | ||
| x["validation_accuracy"] for x in cast(List[Dict[str, torch.Tensor]], outputs) | ||
| ) / len(outputs) |
There was a problem hiding this comment.
[Notes] outputs can be List[torch.Tensor], but original code apparently expects List[Dict[str, torch.Tensor]] , so this fix is acceptable to me.
| steps: | ||
| - uses: actions/checkout@v2 |
There was a problem hiding this comment.
The scheduled run might not be intended to run in forks. But, we can work on it in a follow-up PR.
optuna/.github/workflows/speed-benchmarks.yml
Lines 11 to 12 in fc5e262
|
@not522 requested another review from @contramundum53 . Please merge after your review. |

Motivation
In the checks workflow, we have not installed 3rd party libraries for visualization, integration, benchmarks, etc. It skips some checks, especially in mypy.
Description of the changes