Skip to content

Commit 39d46c7

Browse files
[bugfix] hamming compile (#624)
<!-- Thanks for sending a pull request! BEFORE SUBMITTING, PLEASE READ OUR OFFICIAL WEBSITE. --> # Purpose What this PR does / why we need it? The build fails. <img width="1126" height="342" alt="image" src="https://github.com/user-attachments/assets/6b470717-7e19-4f73-bea6-766dfb1d58cf" /> <!-- - Please clarify what changes you are proposing. The purpose of this section is to outline the changes and how this PR fixes the issue. If possible, please consider writing useful notes for better and faster reviews in your PR. - Please clarify why the changes are needed. For instance, the use case and bug description. - Fixes # --> # Modifications Does this PR introduce _any_ user-facing change? The CMakeLists.txt must explicitly integrate CUDA <!-- Note that it means *any* user-facing change including all aspects such as API, interface or other behavior changes. Documentation-only updates are not considered user-facing changes. --> # Test How was this patch tested? <!-- CI passed with new added/existing test. If it was tested in a way different from regular unit tests, please clarify how you tested step by step, ideally copy and paste-able, so that other reviewers can test and check, and descendants can verify in the future. If tests were not added, please describe why they were not added and/or why it was difficult to add. -->
1 parent dbef25f commit 39d46c7

3 files changed

Lines changed: 8 additions & 2 deletions

File tree

docker/Dockerfile-NPU

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ COPY . /workspace/unified-cache-management
1010

1111
RUN pip config set global.index-url ${PIP_INDEX_URL}
1212

13-
RUN export PLATFORM="ascend" && \
13+
RUN export PLATFORM="ascend" ENABLE_SPARSE=true && \
1414
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/Ascend/ascend-toolkit/latest/`uname -i`-linux/devlib && \
1515
pip install -v -e /workspace/unified-cache-management --no-build-isolation
1616

ucm/sparse/kvcomp/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ else()
4848
endif()
4949

5050
string(TOLOWER "$ENV{PLATFORM}" PLATFORM_ENV)
51-
if(PLATFORM_ENV STREQUAL "cuda")
51+
if(RUNTIME_ENVIRONMENT STREQUAL "cuda")
5252
message(STATUS "Building kvcomp for CUDA...")
5353
add_subdirectory(hash_retrieval)
5454
add_subdirectory(ham_dist)

ucm/sparse/kvcomp/ham_dist/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ set(CMAKE_CUDA_COMPILER ${CUDA_ROOT}/bin/nvcc)
66
set(CMAKE_CUDA_ARCHITECTURES 75 80 86 89 90)
77
enable_language(CUDA)
88

9+
# ---- CUDA Toolkit ----
10+
find_package(CUDAToolkit REQUIRED)
11+
message(STATUS "Found CUDAToolkit: ${CUDAToolkit_INCLUDE_DIRS}")
12+
913
# ---- Python ----
1014
find_package(Python COMPONENTS Interpreter Development.Module REQUIRED)
1115

@@ -52,6 +56,7 @@ set(INCLUDE_DIRS
5256
${PYTORCH_PATH}/include
5357
${PYTORCH_PATH}/include/torch/csrc/api/include
5458
${CMAKE_CURRENT_SOURCE_DIR}
59+
${CUDAToolkit_INCLUDE_DIRS}
5560
)
5661

5762
set(LIBRARY_DIRS
@@ -66,6 +71,7 @@ set(LIBRARIES
6671
torch_cpu
6772
torch_python
6873
pthread
74+
CUDA::cudart
6975
)
7076

7177
# ---- Build: hamming python module (.so) ----

0 commit comments

Comments
 (0)