From d5c38b958d9c106f443a8a3febcc7fe5b0d895e1 Mon Sep 17 00:00:00 2001 From: Ignavar Date: Tue, 15 Apr 2025 20:41:09 +0500 Subject: [PATCH] Ease of use changes to not manually have to install libraries like librosa and opencv when running benches in virtual env --- benches/llms/README.md | 8 +++++++- benches/llms/llama_cpp_python.yaml | 2 ++ benches/llms/mistralrs.yaml | 2 ++ benches/llms/phi4.yaml | 2 ++ benches/llms/qwen2.5.yaml | 2 ++ benches/llms/transformers.yaml | 2 ++ benches/mllm/pyproject.toml | 22 ++++++++++++++++++++++ 7 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 benches/mllm/pyproject.toml diff --git a/benches/llms/README.md b/benches/llms/README.md index f9d32dfb..80190cf9 100644 --- a/benches/llms/README.md +++ b/benches/llms/README.md @@ -1,6 +1,12 @@ # Benchmark LLM Speed -Use the following command to run the benchmark: +If you do not have a python virtual environment setup run + +'''bash +uv venv --seed -p 3.11 +''' + +Then Use the following command to run the benchmark: ```bash dora build transformers.yaml --uv diff --git a/benches/llms/llama_cpp_python.yaml b/benches/llms/llama_cpp_python.yaml index eabd2bbf..9fd824a1 100644 --- a/benches/llms/llama_cpp_python.yaml +++ b/benches/llms/llama_cpp_python.yaml @@ -1,5 +1,7 @@ nodes: - id: benchmark_script + build: | + pip install ../mllm path: ../mllm/benchmark_script.py inputs: text: llm/text diff --git a/benches/llms/mistralrs.yaml b/benches/llms/mistralrs.yaml index 929c9646..09bc5c2b 100644 --- a/benches/llms/mistralrs.yaml +++ b/benches/llms/mistralrs.yaml @@ -1,5 +1,7 @@ nodes: - id: benchmark_script + build: | + pip install ../mllm path: ../mllm/benchmark_script.py inputs: text: llm/text diff --git a/benches/llms/phi4.yaml b/benches/llms/phi4.yaml index 4859a406..b3f93943 100644 --- a/benches/llms/phi4.yaml +++ b/benches/llms/phi4.yaml @@ -1,5 +1,7 @@ nodes: - id: benchmark_script + build: | + pip install ../mllm path: ../mllm/benchmark_script.py inputs: text: llm/text diff --git a/benches/llms/qwen2.5.yaml b/benches/llms/qwen2.5.yaml index 99090f1d..73013ad7 100644 --- a/benches/llms/qwen2.5.yaml +++ b/benches/llms/qwen2.5.yaml @@ -1,5 +1,7 @@ nodes: - id: benchmark_script + build: | + pip install ../mllm path: ../mllm/benchmark_script.py inputs: text: llm/text diff --git a/benches/llms/transformers.yaml b/benches/llms/transformers.yaml index 86c56071..7e9a342d 100644 --- a/benches/llms/transformers.yaml +++ b/benches/llms/transformers.yaml @@ -1,5 +1,7 @@ nodes: - id: benchmark_script + build: | + pip install ../mllm path: ../mllm/benchmark_script.py inputs: text: llm/text diff --git a/benches/mllm/pyproject.toml b/benches/mllm/pyproject.toml new file mode 100644 index 00000000..d1bd28ae --- /dev/null +++ b/benches/mllm/pyproject.toml @@ -0,0 +1,22 @@ +[project] +name = "dora-bench" +version = "0.1.0" +description = "Script to benchmark performance of llms while using dora" +authors = [{ name = "Haixuan Xavier Tao", email = "tao.xavier@outlook.com" }] +license = { text = "MIT" } +readme = "README.md" +requires-python = ">=3.11" + +dependencies = [ + "dora-rs>=0.3.9", + "librosa>=0.10.0", + "opencv-python>=4.8", + "Pillow>=10", +] + +[project.scripts] +dora-benches = "benchmark_script.main:main" + +[build-system] +requires = ["setuptools>=61", "wheel"] +build-backend = "setuptools.build_meta"