-
Notifications
You must be signed in to change notification settings - Fork 157
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
add script to test phi op #1410
Merged
Merged
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
cfd8142
add script to test phi op
DDDivano 2b8cb81
add script to test phi op
DDDivano 231636b
add script to test phi op
DDDivano bf69ec6
add script to test phi op
DDDivano 0caf5e8
add script to test phi op
DDDivano 02826c0
add script to test phi op test=document_fix
DDDivano File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
import datetime | ||
import os | ||
import argparse | ||
|
||
import yaml | ||
import wget | ||
|
||
|
||
def get_phi_op_list(): | ||
# 指定phi配置文件 | ||
DATA_URL = "https://raw.githubusercontent.com/PaddlePaddle/Paddle/develop/python/paddle/utils/code_gen/api.yaml" | ||
file_name = "phi_api_list.yaml" | ||
|
||
try: | ||
if os.path.exists(file_name): | ||
os.remove(file_name) | ||
print("目录下已经存在旧phi列表,正在删除旧phi列表") | ||
print("开始下载新phi列表") | ||
wget.download(DATA_URL, out=file_name) | ||
print("下载完成") | ||
except Exception as e: | ||
print("下载yaml失败") | ||
print(e) | ||
exit(1) | ||
|
||
try: | ||
with open(file_name) as f: | ||
yml = yaml.load(f, Loader=yaml.FullLoader) | ||
|
||
except Exception as e: | ||
print("yaml 载入失败") | ||
print(e) | ||
exit(1) | ||
phi_op_list = [] | ||
for i in yml: | ||
phi_op_list.append(i["api"]) | ||
phi_op_string = ",".join(i for i in phi_op_list) | ||
return phi_op_string | ||
|
||
|
||
def main(): | ||
pass | ||
|
||
|
||
if __name__ == '__main__': | ||
parser = argparse.ArgumentParser(description=__doc__) | ||
parser.add_argument( | ||
'--base_dir', | ||
type=str, | ||
help='input the benchmark code directory' | ||
) | ||
parser.add_argument( | ||
'--log_dir', | ||
type=str, | ||
help='input the log dir' | ||
) | ||
parser.add_argument( | ||
'--op_list', | ||
type=str, | ||
default=None, | ||
help='specify the operator list.') | ||
args = parser.parse_args() | ||
base_dir = args.base_dir | ||
main_control = base_dir + "/deploy/main_control.sh" | ||
module_name = base_dir + "/dynamic_tests_v2" | ||
configs = base_dir + "/tests_v2/configs" | ||
logdir = args.log_dir | ||
oplist = args.op_list | ||
if oplist is None: | ||
oplist = get_phi_op_list() | ||
cmd = "bash {} {} {} {} 0 gpu speed none both dynamic {}".format(main_control, | ||
module_name, | ||
configs, | ||
logdir, | ||
oplist) | ||
print("[cmd] {}".format(cmd)) | ||
os.system(cmd) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
PWD=`pwd` | ||
python ./deploy/run_phi_op.py --base_dir $PWD --log_dir logs | ||
cd deploy | ||
python summary.py ../logs --dump_to_excel True --dump_to_mysql False |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个logs的命名需不需要完善下