Skip to content
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

support special packages #220

Merged
merged 2 commits into from
Aug 29, 2023
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions docs/dev/inference-case-doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,8 @@ exist_compiler_path: null

对于某些case,如需要镜像本身以外的pip包,可在benchmarks/&lt;case\>/\<framework\>下添加requirements.txt,框架启动时会自动在运行此次评测的镜像中安装

对于部分厂商适配case,如果需要与标准case不同,且不能包含在厂商dockerfile中的包(例如,yolov5标准case依赖于pycocotools2.0.4,厂商A只接受pycocotools2.0.7),则可以在同目录下添加\<vendor\>_requirements.txt(如nvidia\_requirements.txt)。框架在自动安装时如果检测到对应vendor的文件,则会**忽略标准case的“requirements.txt,只安装该厂商指定的\<vendor\>\_requirements.txt**。

##### 3.2.1 config

对于标准case、需要组织的是configurations.yaml、parameters.yaml,及vendor_config/nvidia_configurations.yaml。
Expand Down
10 changes: 8 additions & 2 deletions inference/utils/prepare_in_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,14 @@ def install_requriements(vendor, model, framework, pipsource):
framework_path = os.path.join(case_path, framework_name)

req_file = os.path.join(framework_path, "requirements.txt")
print(req_file)
env_file = os.path.join(framework_path, "environment_variables.sh")

vendor_filename = vendor + "_requirements.txt"
vendor_req_file = os.path.join(framework_path, vendor_filename)
if os.path.exists(vendor_req_file):
req_file = vendor_req_file

env_file = os.path.join(framework_path, "environment_variables.sh")

if not os.path.isfile(req_file):
print("requirenments file ", req_file, " doesn't exist. Do nothing.")
return 0
Expand Down