Skip to content

Commit 907dc19

Browse files
Support stresscli for codegen (#87)
* Support stresscli fr codegen * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 211b560 commit 907dc19

File tree

5 files changed

+12
-14
lines changed

5 files changed

+12
-14
lines changed

evals/benchmark/benchmark.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"llm_serving": "/v1/chat/completions",
2020
"e2e": "/v1/chatqna",
2121
},
22-
"codegen": {"llm": "/v1/chat/completions", "llm_serving": "/v1/chat/completions", "e2e": "/v1/codegen"},
22+
"codegen": {"llm": "/generate_stream", "llm_serving": "/v1/chat/completions", "e2e": "/v1/codegen"},
2323
"codetrans": {"llm": "/generate", "llm_serving": "/v1/chat/completions", "e2e": "/v1/codetrans"},
2424
"faqgen": {"llm": "/v1/chat/completions", "llm_serving": "/v1/chat/completions", "e2e": "/v1/faqgen"},
2525
"audioqna": {

evals/benchmark/benchmark.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ test_cases:
6060
codegen:
6161
llm:
6262
run_test: true
63-
service_name: "llm-svc" # Replace with your service name
63+
service_name: "llm-dependency-svc" # Replace with your service name
6464
parameters:
6565
model_name: "Qwen/CodeQwen1.5-7B-Chat"
6666
max_new_tokens: 128
@@ -71,10 +71,10 @@ test_cases:
7171
streaming: true
7272
llmserve:
7373
run_test: true
74-
service_name: "llm-serving-svc" # Replace with your service name
74+
service_name: "llm-svc" # Replace with your service name
7575
e2e:
7676
run_test: true
77-
service_name: "codegen-backend-server-svc" # Replace with your service name
77+
service_name: "codegen-backend-svc" # Replace with your service name
7878

7979
codetrans:
8080
llm:

evals/benchmark/stresscli/locust/codegenbench.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
import tokenresponse as token
1010

1111
cwd = os.path.dirname(__file__)
12-
filename = f"{cwd}/../dataset/chatqna.json"
13-
qlist = []
12+
filename = f"{cwd}/../dataset/codegen.json"
13+
qdict = {}
1414
try:
1515
with open(filename) as qfile:
16-
qlist = json.load(qfile)
16+
qdict = json.load(qfile)
1717
except:
1818
logging.error(f"Question File open failed: {filename}")
1919
exit()
@@ -24,10 +24,8 @@ def getUrl():
2424

2525

2626
def getReqData():
27-
qid = random.randint(1, 189)
28-
logging.debug(f"Selected question: {qlist[qid]['qText']}")
29-
30-
return {"messages": qlist[qid]["qText"], "max_tokens": 128}
27+
prompt = "50"
28+
return {"messages": qdict[prompt], "max_tokens": 128}
3129

3230

3331
def respStatics(environment, resp):

evals/benchmark/stresscli/locust/codegenfixed.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55

66

77
def getUrl():
8-
return "/v1/chatqna"
8+
return "/v1/codegen"
99

1010

1111
def getReqData():
1212
return {"messages": "What is the revenue of Nike in last 10 years before 2023? Give me detail", "max_tokens": 128}
1313

1414

15-
def respStatics(environment, resp):
16-
return token.respStatics(environment, resp)
15+
def respStatics(environment, reqData, respData):
16+
return token.respStatics(environment, reqData, respData)
1717

1818

1919
def staticsOutput(environment, reqlist):

0 commit comments

Comments
 (0)