Skip to content
Open
Changes from 1 commit
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
abdec47
wip
rparolin Mar 17, 2026
c418050
wip
rparolin Mar 17, 2026
b879fa5
fixing ci compiler errors
rparolin Mar 17, 2026
04ee3de
skipping tests that aren't supported
rparolin Mar 17, 2026
9ab3f46
cu12 support
rparolin Mar 17, 2026
bd75bc3
Merge branch 'main' into rparolin/managed_mem_advise_prefetch
rparolin Mar 17, 2026
1b1343b
Merge branch 'main' into rparolin/managed_mem_advise_prefetch
rparolin Mar 17, 2026
a948066
Moving to function from Buffer class methods to free standing functio…
rparolin Mar 17, 2026
1457599
precommit format
rparolin Mar 17, 2026
acb4024
iterating on implementation
rparolin Mar 18, 2026
d10ab07
Simplify managed-memory helpers: remove long-form aliases, cache look…
rparolin Mar 18, 2026
ae1de36
Merge branch 'main' into rparolin/managed_mem_advise_prefetch
rparolin Mar 18, 2026
c250c92
fix(test): reset _V2_BINDINGS cache so legacy-signature tests take th…
rparolin Mar 18, 2026
89329d9
fix(test): require concurrent_managed_access for advise tests that hi…
rparolin Mar 18, 2026
8a75d1b
fix: validate managed buffer before checking discard_prefetch binding…
rparolin Mar 18, 2026
9e9b1e0
refactor: extract managed memory ops into dedicated _managed_memory_o…
rparolin Mar 18, 2026
90f0711
pre-commit fix
rparolin Mar 18, 2026
b4d252c
Removing blank file
rparolin Mar 19, 2026
faaa1d8
wip
rparolin Mar 19, 2026
18786be
Merge branch 'main' into rparolin/managed_mem_advise_prefetch
rparolin Apr 6, 2026
9766ddc
Merge remote-tracking branch 'upstream/main' into rparolin/managed_me…
rparolin Apr 27, 2026
cf2f20d
fix(cuda.core): update binding_version import after upstream merge
rparolin Apr 27, 2026
db3bac2
revert: drop managed_memory shim in cuda.core.experimental
rparolin Apr 27, 2026
20d036e
feat(cuda.core): add Location dataclass for managed memory
rparolin Apr 27, 2026
c2dae53
feat(cuda.core): add _coerce_location helper
rparolin Apr 28, 2026
935c8ba
test(cuda.core): update monkeypatch target after binding_version rename
rparolin Apr 28, 2026
dc46535
refactor(cuda.core): tighten memory-attr query
rparolin Apr 28, 2026
818f5d2
feat(cuda.core): unified 1..N managed_memory.prefetch with cydriver
rparolin Apr 28, 2026
e296e72
feat(cuda.core): add managed_memory.discard
rparolin Apr 28, 2026
e697131
feat(cuda.core): unified 1..N managed_memory.discard_prefetch with cy…
rparolin Apr 28, 2026
3bc1021
feat(cuda.core): unified 1..N managed_memory.advise + drop legacy app…
rparolin Apr 28, 2026
fa23869
refactor(cuda.core): use Buffer.is_managed property in managed_memory…
rparolin Apr 28, 2026
68bdd14
docs(cuda.core): document Location, discard, and 1..N managed_memory ops
rparolin Apr 28, 2026
b4d9cbf
chore(cuda.core): drop narrative comments and tighten _coerce_locatio…
rparolin Apr 28, 2026
ee96758
chore(cuda.core): satisfy pre-commit hooks
rparolin Apr 28, 2026
d6f60f2
refactor(cuda.core): move managed_memory ops to cuda.core.utils
rparolin Apr 28, 2026
3176271
chore(cuda.core): use __all__ in utils instead of per-import noqa
rparolin Apr 28, 2026
782f6a9
chore(cuda.core): collapse nested if in Location.__post_init__ (SIM102)
rparolin Apr 28, 2026
0789bf6
test(cuda.core): share one DummyUnifiedMemoryResource per batched test
rparolin Apr 28, 2026
e0c782a
test(cuda.core): query all buffers before closing in test_batched_sam…
rparolin Apr 28, 2026
10de998
review(cuda.core): address PR #1775 feedback
rparolin Apr 30, 2026
ab9a3ab
test(cuda.core): split managed-memory ops tests into tests/memory/
rparolin Apr 30, 2026
a3f342f
test(cuda.core): fix options regex for AdviseOptions ("an" vs "a")
rparolin Apr 30, 2026
c2a9662
chore(cuda.core): drop unused utils import + trailing blank lines
rparolin Apr 30, 2026
bede674
feat(cuda.core): add ManagedBuffer subclass + Host location
rparolin Apr 30, 2026
f59af4e
chore(cuda.core): simplify ManagedBuffer per /simplify review
rparolin Apr 30, 2026
5147a7d
ci: re-trigger CI (transient cuInit INVALID_DEVICE on l4 runner)
rparolin Apr 30, 2026
2151e61
refactor(cuda.core): use libcpp.vector for batched-op C arrays (R14)
rparolin May 1, 2026
5c6d054
fix(cuda.core): restore CUDA_ERROR_NOT_INITIALIZED auto-init in _quer…
rparolin May 1, 2026
47d5609
refactor(cuda.core): make Host a plain class instead of a dataclass (R1)
rparolin May 1, 2026
a40bb81
feat(cuda.core)!: drop int location shorthand from managed-memory ops…
rparolin May 1, 2026
c43e81e
docs(cuda.core): add AccessedBySet to api_private.rst (R5)
rparolin May 1, 2026
71e9daa
docs(cuda.core): note the legacy NUMA round-trip limitation on prefer…
rparolin May 1, 2026
df928a0
refactor(cuda.core): use collections.abc.Sequence for input checks (R…
rparolin May 1, 2026
f522916
refactor(cuda.core): narrow Buffer.from_handle to Buffer-only (R3)
rparolin May 1, 2026
6204c57
refactor(cuda.core): single API surface per operation (R9, R10, R11)
rparolin May 1, 2026
36012fd
refactor(cuda.core): build advise reverse-lookup eagerly at module lo…
rparolin May 1, 2026
067fb15
refactor(cuda.core): factor shared body of _do_batch_{prefetch,discar…
rparolin May 1, 2026
a9cd713
test(cuda.core): reuse production _get_int_attr in managed-memory tes…
rparolin May 1, 2026
d75a7bd
feat(cuda.core): cu12 fallback for prefetch_batch (N3)
rparolin May 1, 2026
0af5bd4
test(cuda.core): cover AccessedBySet read methods (N7)
rparolin May 1, 2026
b0d1a21
feat(cuda.core): cu13 NUMA round-trip for ManagedBuffer.preferred_loc…
rparolin May 1, 2026
4c228eb
docs(cuda.core): replace stale utils autosummary entries
rparolin May 1, 2026
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test(cuda.core): cover AccessedBySet read methods (N7)
Per Leo's review on PR #1775 (test_managed_ops.py:1), add a test for
the read side of AccessedBySet: __iter__, __len__, __eq__, __repr__.
These are part of the public set-like API (alongside __contains__,
add(), discard(), and the setter, which are already covered) but
were untested.

The cu12 batch fallback path (Leo's other coverage point) is now
exercised by TestPrefetchBatch.test_same_location and
test_per_buffer_location running on cu12 CI — the
cuMemPrefetchBatchAsync skip was dropped in d75a7bd when the
fallback landed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
  • Loading branch information
rparolin and claude committed May 1, 2026
commit 0af5bd4e6ae5a1d768135d2c5364d2de84b23425
27 changes: 27 additions & 0 deletions cuda_core/tests/memory/test_managed_ops.py
Comment thread
rparolin marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,33 @@ def test_accessed_by_add_discard(self, init_cuda):
finally:
plain.close()

def test_accessed_by_read_methods(self, init_cuda):
"""Cover __iter__, __len__, __eq__, __repr__ on AccessedBySet."""
device = Device()
_skip_if_managed_location_ops_unsupported(device)
device.set_current()
plain = DummyUnifiedMemoryResource(device).allocate(_MANAGED_TEST_ALLOCATION_SIZE)
try:
buf = ManagedBuffer.from_handle(plain.handle, plain.size, owner=plain)

# Empty initially
assert len(buf.accessed_by) == 0
assert list(buf.accessed_by) == []
assert buf.accessed_by == set()
assert "AccessedBySet" in repr(buf.accessed_by)

# After add
buf.accessed_by.add(device)
assert len(buf.accessed_by) == 1
assert list(buf.accessed_by) == [device]
assert buf.accessed_by == {device}
assert buf.accessed_by != frozenset()

# __eq__ vs another AccessedBySet on the same buffer
assert buf.accessed_by == buf.accessed_by
finally:
plain.close()

def test_accessed_by_set_assignment(self, init_cuda):
device = Device()
_skip_if_managed_location_ops_unsupported(device)
Expand Down
Loading