diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f6fd9ac33e..336df6e1b0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -84,6 +84,11 @@ repos: files: ".*/auto_deploy/.*" - repo: local hooks: + - id: test lists format + name: Check for tabs and multiple spaces in test_lists txt files + entry: ./scripts/format_test_list.py + language: script + files: tests/integration/test_lists/.*\.txt$ - id: DCO check name: Checks the commit message for a developer certificate of origin signature entry: ./scripts/dco_check.py diff --git a/scripts/format_test_list.py b/scripts/format_test_list.py new file mode 100755 index 0000000000..280fd89693 --- /dev/null +++ b/scripts/format_test_list.py @@ -0,0 +1,48 @@ +#!/usr/bin/env python3 +"""Normalize tabs and multiple spaces to single spaces in files.""" +import argparse +import re +import sys + + +def normalize_whitespace(content: str) -> str: + """Remove leading whitespace, replace tabs and multiple spaces with single spaces.""" + lines = content.splitlines(keepends=True) + normalized_lines = [] + + for line in lines: + # Remove leading whitespace and tabs + line = line.lstrip(' \t') + # Replace tabs with single space + line = line.replace('\t', ' ') + # Replace multiple spaces with single space + line = re.sub(r' +', ' ', line) + normalized_lines.append(line) + + return ''.join(normalized_lines) + + +def main(): + parser = argparse.ArgumentParser( + description='Normalize tabs and multiple spaces to single spaces') + parser.add_argument('filenames', nargs='*', help='Filenames to fix') + args = parser.parse_args() + + retval = 0 + for filename in args.filenames: + with open(filename, 'r', encoding='utf-8') as f: + original_contents = f.read() + + normalized_contents = normalize_whitespace(original_contents) + + if original_contents != normalized_contents: + print(f'Fixing {filename}') + with open(filename, 'w', encoding='utf-8') as f: + f.write(normalized_contents) + retval = 1 + + return retval + + +if __name__ == '__main__': + sys.exit(main()) diff --git a/tests/integration/test_lists/waives.txt b/tests/integration/test_lists/waives.txt index 996d66c56c..08aa10567d 100644 --- a/tests/integration/test_lists/waives.txt +++ b/tests/integration/test_lists/waives.txt @@ -55,7 +55,7 @@ full:B200_PCIe/unittest/test_model_runner_cpp.py SKIP (Disable for Blackwell) full:B200_PCIe/unittest/llmapi/test_llm_models.py -m "part0" SKIP (Disable for Blackwell for context fmha doesn't support when headsize is 80/96) full:B200_PCIe/examples/test_nemotron.py::test_llm_nemotron_3_8b_1gpu[bfloat16-fp8] SKIP (megatron-core 0.8 is not supported in python 3.12) full:B200_PCIe/accuracy/test_cli_flow.py::TestMixtral8x7B::test_fp4_plugin SKIP (Disable for Blackwell OOM) -full:B200_PCIe/unittest/llmapi/test_llm_models.py -m "not (part0 or part1)" SKIP (Disable for Blackwell OOM) +full:B200_PCIe/unittest/llmapi/test_llm_models.py -m "not (part0 or part1)" SKIP (Disable for Blackwell OOM) full:B200/unittest/trt/functional SKIP (Disable for Blackwell) full:B200/unittest/trt/quantization SKIP (Disable for Blackwell) full:B200/unittest/trt/attention/test_bert_attention.py SKIP (Disable for Blackwell) @@ -70,7 +70,7 @@ full:B200/unittest/llmapi/test_llm_models.py -m "part0" SKIP (Disable for Blackw full:B200/examples/test_multimodal.py::test_llm_multimodal_general[video-neva-pp:1-tp:1-bfloat16-bs:1-cpp_e2e:False-nb:1] SKIP (megatron-core 0.8 is not supported in python 3.12) full:B200/examples/test_nemotron.py::test_llm_nemotron_3_8b_1gpu[bfloat16-fp8] SKIP (megatron-core 0.8 is not supported in python 3.12) full:B200/accuracy/test_cli_flow.py::TestMixtral8x7B::test_fp4_plugin SKIP (Disable for Blackwell OOM) -full:B200/unittest/llmapi/test_llm_models.py -m "not (part0 or part1)" SKIP (Disable for Blackwell OOM) +full:B200/unittest/llmapi/test_llm_models.py -m "not (part0 or part1)" SKIP (Disable for Blackwell OOM) full:B200/examples/test_mixtral.py::test_llm_mixtral_moe_plugin_fp8_lora_4gpus[Mixtral-8x7B-v0.1-chinese-mixtral-lora] SKIP (https://nvbugs/5064768) examples/test_qwen.py::test_llm_qwen_moe_multi_gpu_summary[qwen2_57b_a14b-tp4pp1-context_fmha] SKIP (https://nvbugs/5063469) examples/test_qwen.py::test_llm_qwen_moe_multi_gpu_summary[qwen2_57b_a14b-tp2pp2-context_fmha_fp32_acc] SKIP (https://nvbugs/5063469)