[FEA]: cuda.core sample for Grace Hopper memory (ATS, host/GPU NUMA, C2C)

Đang mở
#3,219 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
55/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
documentation

Hướng nghiên cứu

Read the existing samples/cuda_core/memoryResources and systemWideAtomics samples for directory, waiver, and kernel conventions; the requested entry point is samples/cuda_core/graceHopperMemory. Implement and document the topology, ATS, bandwidth, and managed-memory demonstrations, then measure the README example output on GH200. Done means the sample checks the ATS result, exits with waiver code 2 when host page tables are unavailable, and reports measured results.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

triage
Is this a duplicate?
  • I confirmed there appear to be no duplicate issues for this request and that I agree to the Code of Conduct
Area

cuda.core

Is your feature request related to a problem? Please describe.

cuda.core already exposes the Grace Hopper memory topology:

  • Device.properties has numa_config, numa_id, host_numa_id, pageable_memory_access and pageable_memory_access_uses_host_page_tables.
  • system.Device has is_c2c_enabled.
  • PinnedMemoryResourceOptions takes numa_id.
  • ManagedBuffer.prefetch takes Host(numa_id=...).

The tests only check the types these return, and no sample shows what they mean on a system where they matter:

  • memoryResources uses host-NUMA pinning.
  • The bindings sample systemWideAtomics uses pageable access.
  • Nothing shows ATS, meaning pageable memory served through the host page tables, or a C2C link.
Describe the solution you'd like

A new sample, samples/cuda_core/graceHopperMemory, following the sample conventions: its own directory, README.md, requirements.txt, and waiver exit code 2.

  1. Topology: print the properties above, plus system.Device.is_c2c_enabled.
  2. ATS:
    • A kernel reads and writes a plain NumPy array (system-allocated, pageable) in place, with no copy, and the result is checked.
    • If pageable_memory_access_uses_host_page_tables is False, the sample exits with the waiver code.
  3. Read bandwidth: time the same read kernel over three memory types: pinned memory bound to host_numa_id (PinnedMemoryResourceOptions(numa_id=...)), pageable (ATS), and device memory.
  4. Managed memory: time a kernel on a ManagedMemoryResource buffer after prefetch(Host(numa_id=host_numa_id)), and again after prefetch(device).
  5. README: example output measured on GH200, not theoretical numbers.
Describe alternatives you've considered

Extend memoryResources. It is already long, and the ATS and C2C parts only run on Grace-based systems, so a separate sample with its own waiver seems cleaner.

Additional context

A probe with the same steps already runs.

On an x86 B300 host:

  • pageable_memory_access is True, through HMM.
  • pageable_memory_access_uses_host_page_tables is False.
  • is_c2c_enabled is False.
  • So the sample would correctly exit 2 there.

On GH200 (cc 9.0, driver 595.58.03, CUDA 13.4.2):

  • numa_config = 1, numa_id = 1, host_numa_id = 0.
  • pageable_memory_access, pageable_memory_access_uses_host_page_tables, concurrent_managed_access and is_c2c_enabled are all True.
  • The kernel on the plain NumPy array returns the correct result.

One read-sum kernel over 1 GiB, median of 10 launches, three runs:

Memory GB/s
Pinned, host NUMA node 0 339–345
Pageable NumPy array (ATS) 224–225
Device 2386–2417
Managed, first kernel after prefetch(Host(numa_id=0)) 5.1–5.4 (about 200 ms)
Managed, after prefetch(device) 2380–2393

The managed host row is the one the sample would explain. Managed memory that sits on the host is migrated on the GPU's first touch, so that first kernel pays for moving 1 GiB. The same bytes as a pageable NumPy array are read in place over C2C at about 224 GB/s.

The kernel is a plain grid-stride read with one atomic per block, not a tuned copy, so the device number is below HBM peak. The sample would present these as relative numbers.

Before writing the sample: would you take it? Is samples/cuda_core/ the right place, and are CuPy-free kernels via Program preferred, as in the other samples?

Ngôn ngữ chính
Cython
Star
3.4k
Fork
353
Merge trung bình
2 ngày 3 giờ
Pull request đã merge (30 ngày)
163

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của NVIDIA/cuda-python

Tất cả issue của NVIDIA/cuda-python

Issue tương tự

Thêm issue về Documentation

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.