Skip to content

chore: Lint noxfile.py #1443

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

Merged
merged 1 commit into from
Nov 7, 2022
Merged
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
27 changes: 24 additions & 3 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ def run_base_tests(session):
else:
session.run_always("pytest", test)


def run_fx_core_tests(session):
print("Running FX core tests")
session.chdir(os.path.join(TOP_DIR, "py/torch_tensorrt/fx/test"))
Expand All @@ -214,6 +215,7 @@ def run_fx_core_tests(session):
else:
session.run_always("pytest", test)


def run_fx_converter_tests(session):
print("Running FX converter tests")
session.chdir(os.path.join(TOP_DIR, "py/torch_tensorrt/fx/test"))
Expand All @@ -229,6 +231,7 @@ def run_fx_converter_tests(session):
else:
session.run_always("pytest", test, skip_tests)


def run_fx_lower_tests(session):
print("Running FX passes and trt_lower tests")
session.chdir(os.path.join(TOP_DIR, "py/torch_tensorrt/fx/test"))
Expand All @@ -237,7 +240,7 @@ def run_fx_lower_tests(session):
# "passes/test_fuse_permute_linear_trt.py",
"passes/test_remove_duplicate_output_args.py",
"passes/test_fuse_permute_matmul_trt.py",
#"passes/test_graph_opts.py"
# "passes/test_graph_opts.py"
"trt_lower",
]
for test in tests:
Expand All @@ -246,6 +249,7 @@ def run_fx_lower_tests(session):
else:
session.run_always("pytest", test)


def run_fx_quant_tests(session):
print("Running FX Quant tests")
session.chdir(os.path.join(TOP_DIR, "py/torch_tensorrt/fx/test"))
Expand All @@ -261,6 +265,7 @@ def run_fx_quant_tests(session):
else:
session.run_always("pytest", test, skip_tests)


def run_fx_tracer_tests(session):
print("Running FX Tracer tests")
session.chdir(os.path.join(TOP_DIR, "py/torch_tensorrt/fx/test"))
Expand All @@ -269,14 +274,15 @@ def run_fx_tracer_tests(session):
tests = [
"tracer/test_acc_shape_prop.py",
"tracer/test_acc_tracer.py",
#"tracer/test_dispatch_tracer.py"
# "tracer/test_dispatch_tracer.py"
]
for test in tests:
if USE_HOST_DEPS:
session.run_always("pytest", test, env={"PYTHONPATH": PYT_PATH})
else:
session.run_always("pytest", test)


def run_fx_tools_tests(session):
print("Running FX tools tests")
session.chdir(os.path.join(TOP_DIR, "py/torch_tensorrt/fx/test"))
Expand Down Expand Up @@ -396,6 +402,7 @@ def run_l0_api_tests(session):
run_base_tests(session)
cleanup(session)


def run_l0_fx_tests(session):
if not USE_HOST_DEPS:
install_deps(session)
Expand All @@ -405,27 +412,31 @@ def run_l0_fx_tests(session):
run_fx_lower_tests(session)
cleanup(session)


def run_l0_fx_core_tests(session):
if not USE_HOST_DEPS:
install_deps(session)
install_torch_trt(session)
run_fx_core_tests(session)
cleanup(session)


def run_l0_fx_converter_tests(session):
if not USE_HOST_DEPS:
install_deps(session)
install_torch_trt(session)
run_fx_converter_tests(session)
cleanup(session)


def run_l0_fx_lower_tests(session):
if not USE_HOST_DEPS:
install_deps(session)
install_torch_trt(session)
run_fx_lower_tests(session)
cleanup(session)


def run_l0_dla_tests(session):
if not USE_HOST_DEPS:
install_deps(session)
Expand All @@ -443,6 +454,7 @@ def run_l1_model_tests(session):
run_model_tests(session)
cleanup(session)


def run_l1_int8_accuracy_tests(session):
if not USE_HOST_DEPS:
install_deps(session)
Expand All @@ -452,6 +464,7 @@ def run_l1_int8_accuracy_tests(session):
run_int8_accuracy_tests(session)
cleanup(session)


def run_l1_fx_tests(session):
if not USE_HOST_DEPS:
install_deps(session)
Expand All @@ -461,6 +474,7 @@ def run_l1_fx_tests(session):
run_fx_tools_tests(session)
cleanup(session)


def run_l2_trt_compatibility_tests(session):
if not USE_HOST_DEPS:
install_deps(session)
Expand All @@ -483,26 +497,31 @@ def l0_api_tests(session):
"""When a developer needs to check correctness for a PR or something"""
run_l0_api_tests(session)


@nox.session(python=SUPPORTED_PYTHON_VERSIONS, reuse_venv=True)
def l0_fx_tests(session):
"""When a developer needs to check correctness for a PR or something"""
run_l0_fx_tests(session)


@nox.session(python=SUPPORTED_PYTHON_VERSIONS, reuse_venv=True)
def l0_fx_core_tests(session):
"""When a developer needs to check correctness for a PR or something"""
run_l0_fx_core_tests(session)


@nox.session(python=SUPPORTED_PYTHON_VERSIONS, reuse_venv=True)
def l0_fx_converter_tests(session):
"""When a developer needs to check correctness for a PR or something"""
run_l0_fx_converter_tests(session)


@nox.session(python=SUPPORTED_PYTHON_VERSIONS, reuse_venv=True)
def l0_fx_lower_tests(session):
"""When a developer needs to check correctness for a PR or something"""
run_l0_fx_lower_tests(session)


@nox.session(python=SUPPORTED_PYTHON_VERSIONS, reuse_venv=True)
def l0_dla_tests(session):
"""When a developer needs to check basic api functionality using host dependencies"""
Expand All @@ -514,11 +533,13 @@ def l1_model_tests(session):
"""When a user needs to test the functionality of standard models compilation and results"""
run_l1_model_tests(session)


@nox.session(python=SUPPORTED_PYTHON_VERSIONS, reuse_venv=True)
def l1_fx_tests(session):
"""When a user needs to test the functionality of standard models compilation and results"""
run_l1_fx_tests(session)


@nox.session(python=SUPPORTED_PYTHON_VERSIONS, reuse_venv=True)
def l1_int8_accuracy_tests(session):
"""Checking accuracy performance on various usecases"""
Expand All @@ -534,4 +555,4 @@ def l2_trt_compatibility_tests(session):
@nox.session(python=SUPPORTED_PYTHON_VERSIONS, reuse_venv=True)
def l2_multi_gpu_tests(session):
"""Makes sure that Torch-TensorRT can operate on multi-gpu systems"""
run_l2_multi_gpu_tests(session)
run_l2_multi_gpu_tests(session)