1.8K Star 3.1K Fork 4.3K

GVPMindSpore/mindquantum

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

Benchmark

system info

System Info
Python 3.9.5
OS Linux x86_64
Memory 16.62 GB
CPU Max Thread 16

Install package

Create isolated conda environment.

conda create -n benchmark python=3.9.5
conda activate benchmark

Install Requirements

pip3 install -r requirements.txt
pip3 install protobuf==3.20.1

Install Qulacs

CUR_DIR=`pwd`
wget https://files.pythonhosted.org/packages/23/a2/6fca76d22de5f85ed3707cfeb47b09cc5b4a5edaf7af930b32f17257fa95/Qulacs-GPU-0.3.1.tar.gz
tar -xvf Qulacs-GPU-0.3.1.tar.gz
cd Qulacs-GPU-0.3.1
sed -i '17c\set(DEFAULT_USE_TEST No)' CMakeLists.txt
python3 setup.py install
cd $CUR_DIR

Install Intel

Clone and build intel master

CUR_DIR=`pwd`
pip3 install pybind11
git clone https://github.com/intel/intel-qs.git
cd intel-qs
mkdir -p build
cd build
cmake -DIqsPython=ON ..
make -j8
cp ./lib/intelqs_py*.so `python -c "import site;print(site.getsitepackages()[0])"`
cd $CUR_DIR

Force use CPU

export CUDA_VISIBLE_DEVICES=""

Total Thread 16

export OMP_NUM_THREADS=16

Generate dataset

CUR_DIR=`pwd`
cd utils
python3 generate_random_circuit.py
python3 generate_graph.py
cd $CUR_DIR

Run benchmark

cd src
pytest -v --benchmark-save=all --benchmark-warmup=on --benchmark-warmup-iterations=1

Or only benchmark one frame with one task, for example

pytest -v --benchmark-save=mindquantum --benchmark-warmup=on --benchmark-warmup-iterations=1 -m 'random_circuit and mindquantum'

Or run with a script

. ./run.sh

Take a look at the previous result.

pytest-benchmark compare 0009
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/mindspore/mindquantum.git
git@gitee.com:mindspore/mindquantum.git
mindspore
mindquantum
mindquantum
research

搜索帮助