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

Rename to SIATune #64

Merged
merged 1 commit into from
Sep 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build_docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Build & Push Docker Image
on:
push:
branches:
- 'master'
- 'main'
- 'test/*'
tags:
- '**'
Expand All @@ -14,7 +14,7 @@ concurrency:
env:
DOCKERFILE_PATH: "./docker/Dockerfile"
PROJECT_NAME: "mlops"
APP_NAME: "mmtune"
APP_NAME: "siatune"

jobs:
build:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build_unit_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Build & Unit Test
on:
pull_request:
branch:
- 'master'
- 'main'
paths-ignore:
- ".github/**.md"
- "README.md"
Expand Down Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Run unittests and generate coverage report
run: |
pip install pytest coverage
coverage run --branch --source mmtune -m pytest tests/
coverage run --branch --source siatune -m pytest tests/
coverage xml
coverage report -m
- name: Display coverage
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/publish-to-pypi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
env:
PYPI_USER: ${{ secrets.PYPI_USER }}
PYPI_PW: ${{ secrets.PYPI_PW}}
PIP_INDEX_URL: ${{ secrets.PIP_INDEX_URL}}
run: |
pip3 install twine
twine upload --repository-url https://pypi.sia-service.kr/ dist/* -u ${PYPI_USER} -p ${PYPI_PW}
twine upload --repository-url ${PIP_INDEX_URL} dist/* -u ${PYPI_USER} -p ${PYPI_PW}
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ repos:
rev: v0.1.0 # Use the ref you want to point at
hooks:
- id: check-copyright
args: ["mmtune"] # replace the dir_to_check with your expected directory to check
args: ["siatune"] # replace the dir_to_check with your expected directory to check
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@

<div align="center">
<img src="resources/mmtune-logo.png" width="450"/>
<img src="resources/siatune-logo.png" width="450"/>
</div>

## Introduction
MMTune is an open-source deep learning model hyperparameter tuning toolbox especially for OpenMMLab's model frameworks such as [mmdetection](https://github.com/open-mmlab/mmdetection) and [mmsegmentation](https://github.com/open-mmlab/mmsegmentation). In order to support job scheduling and resource management, MMTune adopts [Ray](https://github.com/ray-project/ray) and [Ray.tune](https://docs.ray.io/en/latest/tune/index.html).
SIATune is an open-source deep learning model hyperparameter tuning toolbox especially for OpenMMLab's model frameworks such as [mmdetection](https://github.com/open-mmlab/mmdetection) and [mmsegmentation](https://github.com/open-mmlab/mmsegmentation). In order to support job scheduling and resource management, SIATune adopts [Ray](https://github.com/ray-project/ray) and [Ray.tune](https://docs.ray.io/en/latest/tune/index.html).

Currently, MMTune is maintained by SI-Analytics.
Currently, SIATune is maintained by SI-Analytics.

### Major features

Expand Down
2 changes: 1 addition & 1 deletion configs/mmtune/_base_/callback/mlflow.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
callbacks = [
dict(
type='MLflowLoggerCallback',
experiment_name='mmtune',
experiment_name='siatune',
save_artifact=True,
metric='train/loss',
mode='max',
Expand Down
6 changes: 3 additions & 3 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ ARG CUDA
ARG MMCV_VERSION
RUN ["/bin/bash", "-c", "pip install --no-cache-dir mmcv-full==${MMCV_VERSION} -f https://download.openmmlab.com/mmcv/dist/cu${CUDA//./}/torch${PYTORCH}/index.html"]

# Install MMTune
COPY . /mmtune
WORKDIR /mmtune
# Install SIATune
COPY . /siatune
WORKDIR /siatune
RUN pip install --no-cache-dir -e .
14 changes: 7 additions & 7 deletions docs/get_started.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Build MMTune
# Build SIATune

## Dockerfile (RECOMMENDED)
```bash
docker build . -t mmtune:master -f docker/Dockerfile
docker build . -t siatune:master -f docker/Dockerfile
```

## Build From Source
Expand All @@ -12,10 +12,10 @@ docker build . -t mmtune:master -f docker/Dockerfile
pip install torch torchvision -f https://download.pytorch.org/whl/torch_stable.html
# 2. install mmcv
pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/{cu_version}/{torch_version}/index.html
# 3. clone mmtune
git clone -b master https://github.com/SIAnalytics/mmtune.git mmtune
# 4. install mmtune
cd mmtune && pip install -e .
# 3. clone siatune
git clone -b master https://github.com/SIAnalytics/siatune.git siatune
# 4. install siatune
cd siatune && pip install -e .
```

# Hyperparamer tuning with OpenMMLab's model frameworks.
Expand All @@ -34,5 +34,5 @@ python tools/tune.py ${TUNE_CONFIG} [optional tune arguments] [optional task arg

```bash
# MMDetection Example
python tools/tune.py configs/mmtune/mmdet_asynchb_nevergrad_pso.py --trainable_args configs/mmdet/faster_rcnn/faster_rcnn_r50_fpn_1x_coco.py
python tools/tune.py configs/siatune/mmdet_asynchb_nevergrad_pso.py --trainable_args configs/mmdet/faster_rcnn/faster_rcnn_r50_fpn_1x_coco.py
```
Binary file removed resources/mmtune-logo.png
Binary file not shown.
Binary file added resources/siatune-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ SPLIT_BEFORE_EXPRESSION_AFTER_OPENING_PAREN = true
line_length = 79
multi_line_output = 0
extra_standard_library = setuptools
known_first_party = mmtune
known_first_party = siatune
known_third_party = mmcv,numpy,pytest,ray,setuptools,torch
no_lines_before = STDLIB,LOCALFOLDER
default_section = THIRDPARTY
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from setuptools import find_packages, setup

version_file = 'mmtune/version.py'
version_file = 'siatune/version.py'


def parse_requirements(fname: str = 'requirements.txt',
Expand Down Expand Up @@ -113,7 +113,7 @@ def get_version() -> str:

if __name__ == '__main__':
setup(
name='mmtune',
name='siatune',
version=get_version(),
author='SIA',
packages=find_packages(exclude=('configs', 'tools')),
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion mmtune/__main__.py → siatune/__main__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) SI-Analytics. All rights reserved.
"""The mmtune entry point."""
"""The siatune entry point."""
from .run import main

if __name__ == '__main__':
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions mmtune/apis/analysis.py → siatune/apis/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from mmcv.utils import Config, get_logger
from ray import tune

from mmtune.utils import ImmutableContainer, dump_cfg
from siatune.utils import ImmutableContainer, dump_cfg


def log_analysis(analysis: tune.ExperimentAnalysis,
Expand All @@ -31,7 +31,7 @@ def log_analysis(analysis: tune.ExperimentAnalysis,

timestamp = time.strftime('%Y%m%d_%H%M%S', time.localtime())
logger = get_logger(
'mmtune', log_file=osp.join(log_dir, f'{timestamp}.log'))
'siatune', log_file=osp.join(log_dir, f'{timestamp}.log'))

logger.info(
f'Best Hyperparam: \n'
Expand Down
12 changes: 6 additions & 6 deletions mmtune/apis/tune.py → siatune/apis/tune.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
import ray
from mmcv.utils import Config

from mmtune.mm.tasks import BaseTask
from mmtune.ray.callbacks import build_callback
from mmtune.ray.schedulers import build_scheduler
from mmtune.ray.searchers import build_searcher
from mmtune.ray.spaces import build_space
from mmtune.ray.stoppers import build_stopper
from siatune.mm.tasks import BaseTask
from siatune.ray.callbacks import build_callback
from siatune.ray.schedulers import build_scheduler
from siatune.ray.searchers import build_searcher
from siatune.ray.spaces import build_space
from siatune.ray.stoppers import build_stopper


def tune(task_processor: BaseTask, tune_config: Config,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import ray

from mmtune.utils import dump_cfg
from siatune.utils import dump_cfg
from .base import BaseRewriter
from .builder import REWRITERS

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def __init__(self,
hk_key (str): The key of the custom hooks.
"""
# Re-register the hook in the new process.
from mmtune.mm import hooks # noqa F401
from siatune.mm import hooks # noqa F401

self.post_custom_hooks = post_custom_hooks
self.key = key
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions mmtune/mm/tasks/base.py → siatune/mm/tasks/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

import ray

from mmtune.mm.context import ContextManager
from mmtune.utils import ImmutableContainer
from siatune.mm.context import ContextManager
from siatune.utils import ImmutableContainer


class BaseTask(metaclass=ABCMeta):
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
PopulationBasedTraining as _PopulationBasedTraining
from ray.tune.trial import Trial

from mmtune.ray.schedulers import SCHEDULERS
from mmtune.ray.spaces import build_space
from mmtune.utils import ImmutableContainer
from siatune.ray.schedulers import SCHEDULERS
from siatune.ray.spaces import build_space
from siatune.utils import ImmutableContainer


def explore(
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import ray.tune as tune

from mmtune.utils import ImmutableContainer
from siatune.utils import ImmutableContainer
from .base import BaseSpace
from .builder import SPACES

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import ray.tune as tune

from mmtune.utils import ImmutableContainer
from siatune.utils import ImmutableContainer
from .base import BaseSpace
from .builder import SPACES

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions mmtune/run.py → siatune/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import ray
from mmcv import Config

from mmtune.apis import log_analysis, tune
from mmtune.mm.tasks import build_task_processor
from siatune.apis import log_analysis, tune
from siatune.mm.tasks import build_task_processor


def parse_args() -> Namespace:
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion mmtune/utils/config.py → siatune/utils/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def dump_cfg(cfg: Config, save_path: str) -> bool:
f.write(cfg.pretty_text)
return True
except Exception as err:
from mmtune.utils import get_root_logger
from siatune.utils import get_root_logger
logger = get_root_logger()
logger.error(f'Failed to dump config to {save_path}: {err}')
return False
File renamed without changes.
4 changes: 2 additions & 2 deletions mmtune/utils/logger.py → siatune/utils/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def get_root_logger(log_file: Optional[str] = None,
"""Get the root logger. The logger will be initialized if it has not been
initialized. By default a StreamHandler will be added. If `log_file` is
specified, a FileHandler will also be added. The name of the root logger is
the top-level package name, e.g., "mmtune".
the top-level package name, e.g., "siatune".

Args:
log_file (Optional[str]): The log filename. If specified, a FileHandler
Expand All @@ -22,6 +22,6 @@ def get_root_logger(log_file: Optional[str] = None,
logging.Logger: The root logger.
"""

logger = get_logger(name='mmtune', log_file=log_file, log_level=log_level)
logger = get_logger(name='siatune', log_file=log_file, log_level=log_level)

return logger
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/test_apis/test_apis.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import mmcv
from ray.tune.trainable import Trainable

from mmtune.apis import log_analysis, tune
from siatune.apis import log_analysis, tune


def test_log_analysis():
Expand Down
2 changes: 1 addition & 1 deletion tests/test_mm/test_context.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import pytest

from mmtune.mm.context import REWRITERS, ContextManager
from siatune.mm.context import REWRITERS, ContextManager


def test_contextmanager():
Expand Down
2 changes: 1 addition & 1 deletion tests/test_mm/test_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import torch.distributed as dist
from ray import tune

from mmtune.mm.hooks import RayCheckpointHook, RayTuneLoggerHook
from siatune.mm.hooks import RayCheckpointHook, RayTuneLoggerHook


def test_raycheckpointhook():
Expand Down
18 changes: 9 additions & 9 deletions tests/test_mm/test_rewriters.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
import mmcv
import pytest

from mmtune.mm.context.rewriters import (REWRITERS, AppendTrialIDtoPath,
BaseRewriter, BatchConfigPatcher,
CustomHookRegister, Dump,
InstantiateCfg, MergeConfig,
ResumeFromCkpt,
SequeunceConfigPatcher)
from mmtune.mm.context.rewriters.builder import build_rewriter
from mmtune.utils import dump_cfg
from siatune.mm.context.rewriters import (REWRITERS, AppendTrialIDtoPath,
BaseRewriter, BatchConfigPatcher,
CustomHookRegister, Dump,
InstantiateCfg, MergeConfig,
ResumeFromCkpt,
SequeunceConfigPatcher)
from siatune.mm.context.rewriters.builder import build_rewriter
from siatune.utils import dump_cfg


def test_base_rewriter():
Expand Down Expand Up @@ -78,7 +78,7 @@ def test_merge():


def test_patch():
from mmtune.mm.context.rewriters.patch import unwrap_regexp
from siatune.mm.context.rewriters.patch import unwrap_regexp
assert unwrap_regexp('$(a)') == ('a', True)

context = dict(
Expand Down
10 changes: 5 additions & 5 deletions tests/test_mm/test_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
from mmcv.utils import Config
from ray import tune

from mmtune.mm.tasks import (TASKS, BaseTask, BlackBoxTask,
ContinuousTestFunction, DiscreteTestFunction,
MMClassification, MMDetection, MMSegmentation,
MMTrainBasedTask, build_task_processor)
from mmtune.utils.config import dump_cfg
from siatune.mm.tasks import (TASKS, BaseTask, BlackBoxTask,
ContinuousTestFunction, DiscreteTestFunction,
MMClassification, MMDetection, MMSegmentation,
MMTrainBasedTask, build_task_processor)
from siatune.utils.config import dump_cfg

_session = dict()

Expand Down
2 changes: 1 addition & 1 deletion tests/test_ray/test_schedulers.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from mmtune.ray.schedulers import SCHEDULERS, build_scheduler
from siatune.ray.schedulers import SCHEDULERS, build_scheduler


def test_build_schedulers():
Expand Down
6 changes: 3 additions & 3 deletions tests/test_ray/test_searchers.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import pytest
from ray import tune

from mmtune.ray.searchers import (SEARCHERS, BlendSearch, CFOSearch,
HyperOptSearch, NevergradSearch,
build_searcher)
from siatune.ray.searchers import (SEARCHERS, BlendSearch, CFOSearch,
HyperOptSearch, NevergradSearch,
build_searcher)


def test_build_searcher():
Expand Down
4 changes: 2 additions & 2 deletions tests/test_ray/test_spaces.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import pytest
from ray import tune

from mmtune.ray.spaces import Choice, GridSearch, SampleFrom, build_space
from mmtune.utils import ImmutableContainer
from siatune.ray.spaces import Choice, GridSearch, SampleFrom, build_space
from siatune.utils import ImmutableContainer


def test_build_space():
Expand Down
Loading