Bug: tools.model_benchmark uses hardcoded ':' for PYTHONPATH instead of os.pathsep

Đã đóng
#1,861 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Một pull request liên quan đã được merge.

  • #1862 của @mangeshraut712 — đã merge

Đánh giá

Độ khó
1/5
Thời gian dự kiến
Dưới một giờ
Mức phù hợp với người mới
25/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
python
Lĩnh vực
tooling

Hướng nghiên cứu

The issue identifies tools/model_benchmark.py and tools/tests/test_model_benchmark.py. Read aiperf_command and the existing assertion, then check how the environment constructs PYTHONPATH and how the test splits it. Done means both use the platform path separator and the test passes on supported platforms.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

bug
Affected area

Validation or benchmarking

TensorRT-Model-Connect version

main (commit cd87bfc3)

Installation method

Other

Model and revision

not model-specific

Environment

OS: Windows / Linux
GPU: N/A
Driver: N/A
CUDA: N/A
TensorRT: N/A
Container image or package: Python 3.10+ (tools/model_benchmark.py)

Minimal reproducer
import argparse
from pathlib import Path
from tools.model_benchmark import aiperf_command

args = argparse.Namespace(
    aiperf_python=Path("python"),
    environment=Path("env.yaml"),
    out_root=Path("out"),
    model=[],
    shard=None,
    rerun=False,
)

command, env = aiperf_command(args)
print("PYTHONPATH:", env["PYTHONPATH"])
Observed behavior

In tools/model_benchmark.py (line 47), aiperf_command constructs PYTHONPATH using a hardcoded colon separator:

return command, {"PYTHONPATH": ":".join(str(REPOSITORY / root) for root in roots)}

On Windows platforms, filesystem paths contain drive letters (e.g. C:...) and Python parses PYTHONPATH using os.pathsep (';'). Joining paths with ':' breaks the path search list, preventing Python from splitting the directories properly and causing ModuleNotFoundError: No module named 'trtmc_aiperf_qual' when running the benchmark.

Expected behavior

tools/model_benchmark.py should use os.pathsep.join(...) instead of a hardcoded ":" so that PYTHONPATH is formatted portably across all supported operating systems.

In tools/tests/test_model_benchmark.py (line 19), the assertion should also be updated to split on os.pathsep instead of hardcoded ":".

Relevant logs
ModuleNotFoundError: No module named 'trtmc_aiperf_qual'
Submission checks
  • I searched open and closed issues and found no duplicate.
  • This is not a security vulnerability.
  • I removed secrets, credentials, private URLs, and restricted artifacts.
Ngôn ngữ chính
Python
Star
283
Fork
75
Merge trung bình
1 ngày 23 giờ
Pull request đã merge (30 ngày)
227

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của NVIDIA/TensorRT-Model-Connect

Tất cả issue của NVIDIA/TensorRT-Model-Connect

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.