From 457dc02ac10ed73fb42903954ac580ea6c6aaebc Mon Sep 17 00:00:00 2001 From: Kyle Sayers Date: Thu, 17 Jul 2025 18:55:17 -0400 Subject: [PATCH 1/2] update bug report template, add env tools Signed-off-by: Kyle Sayers --- .github/ISSUE_TEMPLATE/bug_report.md | 75 +++++++++++++++++----------- tools/collect_env.py | 55 ++++++++++++++++++++ 2 files changed, 101 insertions(+), 29 deletions(-) create mode 100644 tools/collect_env.py diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index e950ced4b..0d44f8140 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -1,31 +1,48 @@ --- -name: Bug report -about: Create a report to help us improve +name: 🐛 Bug report +about: Raise an issue here if you find a bug. labels: bug - ---- - -**Describe the bug** -A clear and concise description of what the bug is. - -**Expected behavior** -A clear and concise description of what you expected to happen. - -**Environment** -Include all relevant environment information: -1. OS [e.g. Ubuntu 20.04]: -2. Python version [e.g. 3.7]: -3. LLM Compressor version or commit hash [e.g. 0.1.0, `f7245c8`]: -4. ML framework version(s) [e.g. torch 2.3.1]: -5. Other Python package versions [e.g. vLLM, compressed-tensors, numpy, ONNX]: -6. Other relevant environment information [e.g. hardware, CUDA version]: - -**To Reproduce** -Exact steps to reproduce the behavior: - - -**Errors** -If applicable, add a full print-out of any errors or exceptions that are raised or include screenshots to help explain your problem. - -**Additional context** -Add any other context about the problem here. Also include any relevant files. +title: "[Bug]: " + +body: +- type: markdown + attributes: + value: > + #### Before submitting an issue, please make sure the issue hasn't been already addressed by searching through [the existing and past issues](https://github.com/vllm-project/vllm/issues?q=is%3Aissue+sort%3Acreated-desc+). + + #### ⚠️ For any issues related vLLM which are not related to quantization or compressed models, please create an issue in [vllm-project/vllm](https://github.com/vllm-project/vllm/issues). +- type: textarea + attributes: + label: ⚙️ Your current environment + description: | + Please run the following and paste the output below. + ```bash + wget https://raw.githubusercontent.com/vllm-project/llm-compressor/main/tools/collect_env.py + # For security purposes, please feel free to check the contents of collect_env.py before running it. + python collect_env.py + ``` + value: | +
+ The output of python collect_env.py + + ```text + Your output of `python collect_env.py` here + ``` + +
+ validations: + required: true +- type: textarea + attributes: + label: 🐛 Describe the bug + description: | + Please provide a clear and concise description of what the bug is. + validations: + required: true +- type: textarea + attributes: + label: 🛠️ Steps to reproduce + description: | + If applicable, please describe any steps required to reproduce. If you can share an applicable huggingface model stub, please do so here. + validations: + required: false diff --git a/tools/collect_env.py b/tools/collect_env.py new file mode 100644 index 000000000..1294aa8f4 --- /dev/null +++ b/tools/collect_env.py @@ -0,0 +1,55 @@ +""" +Script used to generate environment information for the purpose of +creating bug reports. See `.github/ISSUE_TEMPLATE/bug_report.md` +""" + +import platform +import sys +import importlib.util + +def get_version(pkg_name): + try: + spec = importlib.util.find_spec(pkg_name) + if spec is None: + return "Not installed" + pkg = importlib.import_module(pkg_name) + return getattr(pkg, '__version__', 'Unknown version') + except Exception as e: + return f"Error: {e}" + +def get_torch_hardware_info(): + try: + import torch + cuda_devices = [] + amd_devices = [] + if torch.cuda.is_available(): + for i in range(torch.cuda.device_count()): + name = torch.cuda.get_device_name(i) + if "AMD" in name.upper(): + amd_devices.append(name) + else: + cuda_devices.append(name) + return cuda_devices, amd_devices + except ImportError: + return [], [] + +def collect_environment_info(): + cuda_devices, amd_devices = get_torch_hardware_info() + + info = { + "Operating System": platform.platform(), + "Python Version": sys.version.replace("\n", " "), + "llm-compressor Version": get_version("llmcompressor"), + "compressed-tensors Version": get_version("compressed_tensors"), + "transformers Version": get_version("transformers"), + "torch Version": get_version("torch"), + "CUDA Devices": cuda_devices if cuda_devices else "None", + "AMD Devices": amd_devices if amd_devices else "None", + } + + print("### Environment Information ###") + for key, value in info.items(): + print(f"{key}: `{value}`") + +if __name__ == "__main__": + collect_environment_info() From 0e5a62856badc6658df37ab5eb014f2f1fe52b9f Mon Sep 17 00:00:00 2001 From: Kyle Sayers Date: Thu, 17 Jul 2025 19:05:19 -0400 Subject: [PATCH 2/2] fix link, simplify tool Signed-off-by: Kyle Sayers --- .github/ISSUE_TEMPLATE/bug_report.md | 2 +- tools/collect_env.py | 12 ++++-------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 0d44f8140..c9c5f8832 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -8,7 +8,7 @@ body: - type: markdown attributes: value: > - #### Before submitting an issue, please make sure the issue hasn't been already addressed by searching through [the existing and past issues](https://github.com/vllm-project/vllm/issues?q=is%3Aissue+sort%3Acreated-desc+). + #### Before submitting an issue, please make sure the issue hasn't been already addressed by searching through [the existing and past issues](https://github.com/vllm-project/llm-compressor/issues?q=is%3Aissue+sort%3Acreated-desc+). #### ⚠️ For any issues related vLLM which are not related to quantization or compressed models, please create an issue in [vllm-project/vllm](https://github.com/vllm-project/vllm/issues). - type: textarea diff --git a/tools/collect_env.py b/tools/collect_env.py index 1294aa8f4..f7c2e869f 100644 --- a/tools/collect_env.py +++ b/tools/collect_env.py @@ -5,17 +5,13 @@ import platform import sys -import importlib.util +import importlib def get_version(pkg_name): try: - spec = importlib.util.find_spec(pkg_name) - if spec is None: - return "Not installed" - pkg = importlib.import_module(pkg_name) - return getattr(pkg, '__version__', 'Unknown version') - except Exception as e: - return f"Error: {e}" + return importlib.metadata.version(pkg_name) + except importlib.metadata.PackageNotFoundError: + return "None" def get_torch_hardware_info(): try: