Skip to content

riscv.py: fix is_bare method #645

riscv.py: fix is_bare method

riscv.py: fix is_bare method #645

Triggered via push May 14, 2024 07:45
Status Success
Total duration 26s
Artifacts

style.yml

on: push
Run linters
17s
Run linters
Check for License headers
7s
Check for License headers
Fit to window
Zoom out
Zoom in

Annotations

40 errors and 3 warnings
/home/runner/work/mlonmcu/mlonmcu/mlonmcu/flow/tvm/backend/tvmc_utils.py#L136
key, "--rpc-tracker", hostname + ":" + str(port), ] if is_tracker - else - [ + else [ # "--rpc-key", # key, "--rpc-tracker", hostname + ":" + str(port), ]
/home/runner/work/mlonmcu/mlonmcu/mlonmcu/platform/microtvm/microtvm_target.py#L26
from .microtvm_zephyr_target import ZephyrMicroTvmPlatformTarget from .microtvm_arduino_target import ArduinoMicroTvmPlatformTarget from .microtvm_espidf_target import EspidfMicroTvmPlatformTarget from .microtvm_host_target import HostMicroTvmPlatformTarget -from .microtvm_etiss_target import EtissMicroTvmPlatformTarget, EtissRV32MicroTvmPlatformTarget, EtissRV64MicroTvmPlatformTarget -from .microtvm_spike_target import SpikeMicroTvmPlatformTarget, SpikeRV32MicroTvmPlatformTarget, SpikeRV64MicroTvmPlatformTarget +from .microtvm_etiss_target import ( + EtissMicroTvmPlatformTarget, + EtissRV32MicroTvmPlatformTarget, + EtissRV64MicroTvmPlatformTarget, +) +from .microtvm_spike_target import ( + SpikeMicroTvmPlatformTarget, + SpikeRV32MicroTvmPlatformTarget, + SpikeRV64MicroTvmPlatformTarget, +) from .microtvm_corev_ovpsim_target import CoreVOVPSimMicroTvmPlatformTarget from .microtvm_mlonmcu_target import MlonmcuMicroTvmPlatformTarget logger = get_logger()
/home/runner/work/mlonmcu/mlonmcu/mlonmcu/platform/microtvm/microtvm_target.py#L165
metrics.add("Average Runtime [s]", mean_s) elif self.platform.aggregate == "min": metrics.add("Min Runtime [s]", min_s) elif self.platform.aggregate == "max": metrics.add("Max Runtime [s]", max_s) - if self.platform.profile: headers = None skip = False lines = out.split("\n")
/home/runner/work/mlonmcu/mlonmcu/mlonmcu/platform/tvm/tvm_canmv_k230_target.py#L22
from mlonmcu.logging import get_logger from mlonmcu.utils import filter_none logger = get_logger() + class CanMvK230TvmPlatformTarget(RVVTarget): """TODO""" FEATURES = RVVTarget.FEATURES | set()
/home/runner/work/mlonmcu/mlonmcu/mlonmcu/platform/tvm/tvm_canmv_k230_target.py#L42
"fclk": 1.6e9, # "fcpu": 1.6e9, } REQUIRED = RVVTarget.REQUIRED | set() - def __init__(self, name=None, features=None, config=None): super().__init__(name=name, features=features, config=config)
/home/runner/work/mlonmcu/mlonmcu/mlonmcu/platform/tvm/tvm_licheerv_d1_target.py#L22
from mlonmcu.logging import get_logger from mlonmcu.utils import filter_none logger = get_logger() + class LicheeRvD1TvmPlatformTarget(RISCVTarget): """TODO""" FEATURES = RISCVTarget.FEATURES | set()
/home/runner/work/mlonmcu/mlonmcu/mlonmcu/platform/tvm/tvm_licheerv_d1_target.py#L42
"fclk": 1e9, "fcpu": 1e9, # TODO: remove this! } REQUIRED = RISCVTarget.REQUIRED | set() - def __init__(self, name=None, features=None, config=None): super().__init__(name=name, features=features, config=config)
/home/runner/work/mlonmcu/mlonmcu/mlonmcu/platform/microtvm/microtvm_etiss_target.py#L308
# only allow overwriting non-none values # to support accepting user-vars new = {key: value for key, value in new.items() if config.get(key, None) is None} config.update(new) + class EtissRV32MicroTvmPlatformTarget(EtissMicroTvmPlatformTarget): FEATURES = EtissMicroTvmPlatformTarget.FEATURES DEFAULTS = { **EtissMicroTvmPlatformTarget.DEFAULTS,
/home/runner/work/mlonmcu/mlonmcu/mlonmcu/platform/tvm/tvm_target.py#L34
return name.replace("tvm_", "") TVM_PLATFORM_TARGET_REGISTRY = {} + def register_tvm_platform_target(target_name, t, override=False): global TVM_PLATFORM_TARGET_REGISTRY if target_name in TVM_PLATFORM_TARGET_REGISTRY and not override: raise RuntimeError(f"TVM platform target {target_name} is already registered") TVM_PLATFORM_TARGET_REGISTRY[target_name] = t + def get_tvm_platform_targets(): return TVM_PLATFORM_TARGET_REGISTRY
mlonmcu/platform/microtvm/microtvm_etiss_target.py#L313
Expected 2 blank lines, found 1 (E302)
/home/runner/work/mlonmcu/mlonmcu/mlonmcu/platform/tvm/tvm_tune_platform.py#L223
"M": 1e6, "G": 1e9, } mult = SI_LOOKUP.get(prefix, None) assert mult is not None, f"Unsupported SI prefix: {prefix}" - res = re.compile(fr"\d+\.\d+\s*\/\s*(\d+\.\d+)\s+{prefix}FLOPS").findall(out) + res = re.compile(rf"\d+\.\d+\s*\/\s*(\d+\.\d+)\s+{prefix}FLOPS").findall(out) if len(res) > 0: flops = float(res[-1]) return flops * mult, prefix # TODO: warning return -1, prefix
mlonmcu/platform/microtvm/microtvm_target.py#L31
Line too long (128 > 120 characters) (E501)
/home/runner/work/mlonmcu/mlonmcu/mlonmcu/platform/tvm/tvm_tune_platform.py#L383
visualize_raw_task = handle.read() # content_best = _pick_best(backend, content, verbose=verbose) sub_trials = len(remove_empty(content.split("\n"))) sub_failed_trials = count_failed_trials(content) max_flops, _ = get_max_flops(out, prefix=self.flop_prefix) + def parse_tuning_logs(content, max_flops): def extract(d): inp = d["input"] res = d["result"] return res[0][0], inp[0], inp[1], inp[2] + best_runtime = 1e9 best_runtimes = [] best_idx = -1 for trial_idx, line in enumerate(content.strip().splitlines()): # if len(line.strip()) == 0:
mlonmcu/platform/microtvm/microtvm_target.py#L32
Line too long (128 > 120 characters) (E501)
/home/runner/work/mlonmcu/mlonmcu/mlonmcu/platform/tvm/tvm_tune_platform.py#L411
# target_string = "c -abc" # task_name = "foobar" # task_tensors = "{?}" num_flops = int(max_flops * best_runtime) arr = np.array(best_runtimes) - confidences = {confidence: sum((1/arr) < ((1/min(arr))*confidence))+1 for confidence in [0.8, 0.9, 0.95, 0.99, 0.999]} - return best_runtime, target_string, task_name, str(task_tensors), num_flops, best_idx, confidences - best_runtime, target_string, task_name, task_tensors, num_flops, best_idx, confidences = parse_tuning_logs(content, max_flops) + confidences = { + confidence: sum((1 / arr) < ((1 / min(arr)) * confidence)) + 1 + for confidence in [0.8, 0.9, 0.95, 0.99, 0.999] + } + return ( + best_runtime, + target_string, + task_name, + str(task_tensors), + num_flops, + best_idx, + confidences, + ) + + ( + best_runtime, + target_string, + task_name, + task_tensors, + num_flops, + best_idx, + confidences, + ) = parse_tuning_logs(content, max_flops) t1 = time.time() return ( out, content, task_len,
mlonmcu/platform/microtvm/microtvm_target.py#L172
Too many blank lines (2) (E303)
/home/runner/work/mlonmcu/mlonmcu/mlonmcu/platform/tvm/tvm_tune_platform.py#L443
metrics_ = Metrics() artifacts_ = [] try: ret = w.result() logger.debug(f"Worker {i}: done") - out, content, size, tuned, failed, max_flops, duration, visualize_raw_task, best_runtime, target_string, task_name, task_tensors, num_flops, best_idx, confidences = ret + ( + out, + content, + size, + tuned, + failed, + max_flops, + duration, + visualize_raw_task, + best_runtime, + target_string, + task_name, + task_tensors, + num_flops, + best_idx, + confidences, + ) = ret all_out += out all_content += content metrics_.add("Config Space Size", size, True) metrics_.add("Total Trials", tuned, True) metrics_.add("Failed Trials", failed, True)
mlonmcu/platform/tvm/tvm_canmv_k230_target.py#L23
'mlonmcu.utils.filter_none' imported but unused (F401)
/home/runner/work/mlonmcu/mlonmcu/mlonmcu/target/metrics.py#L64
else: self.order.append(name) def get(self, name): value = self.data[name] + def eval_str(x): if isinstance(x, str): if len(x) > 0: try: return ast.literal_eval(x)
mlonmcu/platform/tvm/tvm_canmv_k230_target.py#L27
Expected 2 blank lines, found 1 (E302)
/home/runner/work/mlonmcu/mlonmcu/mlonmcu/target/metrics.py#L77
return x else: return None else: return x + # return (ast.literal_eval(value) if len(value) > 0 else None) if isinstance(value, str) else value return eval_str(value) def has(self, name): return name in self.data
mlonmcu/platform/tvm/tvm_canmv_k230_target.py#L48
Too many blank lines (2) (E303)
mlonmcu/platform/tvm/tvm_licheerv_d1_target.py#L23
'mlonmcu.utils.filter_none' imported but unused (F401)
mlonmcu/platform/tvm/tvm_licheerv_d1_target.py#L27
Expected 2 blank lines, found 1 (E302)
mlonmcu/platform/tvm/tvm_licheerv_d1_target.py#L48
Too many blank lines (2) (E303)
mlonmcu/platform/tvm/tvm_target.py#L29
Module level import not at top of file (E402)
mlonmcu/platform/tvm/tvm_target.py#L30
Module level import not at top of file (E402)
mlonmcu/platform/tvm/tvm_target.py#L39
Expected 2 blank lines, found 1 (E302)
mlonmcu/platform/tvm/tvm_target.py#L46
Expected 2 blank lines, found 1 (E302)
mlonmcu/platform/tvm/tvm_target_platform.py#L114
Local variable 'skip_names' is assigned to but never used (F841)
mlonmcu/platform/tvm/tvm_tune_platform.py#L388
Expected 1 blank line before a nested definition, found 0 (E306)
mlonmcu/platform/tvm/tvm_tune_platform.py#L416
Missing whitespace around arithmetic operator (E226)
mlonmcu/platform/tvm/tvm_tune_platform.py#L416
Missing whitespace around arithmetic operator (E226)
mlonmcu/platform/tvm/tvm_tune_platform.py#L416
Missing whitespace around arithmetic operator (E226)
mlonmcu/platform/tvm/tvm_tune_platform.py#L416
Missing whitespace around arithmetic operator (E226)
mlonmcu/platform/tvm/tvm_tune_platform.py#L416
Line too long (154 > 120 characters) (E501)
mlonmcu/platform/tvm/tvm_tune_platform.py#L417
Line too long (134 > 120 characters) (E501)
mlonmcu/platform/tvm/tvm_tune_platform.py#L418
Line too long (158 > 120 characters) (E501)
mlonmcu/platform/tvm/tvm_tune_platform.py#L448
Line too long (192 > 120 characters) (E501)
mlonmcu/target/metrics.py#L69
Expected 1 blank line before a nested definition, found 0 (E306)
Check for License headers
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/checkout@v3. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
Run linters
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/checkout@v3, actions/setup-python@v4, wearerequired/lint-action@v1. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
Run linters
The following actions uses node12 which is deprecated and will be forced to run on node16: wearerequired/lint-action@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/