This is an automated email from the ASF dual-hosted git repository.
guanmingchiu pushed a commit to branch dev-qdp
in repository https://gitbox.apache.org/repos/asf/mahout.git
The following commit(s) were added to refs/heads/dev-qdp by this push:
new ef7e10dfa [QDP] Update notebooks dir and link (#762)
ef7e10dfa is described below
commit ef7e10dfa73a02cbf2e1e71feb749e199eda382d
Author: Ryan Huang <[email protected]>
AuthorDate: Mon Dec 29 12:25:48 2025 +0800
[QDP] Update notebooks dir and link (#762)
* update link and position
* update file position and cleanup script
* colab link update
---
qdp/{ => qdp-python}/benchmark/README.md | 2 +-
.../benchmark/notebooks/mahout_benchmark.ipynb | 68 +++++++++-------------
2 files changed, 29 insertions(+), 41 deletions(-)
diff --git a/qdp/benchmark/README.md b/qdp/qdp-python/benchmark/README.md
similarity index 75%
rename from qdp/benchmark/README.md
rename to qdp/qdp-python/benchmark/README.md
index e338d2545..f8f413d41 100644
--- a/qdp/benchmark/README.md
+++ b/qdp/qdp-python/benchmark/README.md
@@ -3,4 +3,4 @@
### We can also run benchmarks on colab notebooks(without owning a GPU)
-[](https://colab.research.google.com/github/apache/mahout/blob/colab-benchmark/qdp/benchmark/notebooks/mahout_benchmark.ipynb)
+[](https://colab.research.google.com/github/apache/mahout/blob/dev-qdp/qdp/qdp-python/benchmark/notebooks/mahout_benchmark.ipynb)
diff --git a/qdp/benchmark/notebooks/mahout_benchmark.ipynb
b/qdp/qdp-python/benchmark/notebooks/mahout_benchmark.ipynb
similarity index 70%
rename from qdp/benchmark/notebooks/mahout_benchmark.ipynb
rename to qdp/qdp-python/benchmark/notebooks/mahout_benchmark.ipynb
index 81fd746fd..8b0786ace 100644
--- a/qdp/benchmark/notebooks/mahout_benchmark.ipynb
+++ b/qdp/qdp-python/benchmark/notebooks/mahout_benchmark.ipynb
@@ -18,7 +18,7 @@
},
"collapsed": true,
"id": "-hkLubLFXs_8",
- "outputId": "95dda2d2-2cff-4b99-8a19-ce47e6f67fa6"
+ "outputId": "35d2da5a-3b86-4340-fe96-8329b0f63fbb"
},
"outputs": [],
"source": [
@@ -27,7 +27,7 @@
"!sudo apt-get install python3.11-venv binfmt-support > /dev/null\n",
"!sudo apt-get install python3-pip > /dev/null\n",
"!python3 -m pip install --upgrade pip > /dev/null\n",
- "!python3 -m pip install ipykernel\n"
+ "!python3 -m pip install ipykernel"
]
},
{
@@ -39,7 +39,7 @@
},
"collapsed": true,
"id": "_HEpQ4F3C4gV",
- "outputId": "2f9969f4-313b-4652-ddf8-e538598532db"
+ "outputId": "5dc64f8a-88b5-40da-b72b-145ee2034262"
},
"outputs": [],
"source": [
@@ -50,10 +50,7 @@
"\n",
"# 2. Verify Installation\n",
"!rustc --version\n",
- "!cargo --version\n",
- "\n",
- "# 3. Install Maturin (Build Backend for qdp-python)\n",
- "!pip install maturin"
+ "!cargo --version"
]
},
{
@@ -65,7 +62,7 @@
},
"collapsed": true,
"id": "ljkluVL5ES4S",
- "outputId": "73b1d5c1-6580-4633-e774-f58a138e94b8"
+ "outputId": "aced063f-5dae-471d-a1b6-3cac437fe074"
},
"outputs": [],
"source": [
@@ -80,11 +77,11 @@
"base_uri": "https://localhost:8080/"
},
"id": "9cgMNKOoEgYm",
- "outputId": "24cec148-17c9-4dea-c47f-18d05e6b1911"
+ "outputId": "1cfd677c-2858-4e75-a949-5752d61fc6bb"
},
"outputs": [],
"source": [
- "!nvcc --version\n"
+ "!nvcc --version"
]
},
{
@@ -105,7 +102,7 @@
},
"collapsed": true,
"id": "u7Skxs7lDBlq",
- "outputId": "ff876484-54a0-4f92-ca9b-ff7003997ee6"
+ "outputId": "8ef09700-8551-4d19-cb9e-1ba05f2641c5"
},
"outputs": [],
"source": [
@@ -116,51 +113,38 @@
"# We use the requirements file provided in the benchmark folder\n",
"%cd /content/mahout/qdp/qdp-python\n",
"!uv venv -p python3.11\n",
- "# Activate the virtual environment and run uv sync and maturin
develop\n",
- "!source .venv/bin/activate && uv sync --group dev\n",
- "# !source .venv/bin/activate && uv run --python 3.11 maturin develop"
+ "\n",
+ "!uv sync --group dev\n",
+ "!uv sync --group benchmark"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
- "id": "XX7w2efnD9np"
+ "colab": {
+ "base_uri": "https://localhost:8080/"
+ },
+ "id": "fVUL1wnBp6X1",
+ "outputId": "a7f7b66c-e2f2-4e6c-b633-ffea4e7ca840"
},
"outputs": [],
"source": [
- "%cd /content/mahout/qdp/qdp-python\n",
- "\n",
- "# 1. Remove all old wheels to prevent future conflicts\n",
"!rm -rf /content/mahout/qdp/target/wheels/*\n",
- "\n",
- "# 2. Re-run build (so we have exactly one fresh wheel)\n",
"!uv run maturin build --interpreter .venv/bin/python\n",
- "\n",
- "# 3. Install the single new wheel found\n",
- "!uv pip install /content/mahout/qdp/target/wheels/*.whl --python
.venv/bin/python --force-reinstall\n",
- "\n",
- "!./.venv/bin/python -c \"import mahout_qdp;
print(mahout_qdp.__file__)\""
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {
- "collapsed": true,
- "id": "eYLNNzRQFNQ_"
- },
- "outputs": [],
- "source": [
- "!uv pip install -r /content/mahout/qdp/benchmark/requirements.txt
--python .venv/bin/python"
+ "!uv pip install /content/mahout/qdp/target/wheels/*.whl --python
.venv/bin/python --force-reinstall"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
+ "colab": {
+ "base_uri": "https://localhost:8080/"
+ },
"collapsed": true,
- "id": "qqmfUHGsGm8m"
+ "id": "qqmfUHGsGm8m",
+ "outputId": "2e49ecce-1b3d-4954-bc4e-b823106b3839"
},
"outputs": [],
"source": [
@@ -180,11 +164,15 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
- "id": "iuP5BdI3E-oR"
+ "colab": {
+ "base_uri": "https://localhost:8080/"
+ },
+ "id": "iuP5BdI3E-oR",
+ "outputId": "e60bfe3c-145d-4962-fbbc-25f39f1ca69f"
},
"outputs": [],
"source": [
- "!./.venv/bin/python /content/mahout/qdp/benchmark/benchmark_e2e.py
--frameworks mahout-parquet mahout-arrow pennylane --qubits 18 --samples 500"
+ "!./.venv/bin/python
/content/mahout/qdp/qdp-python/benchmark/benchmark_e2e.py --frameworks all
--qubits 18 --samples 500"
]
}
],