Unverified Commit 5925d444 authored by Tim Moon's avatar Tim Moon Committed by GitHub
Browse files

Separate linting passes for PyTorch and JAX (#86)



Separate linting passes for different frameworks
Signed-off-by: default avatarTim Moon <tmoon@nvidia.com>
parent 37a12c4e
# Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# See LICENSE for license information.
# Stop searching for additional config files.
set noparent
# Limit line length.
linelength=100
# Ignore the following errors.
filter=-build/include_subdir
filter=-build/namespaces
filter=-readability/todo
filter=-build/header_guard
filter=-build/include
[MASTER]
extension-pkg-whitelist=transformer_engine_jax
disable=too-many-locals,
invalid-name,
too-many-arguments,
abstract-method,
arguments-differ,
too-many-instance-attributes,
unsubscriptable-object,
import-outside-toplevel,
too-many-statements,
import-error,
too-many-lines,
use-maxsplit-arg,
protected-access,
pointless-string-statement,
cyclic-import,
duplicate-code,
no-member,
attribute-defined-outside-init,
global-statement,
too-many-branches,
global-variable-not-assigned,
redefined-argument-from-local
# Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# See LICENSE for license information.
set -e
: "${TE_PATH:=/opt/transformerengine}"
pip install cpplint==1.6.0 pylint==2.13.5
if [ -z "${PYTHON_ONLY}" ]
then
cp $TE_PATH/qa/L0_jax_lint/CPPLINT.cfg $TE_PATH
cd $TE_PATH
echo "Checking common API headers"
cpplint --root transformer_engine/common/include --recursive transformer_engine/common/include
echo "Checking C++ files"
cpplint --recursive --exclude=transformer_engine/common/include transformer_engine/common
cpplint --recursive transformer_engine/jax
fi
if [ -z "${CPP_ONLY}" ]
then
cp $TE_PATH/qa/L0_jax_lint/pylintrc $TE_PATH
cd $TE_PATH
echo "Checking Python files"
pylint --recursive=y transformer_engine/common transformer_engine/jax
fi
[MASTER] [MASTER]
extension-pkg-whitelist=torch, extension-pkg-whitelist=torch,
transformer_engine_extensions, transformer_engine_extensions
transformer_engine_jax
disable=too-many-locals, disable=too-many-locals,
invalid-name, invalid-name,
...@@ -29,4 +28,3 @@ disable=too-many-locals, ...@@ -29,4 +28,3 @@ disable=too-many-locals,
[TYPECHECK] [TYPECHECK]
ignored-modules=torch ignored-modules=torch
ignored-classes=torch ignored-classes=torch
...@@ -9,16 +9,18 @@ set -e ...@@ -9,16 +9,18 @@ set -e
pip install cpplint==1.6.0 pylint==2.13.5 pip install cpplint==1.6.0 pylint==2.13.5
if [ -z "${PYTHON_ONLY}" ] if [ -z "${PYTHON_ONLY}" ]
then then
cp $TE_PATH/qa/L0_lint/CPPLINT.cfg $TE_PATH
cd $TE_PATH
echo "Checking common API headers" echo "Checking common API headers"
cd $TE_PATH && \
cpplint --root transformer_engine/common/include --recursive transformer_engine/common/include cpplint --root transformer_engine/common/include --recursive transformer_engine/common/include
echo "Checking C++ files" echo "Checking C++ files"
cd $TE_PATH && \
cpplint --recursive --exclude=transformer_engine/common/include transformer_engine cpplint --recursive --exclude=transformer_engine/common/include transformer_engine
cpplint --recursive transformer_engine/pytorch
fi fi
if [ -z "${CPP_ONLY}" ] if [ -z "${CPP_ONLY}" ]
then then
cp $TE_PATH/qa/L0_lint/pylintrc $TE_PATH
cd $TE_PATH
echo "Checking Python files" echo "Checking Python files"
cd $TE_PATH && \ pylint --recursive=y transformer_engine/common transformer_engine/pytorch
pylint --recursive=y transformer_engine
fi fi
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