已关闭
全量编译和仅仅编译部署ops算子模块 #164
cftang9999创建于 27 天前关闭于 24 天前
全量编译和仅仅编译部署ops算子模块 #164
已关闭
从已删除 :main合入到Ascend/faissmain
共 2 个文件变更+8-1
| @@ -52,6 +52,7 @@ | |||
| 52 | 使用 `faiss/npu/test/scripts/test_flat_accuracy.py` 脚本进行测试,该脚本分别调用了 CPU 和 NPU 的 flat 索引,并比较精度。 | 52 | 使用 `faiss/npu/test/scripts/test_flat_accuracy.py` 脚本进行测试,该脚本分别调用了 CPU 和 NPU 的 flat 索引,并比较精度。 |
| 53 | 53 | ||
| 54 | ```bash | 54 | ```bash |
| 55 | +source /usr/local/Ascend/ascend-toolkit/set_env.sh | ||
| 55 | export ASCEND_CUSTOM_OPP_PATH=${ASCEND_HOME_PATH}/opp/vendors/custom_math:${ASCEND_CUSTOM_OPP_PATH} | 56 | export ASCEND_CUSTOM_OPP_PATH=${ASCEND_HOME_PATH}/opp/vendors/custom_math:${ASCEND_CUSTOM_OPP_PATH} |
| 56 | cd faiss/npu/test/scripts && python3 test_flat_accuracy.py | 57 | cd faiss/npu/test/scripts && python3 test_flat_accuracy.py |
| 57 | ``` | 58 | ``` |
| @@ -93,7 +93,7 @@ Python 安装好后,pip 所需依赖名称、对应版本及获取建议请参 | |||
| 93 | cd faiss | 93 | cd faiss |
| 94 | export FAISS_ROOT=$(pwd) | 94 | export FAISS_ROOT=$(pwd) |
| 95 | 95 | ||
| 96 | - # 编译算子接口 | 96 | + # 选项A: 全量编译算子接口 |
| 97 | # 若只需编译部署 ops 算子模块,则在此目录下执行 ops_deploy.sh 并跳过其他步骤 | 97 | # 若只需编译部署 ops 算子模块,则在此目录下执行 ops_deploy.sh 并跳过其他步骤 |
| 98 | cd ${FAISS_ROOT}/faiss/npu/ops && bash ops_build.sh | 98 | cd ${FAISS_ROOT}/faiss/npu/ops && bash ops_build.sh |
| 99 | 99 | ||
| @@ -112,6 +112,12 @@ Python 安装好后,pip 所需依赖名称、对应版本及获取建议请参 | |||
| 112 | cd ${FAISS_ROOT}/build/faiss/python && python3 setup.py bdist_wheel | 112 | cd ${FAISS_ROOT}/build/faiss/python && python3 setup.py bdist_wheel |
| 113 | ``` | 113 | ``` |
| 114 | 114 | ||
| 115 | + # 选项B: 只编译部署ops算子模块 | ||
| 116 | + # ops_deploy.sh 脚本中包含了ops_build.sh编译命令, | ||
| 117 | + # 并通过cann-ops-math-custom_linux-aarch64.run将ops算子模块部署到 ${ASCEND_HOME_PATH}/opp 目录, | ||
| 118 | + cd ${FAISS_ROOT}/faiss/npu/ops && bash ops_deploy.sh | ||
| 119 | + # 执行完ops_deploy.sh可跳过其他步骤,直接执行 01_quick_start.md 中的步骤 3:用例测试 | ||
| 120 | + | ||
| 115 | 3. 安装部署 | 121 | 3. 安装部署 |
| 116 | 122 | ||
| 117 | ```bash | 123 | ```bash |