Uninstallation

To remove the Rec SDK Torch software package, run the following commands:

# Uninstall hybrid_torchrec.
pip3 uninstall hybrid_torchrec -y
# Uninstall torchrec_embcache.
pip3 uninstall torchrec_embcache -y
# Uninstall torchrec.
pip3 uninstall torchrec -y

To remove the Rec SDK Torch custom operator package, run the following commands: Wherein

  • The default installation path of the custom operator in CANN is /usr/local/Ascend/cann/opp/vendors/.
  • To uninstall a custom operator, delete the folder corresponding to the custom operator name in the vendors directory. You can use ai_core_op to view the custom operator directory of the Rec SDK.
# Operator uninstallation command example
rm -rf /usr/local/Ascend/cann/opp/vendors/asynchronous_complete_cumsum
rm -rf /usr/local/Ascend/cann/opp/vendors/backward_codegen_adagrad_unweighted_exact
rm -rf /usr/local/Ascend/cann/opp/vendors/permute2d_sparse_data
rm -rf /usr/local/Ascend/cann/opp/vendors/split_embedding_codegen_forward_unweighted
# Uninstall libfbgemm_npu_api.so.
PACKAGE_PATH=$(python3 -c "import sysconfig; print(sysconfig.get_path('purelib'))")
if [ -d "$PACKAGE_PATH" ]; then
  cd ${PACKAGE_PATH}
  rm -rf libfbgemm_npu_api.so
else
  echo "no site-package"
fi

When some custom operators are installed in the vendors folder of CANN, the original custom operator names are different from the installation paths. You need to delete the installation paths during uninstallation. The following table lists the custom operators that are different.

Custom Operator Name

Name in the Vendors Folder

cust_op_by_addr

customize

pcie_through

customize

fused_lazy_adam

mxrec_fused_lazy_adam

fused_sgd

mxrec_sgd

If the installation folder name is not configured for a custom operator, the operator is installed in the vendors/customize folder of CANN by default. If a custom operator exists in the deleted customize folder, the operator needs to be reinstalled.