Skip to content

Commit 8447e91

Browse files
[Refactor] Use the backend implementation from automl common (#185)
* [ADD] First push to enable common backend * Fix unit test * Try public https * [FIX] conftest prefix * [fix] unit test * [FIX] Fix fixture in score * [Fix] pytest collection * [FIX] flake * [FIX] regression also! * Update README.md Co-authored-by: Ravin Kohli <[email protected]> * Update .gitmodules Co-authored-by: Ravin Kohli <[email protected]> * [FIX] Regression time * Make flaky in case memout doesn't happen * Refacto development automl common backend debug (#2) * [ADD] debug information * [FIX] try fork for more stability Co-authored-by: Ravin Kohli <[email protected]>
1 parent 3191642 commit 8447e91

30 files changed

+135
-762
lines changed

.github/workflows/docs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ jobs:
1212
python-version: 3.8
1313
- name: Install dependencies
1414
run: |
15+
git submodule update --init --recursive
1516
pip install -e .[docs,examples]
1617
- name: Make docs
1718
run: |

.github/workflows/examples.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ jobs:
2020
python-version: ${{ matrix.python-version }}
2121
- name: Install test dependencies
2222
run: |
23+
git submodule update --init --recursive
2324
python -m pip install --upgrade pip
2425
pip install -e .[examples]
2526
which python

.github/workflows/pre-commit.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ jobs:
1111
uses: actions/setup-python@v2
1212
with:
1313
python-version: 3.7
14+
- name: Init Submodules
15+
run: |
16+
git submodule update --init --recursive
1417
- name: Install pre-commit
1518
run: |
1619
pip install pre-commit

.github/workflows/pytest.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ jobs:
2020
python-version: ${{ matrix.python-version }}
2121
- name: Install test dependencies
2222
run: |
23+
git submodule update --init --recursive
2324
python -m pip install --upgrade pip
2425
pip install -e .[test]
2526
- name: Store repository status

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "autoPyTorch/automl_common"]
2+
path = autoPyTorch/automl_common
3+
url = https://github.com/automl/automl_common.git

README.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,34 @@ Find the documentation [here](https://automl.github.io/Auto-PyTorch/development)
1212

1313
## Installation
1414

15-
### Pip
15+
### Manual Installation
1616

1717
We recommend using Anaconda for developing as follows:
1818

1919
```sh
2020
# Following commands assume the user is in a cloned directory of Auto-Pytorch
21+
22+
# We also need to initialize the automl_common repository as follows
23+
# You can find more information about this here:
24+
# https://github.com/automl/automl_common/
25+
git submodule update --init --recursive
26+
27+
# Create the environment
2128
conda create -n autopytorch python=3.8
2229
conda activate autopytorch
23-
conda install gxx_linux-64 gcc_linux-64 swig
30+
For Linux:
31+
conda install gxx_linux-64 gcc_linux-64 swig
32+
For mac:
33+
conda install -c conda-forge clang_osx-64 clangxx_osx-64
34+
conda install -c anaconda swig
2435
cat requirements.txt | xargs -n 1 -L 1 pip install
2536
python setup.py install
2637

2738
```
2839

40+
### Pip
41+
TODO
42+
2943
## Contributing
3044

3145
If you want to contribute to Auto-PyTorch, clone the repository and checkout our current development branch

autoPyTorch/api/base_task.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
from smac.stats.stats import Stats
2929
from smac.tae import StatusType
3030

31+
from autoPyTorch.automl_common.common.utils.backend import Backend, create
3132
from autoPyTorch.constants import (
3233
REGRESSION_TASKS,
3334
STRING_TO_OUTPUT_TYPES,
@@ -45,7 +46,6 @@
4546
from autoPyTorch.pipeline.components.setup.traditional_ml.classifier_models import get_available_classifiers
4647
from autoPyTorch.pipeline.components.training.metrics.base import autoPyTorchMetric
4748
from autoPyTorch.pipeline.components.training.metrics.utils import calculate_score, get_metrics
48-
from autoPyTorch.utils.backend import Backend, create
4949
from autoPyTorch.utils.common import FitRequirement, replace_string_bool_to_bool
5050
from autoPyTorch.utils.hyperparameter_search_space_update import HyperparameterSearchSpaceUpdates
5151
from autoPyTorch.utils.logging_ import (
@@ -157,6 +157,7 @@ def __init__(
157157
self._backend = backend
158158
else:
159159
self._backend = create(
160+
prefix='autoPyTorch',
160161
temporary_directory=self._temporary_directory,
161162
output_directory=self._output_directory,
162163
delete_tmp_folder_after_terminate=delete_tmp_folder_after_terminate,
@@ -776,7 +777,6 @@ def _search(
776777
self
777778
778779
"""
779-
780780
if self.task_type != dataset.task_type:
781781
raise ValueError("Incompatible dataset entered for current task,"
782782
"expected dataset to have task type :{} got "
@@ -794,6 +794,10 @@ def _search(
794794

795795
if self._logger is None:
796796
self._logger = self._get_logger(self.dataset_name)
797+
798+
# Setup the logger for the backend
799+
self._backend.setup_logger(port=self._logger_port)
800+
797801
self._all_supported_metrics = all_supported_metrics
798802
self._disable_file_output = disable_file_output
799803
self._memory_limit = memory_limit

autoPyTorch/api/tabular_classification.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import pandas as pd
88

99
from autoPyTorch.api.base_task import BaseTask
10+
from autoPyTorch.automl_common.common.utils.backend import Backend
1011
from autoPyTorch.constants import (
1112
TABULAR_CLASSIFICATION,
1213
TASK_TYPES_TO_STRING,
@@ -19,7 +20,6 @@
1920
)
2021
from autoPyTorch.datasets.tabular_dataset import TabularDataset
2122
from autoPyTorch.pipeline.tabular_classification import TabularClassificationPipeline
22-
from autoPyTorch.utils.backend import Backend
2323
from autoPyTorch.utils.hyperparameter_search_space_update import HyperparameterSearchSpaceUpdates
2424

2525

autoPyTorch/api/tabular_regression.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import pandas as pd
88

99
from autoPyTorch.api.base_task import BaseTask
10+
from autoPyTorch.automl_common.common.utils.backend import Backend
1011
from autoPyTorch.constants import (
1112
TABULAR_REGRESSION,
1213
TASK_TYPES_TO_STRING
@@ -19,7 +20,6 @@
1920
)
2021
from autoPyTorch.datasets.tabular_dataset import TabularDataset
2122
from autoPyTorch.pipeline.tabular_regression import TabularRegressionPipeline
22-
from autoPyTorch.utils.backend import Backend
2323
from autoPyTorch.utils.hyperparameter_search_space_update import HyperparameterSearchSpaceUpdates
2424

2525

autoPyTorch/automl_common

Submodule automl_common added at ffad909

0 commit comments

Comments
 (0)