Skip to content

Commit 6976e4c

Browse files
committed
Update on "[Executorch] Add broadcasting support to optimized op_sub"
Summary: This diff builds on top of previous one to add support for limited handling of broadcasting for sub Test Plan: tests added Reviewers: Subscribers: Tasks: Tags: cc larryliu0820 manuelcandales Differential Revision: [D69491818](https://our.internmc.facebook.com/intern/diff/D69491818) [ghstack-poisoned]
2 parents e702317 + 5dc6033 commit 6976e4c

File tree

198 files changed

+3995
-1386
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

198 files changed

+3995
-1386
lines changed

.ci/scripts/build_llama_android.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ if [[ -z "${PYTHON_EXECUTABLE:-}" ]]; then
1414
PYTHON_EXECUTABLE=python3
1515
fi
1616
which "${PYTHON_EXECUTABLE}"
17-
CMAKE_PREFIX_PATH="$(python3 -c 'import torch as _; print(_.__path__[0])')"
1817

1918
install_executorch_and_backend_lib() {
2019
echo "Installing executorch and xnnpack backend"
@@ -28,7 +27,6 @@ install_executorch_and_backend_lib() {
2827
-DANDROID_ABI="${ANDROID_ABI}" \
2928
-DCMAKE_INSTALL_PREFIX=cmake-android-out \
3029
-DCMAKE_BUILD_TYPE=Release \
31-
-DCMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH}" \
3230
-DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \
3331
-DEXECUTORCH_BUILD_EXTENSION_MODULE=ON \
3432
-DEXECUTORCH_BUILD_EXTENSION_TENSOR=ON \
@@ -54,7 +52,6 @@ build_llama_runner() {
5452
-DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \
5553
-DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON \
5654
-DEXECUTORCH_BUILD_KERNELS_CUSTOM=ON \
57-
-DCMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH}" \
5855
-Bcmake-android-out/examples/models/llama examples/models/llama
5956

6057
cmake --build cmake-android-out/examples/models/llama -j4 --config Release

.ci/scripts/setup-linux.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ fi
2222
# have already been installed, so we use PyTorch build from source here instead
2323
# of nightly. This allows CI to test against latest commits from PyTorch
2424
install_executorch "use-pt-pinned-commit"
25-
build_executorch_runner "${BUILD_TOOL}"
25+
build_executorch_runner "${BUILD_TOOL}" "${2:-Release}"
2626

2727
if [[ "${GITHUB_BASE_REF:-}" == *main* || "${GITHUB_BASE_REF:-}" == *gh* ]]; then
2828
do_not_use_nightly_on_ci

.ci/scripts/setup-macos.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ install_pytorch_and_domains
136136
# We build PyTorch from source here instead of using nightly. This allows CI to test against
137137
# the pinned commit from PyTorch
138138
install_executorch "use-pt-pinned-commit"
139-
build_executorch_runner "${BUILD_TOOL}"
139+
build_executorch_runner "${BUILD_TOOL}" "${2:-Release}"
140140

141141
if [[ "${GITHUB_BASE_REF:-}" == *main* || "${GITHUB_BASE_REF:-}" == *gh* ]]; then
142142
do_not_use_nightly_on_ci

.ci/scripts/test_llama.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,6 @@ cmake_install_executorch_libraries() {
154154
rm -rf cmake-out
155155
retry cmake \
156156
-DCMAKE_INSTALL_PREFIX=cmake-out \
157-
-DCMAKE_PREFIX_PATH="$(python3 -c 'import torch as _; print(_.__path__[0])')" \
158157
-DCMAKE_BUILD_TYPE="$CMAKE_BUILD_TYPE" \
159158
-DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \
160159
-DEXECUTORCH_BUILD_EXTENSION_MODULE=ON \

.ci/scripts/test_llava.sh

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ NPROC=8
3131
if hash nproc &> /dev/null; then NPROC=$(nproc); fi
3232

3333
python_lib=$($PYTHON_EXECUTABLE -c 'from distutils.sysconfig import get_python_lib; print(get_python_lib())')
34-
CMAKE_PREFIX_PATH="$(python3 -c 'import torch as _; print(_.__path__[0])')"
3534
EXECUTORCH_COMMON_CMAKE_ARGS=" \
3635
-DCMAKE_INSTALL_PREFIX=${BUILD_DIR} \
3736
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} \
@@ -48,7 +47,6 @@ EXECUTORCH_COMMON_CMAKE_ARGS=" \
4847
cmake_install_executorch_libraries() {
4948
cmake \
5049
${EXECUTORCH_COMMON_CMAKE_ARGS} \
51-
"-DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}" \
5250
-B${BUILD_DIR} .
5351

5452
cmake --build ${BUILD_DIR} -j${NPROC} --target install --config ${CMAKE_BUILD_TYPE}
@@ -59,7 +57,6 @@ cmake_install_executorch_libraries_for_android() {
5957
-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK/build/cmake/android.toolchain.cmake \
6058
-DANDROID_ABI=arm64-v8a \
6159
${EXECUTORCH_COMMON_CMAKE_ARGS} \
62-
"-DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}" \
6360
-B${BUILD_DIR} .
6461

6562
cmake --build ${BUILD_DIR} -j${NPROC} --target install --config ${CMAKE_BUILD_TYPE}
@@ -80,7 +77,7 @@ cmake_build_llava_runner() {
8077

8178
cmake \
8279
${LLAVA_COMMON_CMAKE_ARGS} \
83-
-DCMAKE_PREFIX_PATH="$python_lib;${CMAKE_PREFIX_PATH}" \
80+
-DCMAKE_PREFIX_PATH="$python_lib" \
8481
-B${BUILD_DIR}/${dir} \
8582
${dir}
8683

@@ -96,7 +93,7 @@ cmake_build_llava_runner_for_android() {
9693
-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK/build/cmake/android.toolchain.cmake \
9794
-DANDROID_ABI=arm64-v8a \
9895
${LLAVA_COMMON_CMAKE_ARGS} \
99-
-DCMAKE_PREFIX_PATH="$python_lib;${CMAKE_PREFIX_PATH}" \
96+
-DCMAKE_PREFIX_PATH="$python_lib" \
10097
-DLLAVA_RUNNER_NO_TORCH_DUMMY_IMAGE=ON \
10198
-B${BUILD_DIR}/${dir} \
10299
${dir}

.ci/scripts/test_model.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,10 @@ prepare_artifacts_upload() {
5050

5151
build_cmake_executor_runner() {
5252
echo "Building executor_runner"
53-
CMAKE_PREFIX_PATH="$(python3 -c 'import torch as _; print(_.__path__[0])')"
5453
rm -rf ${CMAKE_OUTPUT_DIR}
5554
cmake -DCMAKE_BUILD_TYPE=Debug \
5655
-DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \
5756
-DPYTHON_EXECUTABLE="$PYTHON_EXECUTABLE" \
58-
-DCMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH" \
5957
-B${CMAKE_OUTPUT_DIR} .
6058

6159
cmake --build ${CMAKE_OUTPUT_DIR} -j4 --config Debug
@@ -100,14 +98,12 @@ test_model() {
10098

10199
build_cmake_xnn_executor_runner() {
102100
echo "Building xnn_executor_runner"
103-
CMAKE_PREFIX_PATH="$(python3 -c 'import torch as _; print(_.__path__[0])')"
104101

105102
(rm -rf ${CMAKE_OUTPUT_DIR} \
106103
&& mkdir ${CMAKE_OUTPUT_DIR} \
107104
&& cd ${CMAKE_OUTPUT_DIR} \
108105
&& retry cmake -DCMAKE_BUILD_TYPE=Release \
109106
-DEXECUTORCH_BUILD_XNNPACK=ON \
110-
-DCMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH" \
111107
-DPYTHON_EXECUTABLE="$PYTHON_EXECUTABLE" ..)
112108

113109
cmake --build ${CMAKE_OUTPUT_DIR} -j4

.ci/scripts/test_phi_3_mini.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,8 @@ NPROC=8
2222
if hash nproc &> /dev/null; then NPROC=$(nproc); fi
2323

2424
cmake_install_executorch_libraries() {
25-
CMAKE_PREFIX_PATH="$(python3 -c 'import torch as _; print(_.__path__[0])')"
2625
cmake -DPYTHON_EXECUTABLE=python \
2726
-DCMAKE_INSTALL_PREFIX=${BUILD_DIR} \
28-
-DCMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH}" \
2927
-DEXECUTORCH_ENABLE_LOGGING=1 \
3028
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
3129
-DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \
@@ -41,10 +39,8 @@ cmake_install_executorch_libraries() {
4139
}
4240

4341
cmake_build_phi_3_mini() {
44-
CMAKE_PREFIX_PATH="$(python3 -c 'import torch as _; print(_.__path__[0])')"
4542
cmake -DPYTHON_EXECUTABLE=$PYTHON_EXECUTABLE \
4643
-DCMAKE_INSTALL_PREFIX=${BUILD_DIR} \
47-
-DCMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH}" \
4844
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
4945
-DEXECUTORCH_BUILD_KERNELS_CUSTOM=ON \
5046
-DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \

.ci/scripts/test_qnn_static_llama.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ $PYTHON_EXECUTABLE -m extension.llm.tokenizer.tokenizer -t tokenizer.model -o to
3434

3535
set +e
3636
# Compile only as weight sharing is not applicable on x86
37-
$PYTHON_EXECUTABLE backends/qualcomm/tests/test_qnn_delegate.py -k TestExampleScript.test_stories_single_llama --model SM8650 --build_folder build-android/ --executorch_root . --artifact_dir . --compile_only
37+
$PYTHON_EXECUTABLE backends/qualcomm/tests/test_qnn_delegate.py -k TestExampleLLMScript.test_llama_stories_110m --model SM8650 --build_folder build-android/ --executorch_root . --artifact_dir . --llama_artifacts . --compile_only
3838
exit_code1=$?
3939

4040
# Checks accuracy with weight sharing disabled since x86 does not support weight sharing.
41-
$PYTHON_EXECUTABLE backends/qualcomm/tests/test_qnn_delegate.py -k TestExampleScript.test_stories_single_llama --model SM8650 --build_folder build-x86/ --executorch_root . --artifact_dir . --enable_x86_64
41+
$PYTHON_EXECUTABLE backends/qualcomm/tests/test_qnn_delegate.py -k TestExampleLLMScript.test_llama_stories_110m --model SM8650 --build_folder build-x86/ --executorch_root . --artifact_dir . --llama_artifacts . --enable_x86_64
4242
exit_code2=$?
4343

4444
# Check the exit codes and print messages

.ci/scripts/test_quantized_aot_lib.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,10 @@ CMAKE_OUTPUT_DIR=cmake-out
1616

1717
build_cmake_quantized_aot_lib() {
1818
echo "Building quantized aot lib"
19-
SITE_PACKAGES="$(${PYTHON_EXECUTABLE} -c 'from distutils.sysconfig import get_python_lib; print(get_python_lib())')"
20-
CMAKE_PREFIX_PATH="${SITE_PACKAGES}/torch"
2119
(rm -rf ${CMAKE_OUTPUT_DIR} \
2220
&& mkdir ${CMAKE_OUTPUT_DIR} \
2321
&& cd ${CMAKE_OUTPUT_DIR} \
2422
&& retry cmake -DCMAKE_BUILD_TYPE=Release \
25-
-DCMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH" \
2623
-DEXECUTORCH_BUILD_KERNELS_QUANTIZED_AOT=ON \
2724
-DPYTHON_EXECUTABLE="$PYTHON_EXECUTABLE" ..)
2825

.ci/scripts/unittest-buck2.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/env bash
2+
# Copyright (c) Meta Platforms, Inc. and affiliates.
3+
# All rights reserved.
4+
#
5+
# This source code is licensed under the BSD-style license found in the
6+
# LICENSE file in the root directory of this source tree.
7+
set -eux
8+
9+
# TODO: expand this to //...
10+
buck2 query //runtime/...
11+
12+
# TODO: expand the covered scope of Buck targets.
13+
buck2 build //runtime/core/portable_type/...
14+
buck2 test //runtime/core/portable_type/...

.ci/scripts/unittest-linux-cmake.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env bash
2+
# Copyright (c) Meta Platforms, Inc. and affiliates.
3+
# All rights reserved.
4+
#
5+
# This source code is licensed under the BSD-style license found in the
6+
# LICENSE file in the root directory of this source tree.
7+
set -eux
8+
9+
# Run pytest with coverage
10+
pytest -n auto --cov=./ --cov-report=xml
11+
# Run gtest
12+
LLVM_PROFDATA=llvm-profdata-12 LLVM_COV=llvm-cov-12 \
13+
test/run_oss_cpp_tests.sh

.ci/scripts/unittest-linux.sh

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#!/usr/bin/env bash
2+
# Copyright (c) Meta Platforms, Inc. and affiliates.
3+
# All rights reserved.
4+
#
5+
# This source code is licensed under the BSD-style license found in the
6+
# LICENSE file in the root directory of this source tree.
7+
set -eux
8+
9+
BUILD_TOOL=$1
10+
if [[ $BUILD_TOOL =~ ^(cmake|buck2)$ ]]; then
11+
echo "Running unittests for ${BUILD_TOOL} ..."
12+
else
13+
echo "Missing build tool (require buck2 or cmake), exiting..."
14+
exit 1
15+
fi
16+
17+
BUILD_MODE=$2
18+
if [[ "${BUILD_MODE:-}" =~ ^(Debug|Release)$ ]]; then
19+
echo "Running tests in build mode ${BUILD_MODE} ..."
20+
else
21+
echo "Unsupported build mode ${BUILD_MODE}, options are Debug or Release."
22+
exit 1
23+
fi
24+
25+
# The generic Linux job chooses to use base env, not the one setup by the image
26+
eval "$(conda shell.bash hook)"
27+
CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]")
28+
conda activate "${CONDA_ENV}"
29+
30+
# Setup swiftshader and Vulkan SDK which are required to build the Vulkan delegate
31+
source .ci/scripts/setup-vulkan-linux-deps.sh
32+
33+
PYTHON_EXECUTABLE=python \
34+
EXECUTORCH_BUILD_PYBIND=ON \
35+
CMAKE_ARGS="-DEXECUTORCH_BUILD_XNNPACK=ON -DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON" \
36+
.ci/scripts/setup-linux.sh "$BUILD_TOOL" "$BUILD_MODE"
37+
38+
# Install llama3_2_vision dependencies.
39+
PYTHON_EXECUTABLE=python ./examples/models/llama3_2_vision/install_requirements.sh
40+
41+
if [[ "$BUILD_TOOL" == "cmake" ]]; then
42+
.ci/scripts/unittest-linux-cmake.sh
43+
elif [[ "$BUILD_TOOL" == "buck2" ]]; then
44+
.ci/scripts/unittest-buck2.sh
45+
else
46+
echo "Unknown build tool $BUILD_TOOL"
47+
exit 1
48+
fi

.ci/scripts/unittest-macos-cmake.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env bash
2+
# Copyright (c) Meta Platforms, Inc. and affiliates.
3+
# All rights reserved.
4+
#
5+
# This source code is licensed under the BSD-style license found in the
6+
# LICENSE file in the root directory of this source tree.
7+
set -eux
8+
9+
# Run pytest with coverage
10+
${CONDA_RUN} pytest -n auto --cov=./ --cov-report=xml
11+
# Run gtest
12+
LLVM_PROFDATA="xcrun llvm-profdata" LLVM_COV="xcrun llvm-cov" \
13+
${CONDA_RUN} test/run_oss_cpp_tests.sh

.ci/scripts/unittest-macos.sh

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#!/usr/bin/env bash
2+
# Copyright (c) Meta Platforms, Inc. and affiliates.
3+
# All rights reserved.
4+
#
5+
# This source code is licensed under the BSD-style license found in the
6+
# LICENSE file in the root directory of this source tree.
7+
set -eux
8+
9+
BUILD_TOOL=$1
10+
if [[ $BUILD_TOOL =~ ^(cmake|buck2)$ ]]; then
11+
echo "Running unittests for ${BUILD_TOOL} ..."
12+
else
13+
echo "Missing build tool (require buck2 or cmake), exiting..."
14+
exit 1
15+
fi
16+
17+
BUILD_MODE=$2
18+
if [[ $BUILD_MODE =~ ^(Debug|Release)$ ]]; then
19+
echo "Running tests in build mode ${BUILD_MODE} ..."
20+
else
21+
echo "Unsupported build mode ${BUILD_MODE}, options are Debug or Release."
22+
exit 1
23+
fi
24+
25+
bash .ci/scripts/setup-conda.sh
26+
eval "$(conda shell.bash hook)"
27+
28+
# Create temp directory for sccache shims
29+
export TMP_DIR=$(mktemp -d)
30+
export PATH="${TMP_DIR}:$PATH"
31+
trap 'rm -rfv ${TMP_DIR}' EXIT
32+
33+
# Setup MacOS dependencies as there is no Docker support on MacOS atm
34+
PYTHON_EXECUTABLE=python \
35+
EXECUTORCH_BUILD_PYBIND=ON \
36+
CMAKE_ARGS="-DEXECUTORCH_BUILD_COREML=ON -DEXECUTORCH_BUILD_MPS=ON -DEXECUTORCH_BUILD_XNNPACK=ON -DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON" \
37+
${CONDA_RUN} --no-capture-output \
38+
.ci/scripts/setup-macos.sh "${BUILD_TOOL}" "${BUILD_MODE}"
39+
40+
# Install llama3_2_vision dependencies.
41+
PYTHON_EXECUTABLE=python \
42+
${CONDA_RUN} --no-capture-output \
43+
./examples/models/llama3_2_vision/install_requirements.sh
44+
45+
if [[ "$BUILD_TOOL" == "cmake" ]]; then
46+
.ci/scripts/unittest-macos-cmake.sh
47+
elif [[ "$BUILD_TOOL" == "buck2" ]]; then
48+
.ci/scripts/unittest-buck2.sh
49+
else
50+
echo "Unknown build tool $BUILD_TOOL"
51+
exit 1
52+
fi

.ci/scripts/utils.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ build_executorch_runner_cmake() {
109109
pushd "${CMAKE_OUTPUT_DIR}" || return
110110
# This command uses buck2 to gather source files and buck2 could crash flakily
111111
# on MacOS
112-
retry cmake -DPYTHON_EXECUTABLE="${PYTHON_EXECUTABLE}" -DCMAKE_BUILD_TYPE=Release ..
112+
retry cmake -DPYTHON_EXECUTABLE="${PYTHON_EXECUTABLE}" -DCMAKE_BUILD_TYPE="${1:-Release}" ..
113113
popd || return
114114

115115
if [ "$(uname)" == "Darwin" ]; then
@@ -124,7 +124,7 @@ build_executorch_runner() {
124124
if [[ $1 == "buck2" ]]; then
125125
build_executorch_runner_buck2
126126
elif [[ $1 == "cmake" ]]; then
127-
build_executorch_runner_cmake
127+
build_executorch_runner_cmake "$2"
128128
else
129129
echo "Invalid build tool $1. Only buck2 and cmake are supported atm"
130130
exit 1
@@ -136,7 +136,6 @@ cmake_install_executorch_lib() {
136136
clean_executorch_install_folders
137137
retry cmake -DBUCK2="$BUCK" \
138138
-DCMAKE_INSTALL_PREFIX=cmake-out \
139-
-DCMAKE_PREFIX_PATH="$($PYTHON_EXECUTABLE -c 'import torch as _; print(_.__path__[0])')" \
140139
-DCMAKE_BUILD_TYPE=Release \
141140
-DPYTHON_EXECUTABLE="$PYTHON_EXECUTABLE" \
142141
-Bcmake-out .

.github/ISSUE_TEMPLATE/bug-report.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ body:
2121
A clear and concise description of what the bug is.
2222
2323
```python
24-
# Sample code to reproduce the problem
24+
# Sample code to reproduce the problem. If applicable, also include your model export command.
2525
```
2626
2727
```

.github/scripts/extract_benchmark_results.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -229,21 +229,22 @@ def extract_ios_metric(
229229

230230
elif method == "forward":
231231
if metric_name == "Clock Monotonic Time, s":
232-
benchmark_result["metric"] = (
233-
"generate_time(ms)"
234-
if "llama" in test_name
235-
else "avg_inference_latency(ms)"
236-
)
232+
benchmark_result["metric"] = "avg_inference_latency(ms)"
237233
benchmark_result["actualValue"] = metric_value * 1000
238234

239235
elif metric_name == "Memory Peak Physical, kB":
240236
# NB: Showing the value in mB is friendlier IMO
241237
benchmark_result["metric"] = "peak_inference_mem_usage(mb)"
242238
benchmark_result["actualValue"] = metric_value / 1024
243239

244-
elif method == "generate" and metric_name == "Tokens Per Second, t/s":
245-
benchmark_result["metric"] = "token_per_sec"
246-
benchmark_result["actualValue"] = metric_value
240+
elif method == "generate":
241+
if metric_name == "Clock Monotonic Time, s":
242+
benchmark_result["metric"] = "generate_time(ms)"
243+
benchmark_result["actualValue"] = metric_value * 1000
244+
245+
elif metric_name == "Tokens Per Second, t/s":
246+
benchmark_result["metric"] = "token_per_sec"
247+
benchmark_result["actualValue"] = metric_value
247248

248249
return benchmark_result
249250

0 commit comments

Comments
 (0)