Skip to content

Fix missing nvtx stack and host mem resource by exporting the symbols#3083

Open
huuanhhuyn wants to merge 2 commits into
NVIDIA:mainfrom
huuanhhuyn:export_symbols
Open

Fix missing nvtx stack and host mem resource by exporting the symbols#3083
huuanhhuyn wants to merge 2 commits into
NVIDIA:mainfrom
huuanhhuyn:export_symbols

Conversation

@huuanhhuyn

@huuanhhuyn huuanhhuyn commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

This NVIDIA/cuvs#2052 changes default symbol visibility to cuvs from public to hidden. The memory_tracking_resources tool introduced in raft earlier now has the host memory resource and nvtx stack range switched to hidden (i.e. private within libcuvs.so). This leads to empty nvtx stack name and missing host memory allocations in the .csv produced by memory_tracking_resources.

The current PR explicitly exports those symbols again and fix the issue.

Analysis

Before the changes, the symbols in the example and in the libcuvs.so are two different entities with different addresses.

default_host_resource_holder_ address (CAGRA_HNSW_ACE_BUILD_EXAMPLE): 0x63a2ff1cfa20
range_name_stack_instance address (CAGRA_HNSW_ACE_BUILD_EXAMPLE): 0x7fabe9d2f030

default_host_resource_holder_ address (libcuvs.so): 0x7fabed9fb7e0
range_name_stack_instance address (libcuvs.so): 0x7fabe9d2d010

$ nm -C /opt/conda/envs/cuvs/lib/libcuvs.so 
00000000036827e0 b raft::mr::detail::default_host_resource_holder_
0000000000001010 b raft::common::nvtx::detail::range_name_stack_instance

After exporting,

default_host_resource_holder_ addr (exe):        0x64a7d9f4ca20
range_name_stack_instance addr (exe, this thread): 0x740c67dfb030

default_host_resource_holder_ addr (libcuvs):        0x64a7d9f4ca20
range_name_stack_instance addr (libcuvs, this thread): 0x740c67dfb030

$ nm -C /opt/conda/envs/cuvs/lib/libcuvs.so 
000000000367f7e0 u raft::mr::detail::default_host_resource_holder_
0000000000001010 u raft::common::nvtx::detail::range_name_stack_instance

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The changes add RAFT_EXPORT annotations to NVTX range helpers and default host memory resource declarations. SPDX copyright text is also updated; runtime behavior and control flow remain unchanged.

Changes

Export visibility updates

Layer / File(s) Summary
NVTX range exports
cpp/include/raft/core/detail/nvtx_range_stack.hpp
The thread-local NVTX range instance and current-range accessor are marked with RAFT_EXPORT, and the SPDX copyright text is updated.
Host resource exports
cpp/include/raft/mr/host_memory_resource.hpp
The default host resource holder, getter, and setter are marked with RAFT_EXPORT, and the SPDX copyright text is updated without behavior changes.

Estimated code review effort: 1 (Trivial) | ~3 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarizes the main change: exporting NVTX stack and host memory resource symbols.
Description check ✅ Passed The description is directly about the same symbol-export fix and explains the issue and outcome.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@huuanhhuyn huuanhhuyn changed the title [WIP] Export nvtx stack and host mem resource symbols Fix missing nvtx stack and host mem resource by explicitly export the symbols Jul 16, 2026
@huuanhhuyn huuanhhuyn changed the title Fix missing nvtx stack and host mem resource by explicitly export the symbols Fix missing nvtx stack and host mem resource by exporting the symbols Jul 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant