Unverified Commit e457047c authored by QuanluZhang's avatar QuanluZhang Committed by GitHub
Browse files

[retiarii] update debug info, and add license (#3438)

parent 539a7cd7
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
from .operation import Operation from .operation import Operation
from .graph import * from .graph import *
from .execution import * from .execution import *
......
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import logging import logging
from typing import List, Tuple, Any from typing import List, Tuple, Any
......
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
# pylint: skip-file # pylint: skip-file
""" """
......
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import re import re
import torch import torch
......
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
from enum import Enum from enum import Enum
MODULE_EXCEPT_LIST = ['Sequential'] MODULE_EXCEPT_LIST = ['Sequential']
......
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
def build_full_name(prefix, name, seq=None): def build_full_name(prefix, name, seq=None):
if isinstance(name, list): if isinstance(name, list):
name = '__'.join(name) name = '__'.join(name)
......
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import graphviz import graphviz
......
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
from ..graph import Evaluator from ..graph import Evaluator
......
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
# This file is deprecated. # This file is deprecated.
import abc import abc
......
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import warnings import warnings
from typing import Dict, Union, Optional, List from typing import Dict, Union, Optional, List
......
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import time import time
from ..graph import Model, ModelStatus from ..graph import Model, ModelStatus
......
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import logging import logging
import os import os
import random import random
...@@ -63,13 +66,14 @@ class BaseExecutionEngine(AbstractExecutionEngine): ...@@ -63,13 +66,14 @@ class BaseExecutionEngine(AbstractExecutionEngine):
def _send_trial_callback(self, paramater: dict) -> None: def _send_trial_callback(self, paramater: dict) -> None:
if self.resources <= 0: if self.resources <= 0:
_logger.warning('There is no available resource, but trial is submitted.') # FIXME: should be a warning message here
_logger.debug('There is no available resource, but trial is submitted.')
self.resources -= 1 self.resources -= 1
_logger.info('Resource used. Remaining: %d', self.resources) _logger.debug('Resource used. Remaining: %d', self.resources)
def _request_trial_jobs_callback(self, num_trials: int) -> None: def _request_trial_jobs_callback(self, num_trials: int) -> None:
self.resources += num_trials self.resources += num_trials
_logger.info('New resource available. Remaining: %d', self.resources) _logger.debug('New resource available. Remaining: %d', self.resources)
def _trial_end_callback(self, trial_id: int, success: bool) -> None: def _trial_end_callback(self, trial_id: int, success: bool) -> None:
model = self._running_models[trial_id] model = self._running_models[trial_id]
......
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import logging import logging
from typing import List, Dict, Tuple from typing import List, Dict, Tuple
......
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
from abc import ABC, abstractmethod, abstractclassmethod from abc import ABC, abstractmethod, abstractclassmethod
from typing import Any, NewType, List, Union from typing import Any, NewType, List, Union
......
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
from ..graph import Model, ModelStatus from ..graph import Model, ModelStatus
from .interface import MetricData, AbstractGraphListener from .interface import MetricData, AbstractGraphListener
......
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
from abc import ABC from abc import ABC
from .logical_plan import LogicalPlan from .logical_plan import LogicalPlan
......
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import copy import copy
from typing import Dict, Tuple, List, Any from typing import Dict, Tuple, List, Any
......
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
from typing import List, Dict, Tuple from typing import List, Dict, Tuple
from nni.retiarii.utils import uid from nni.retiarii.utils import uid
......
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import atexit import atexit
import logging import logging
import time import time
......
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
""" """
Model representation. Model representation.
""" """
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment