fix: Fix PR comments

This commit is contained in:
Hugo Larcher 2024-08-30 15:41:43 +02:00
parent 345d47362f
commit a258e8f66a
No known key found for this signature in database
GPG Key ID: 3DAF63124699CA2B
5 changed files with 10 additions and 15 deletions

View File

@ -20,6 +20,8 @@ env:
jobs: jobs:
load-tests: load-tests:
permissions:
issues: write
concurrency: concurrency:
group: ${{ github.workflow }}-${{ github.job }}-${{ github.head_ref || github.run_id }} group: ${{ github.workflow }}-${{ github.job }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true cancel-in-progress: true

View File

@ -7,7 +7,7 @@ download-dataset:
echo "Dataset already downloaded"; \ echo "Dataset already downloaded"; \
fi fi
load-test: export PATH = $(shell pwd)/.bin/:$(PATH) load-test: export PATH := $(shell pwd)/.bin/:$(PATH)
load-test: download-dataset load-test: download-dataset
poetry install && poetry run python load_test.py poetry install && poetry run python load_test.py

View File

@ -83,7 +83,7 @@ class TGIDockerRunner(InferenceEngineRunner):
volumes[v[0]] = {"bind": v[1], "mode": "rw"} volumes[v[0]] = {"bind": v[1], "mode": "rw"}
self.container = run_docker(self.image, params, self.container = run_docker(self.image, params,
"Connected", "Connected",
"Error", "ERROR",
volumes=volumes) volumes=volumes)
def stop(self): def stop(self):

View File

@ -6,17 +6,11 @@ from enum import Enum
from typing import Any, Dict, List from typing import Any, Dict, List
import numpy as np import numpy as np
from jinja2 import Environment, PackageLoader, select_autoescape
from loguru import logger from loguru import logger
from transformers import LlamaTokenizerFast from transformers import LlamaTokenizerFast
from benchmarks.utils import kill from benchmarks.utils import kill
env = Environment(
loader=PackageLoader("benchmarks"),
autoescape=select_autoescape()
)
class ExecutorInputType(Enum): class ExecutorInputType(Enum):
CONSTANT_TOKENS = "constant_tokens" CONSTANT_TOKENS = "constant_tokens"
@ -148,8 +142,8 @@ class K6Benchmark:
env_vars = [] env_vars = []
for key, val in self.k6_config.executor.variables.items(): for key, val in self.k6_config.executor.variables.items():
env_vars += ["-e", f"{key.upper()}={val}"] env_vars += ["-e", f"{key.upper()}={val}"]
env_vars += ["-e", f"MAX_NEW_TOKENS={self.k6_config.executor.variables['max_new_tokens']}"]
env_vars += ["-e", f"INPUT_FILENAME={self.k6_config.executor.input_filename}"] env_vars += ["-e", f"INPUT_FILENAME={self.k6_config.executor.input_filename}"]
env_vars += ["-e", f"TEST_EXECUTOR={self.k6_config.executor.name}"]
args = ["k6", "run", "--out", "json=results.json"] + env_vars + ["main.js"] args = ["k6", "run", "--out", "json=results.json"] + env_vars + ["main.js"]
logger.info(f"Running k6 with parameters: {args}") logger.info(f"Running k6 with parameters: {args}")
logger.info(f"K6Config is: {self.k6_config}") logger.info(f"K6Config is: {self.k6_config}")

View File

@ -23,7 +23,6 @@ const max_new_tokens = parseInt(__ENV.MAX_NEW_TOKENS)
const input_filename = __ENV.INPUT_FILENAME; const input_filename = __ENV.INPUT_FILENAME;
if (input_filename === undefined) { if (input_filename === undefined) {
throw new Error('INPUT_FILENAME must be defined'); throw new Error('INPUT_FILENAME must be defined');
} }
const shareGPT = JSON.parse(open(input_filename)) const shareGPT = JSON.parse(open(input_filename))
@ -138,17 +137,17 @@ export default function run() {
} }
export function get_options() { export function get_options() {
const test_type = __ENV.TEST_TYPE; const test_executor = __ENV.TEST_EXECUTOR;
if (test_type === undefined) { if (test_executor === undefined) {
throw new Error('TEST_TYPE must be defined'); throw new Error('TEST_EXECUTOR must be defined');
} }
switch (test_type) { switch (test_executor) {
case 'constant_arrival_rate': case 'constant_arrival_rate':
return get_constant_arrival_rate_options(); return get_constant_arrival_rate_options();
case 'constant_vus': case 'constant_vus':
return get_constant_vus_options(); return get_constant_vus_options();
default: default:
throw new Error('Invalid test type'); throw new Error('Invalid test executor');
} }
} }