diff --git a/Makefile b/Makefile index 0bf7a3e8..efb3e0b2 100644 --- a/Makefile +++ b/Makefile @@ -21,7 +21,7 @@ build_cmake: clean bash scripts/build.sh build_wheel: - export CMAKE_GENERATOR="Unix Makefiles" && pip wheel -v . --extra-index-url https://download.pytorch.org/whl/cpu + export CMAKE_GENERATOR="Unix Makefiles" && pip wheel -v . # 'make compile_abs' compiles 'kernel_abs.cpp' into 'libkernel_abs.so' without building the whole wheel package. diff --git a/README.md b/README.md index fffb7f74..b602d59d 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,14 @@ export CMAKE_GENERATOR="Unix Makefiles" && pip install -v git+https://github.com ``` --- +## Install repository using pip + +The repository is "pip installable", i.e., + +```bash +export CMAKE_GENERATOR="Unix Makefiles" && pip install -v git+https://github.com/huawei-csl/pto-kernels.git +``` + ## Build ```bash diff --git a/pyproject.toml b/pyproject.toml index 3d84ec17..ab3b6c34 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -51,9 +51,12 @@ dependencies = [ [project.optional-dependencies] torch = [ - "torch-npu==2.8.0.post4", + "torch-npu", ] +[tool.pip] +extra-index-url = ["https://download.pytorch.org/whl/cpu"] + [tool.scikit-build] build-dir = "build/{wheel_tag}" wheel.packages = ["python/pto_kernels"]