Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

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

已关闭
#1,861 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

已经有一个关联 PR 被合并了。

  • #1862 来自 @mangeshraut712 —— 已合并

评估

难度
1/5
预计耗时
1 小时以内
新手友好度
25/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
停滞
技术栈
python
领域
tooling

调研方向

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.

由索引模型根据 Issue 内容生成。

描述

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.
主要语言
Python
星标
283
派生
75
平均合并
1 天 18 小时
30 天内合并 PR
220

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

NVIDIA/TensorRT-Model-Connect 的其他 Issue

查看 NVIDIA/TensorRT-Model-Connect 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。