Linting your project¶
Linting is the process of statically analyzing code to find code style violations and to detect errors. mlf-core implements a custom linting system, but depending on the template external tools linting tools may additionally be called.
Usage¶
mlf-core lint can be invoked on an existing project using
$ mlf-core lint <OPTIONS> <PATH>
mlf-core’s linting is divided into three distinct phases.
All linting functions, which all templates share are called and the results are collected.
Template specific linting functions are invoked and the results are appended to the results of phase 1
Template specific external linters are called (e.g. autopep8 for Python based projects)
The linting results of the first two phases are assigned into 3 groups:
Passed
Passed with warning
Failed
If any of the checks failed linting stops and returns an error code.

Linting applied to a newly created mlflow-pytorch project.¶
To examine the reason for a failed linting test please follow the URL. All reasons are explained in the section Linting codes.
Linting codes¶
The following error or warning numbers correspond to errors found during linting. If you are not sure why a specific linting error has occurred you may find more information using the respective error code.
General¶
general-1¶
general-2¶
general-3¶
mlf-core TODO:
TODO mlf-core:
or strings in the respective files. Usually, they point to things that should be
manually configured or require other attention. You may remove them if there is no task for you to be solved.general-4¶
general-5¶
mlf-core bump-version
.general-6¶
changelog.rst
invalid. The changelog.rst
file requires that every changelog section has a header with the version and the corresponding release date.
The version above another changelog section should always be greater than the section below (e.g. 1.1.0 above 1.0.0).
Every section must have the headings **Added**
, **Fixed**
, **Dependencies**
and **Deprecated**
.mlflow-pytorch¶
mlflow-pytorch-1¶
mlflow-pytorch-2¶
1 trainer.deterministic = True,
2 trainer.benchmark = False,
3 set_general_random_seeds(general_seed),
4 set_pytorch_random_seeds(pytorch_seed, num_of_gpus)
mlflow-pytorch-3¶
1'index_add',
2'scatter_add',
3'bincount',
4'embedding_bag',
5'ctc_loss',
6'interpolate',
7'repeat_interleave',
8'index_select'
mlflow-tensorflow¶
mlflow-tensorflow-1¶
mlflow-tensorflow-2¶
1set_general_random_seeds(dict_args["general_seed"]),
2set_tensorflow_random_seeds(dict_args["tensorflow_seed"])
3def set_tensorflow_random_seeds(seed):
4 tf.random.set_seed(seed)
5 tf.config.threading.set_intra_op_parallelism_threads = 1 # CPU only
6 tf.config.threading.set_inter_op_parallelism_threads = 1 # CPU only
7 os.environ['TF_DETERMINISTIC_OPS'] = '1'
mlflow-tensorflow-3¶
1'softmax_cross_entropy_with_logits',
2'sparse_softmax_cross_entropy_with_logits'
mlflow-xgboost¶
mlflow-xgboost-1¶
mlflow-xgboost-2¶
1set_general_random_seeds(dict_args["general_seed"]),
2set_xgboost_random_seeds(dict_args["xgboost_seed"], param)
3def set_xgboost_random_seeds(seed, param):
4 param['seed'] = seed
mlflow-xgboost-3¶
mlflow-xgboost-4¶
all_reduce
algorithm in XGBoost may not operate deterministically.mlflow-xgboost_dask¶
mlflow-xgboost_dask-1¶
mlflow-xgboost_dask-2¶
1set_general_random_seeds(dict_args["general_seed"]),
2set_xgboost_dask_random_seeds(dict_args["xgboost_seed"], param)
3def set_xgboost_random_seeds(seed, param):
4 param['seed'] = seed
mlflow-xgboost_dask-3¶
mlflow-xgboost-4¶
all_reduce
algorithm in XGBoost may not operate deterministically.