Repository navigation
Conversation
…nd SIMT Signed-off-by: Melih Elibol <[email protected]>
Signed-off-by: Melih Elibol <[email protected]>
d1ee216 to
f0f61e2
Compare
Signed-off-by: Melih Elibol <[email protected]>
…eBuffers Signed-off-by: nihalpasham <[email protected]>
|
Thanks @elibol, this looks good. I pushed a small commit (
|
Signed-off-by: Melih Elibol <[email protected]>
…/shared-cuda-core Signed-off-by: Melih Elibol <[email protected]> # Conflicts: # cutile-rs/cutile/src/tensor.rs
Signed-off-by: Melih Elibol <[email protected]>
|
@nihalpasham Thanks for the review and fixes. Your commit The follow-up work also fixes allocation uniqueness accounting by counting actual buffer views separately from GPU completion leases, and incorporates the corresponding tensor ownership fix from #1516. The regression fails on the earlier implementation and passes with the fix. All of your feedback is incorporated. All 63 active CI checks pass at |
Signed-off-by: Melih Elibol <[email protected]>
Tile and SIMT currently expose separate
cuda-corecontexts, streams, launch configurations, and allocation owners. A buffer moving between the models consequently needs raw-pointer adaptation, and the separate runtimes cannot coordinate lifetime or conflicting accesses.This removes
cuda_core::simtand gives both models the same host handles and allocation owner.Deviceidentifies a physical GPU;Contextowns or borrows the actual CUDA context. Typed buffers, contiguous sliced views, foreign owners, and Tile tensors share allocation identity and access tracking.Tensor::from_buffer,into_buffer, andas_buffertransfer or borrow storage without copying device memory. Ownership transfer rejects live typed aliases, preserving the boolean representation guarantees in #1516.Safe submissions retain allocations and access leases until GPU completion, including after a borrowed launch future is dropped or forgotten. Shared references to device atomics are conservatively tracked as writable. Buffer and stream destructors retire work without waiting on the dropping thread; unknown completion retains resources instead of freeing active memory. The existing SIMT async launcher receives the small retention bridge needed to make this core migration safe before its separate consolidation.
Allocation uniqueness counts user-visible byte views independently of completion leases. This removes the retirement window where a decremented lease count still had a live Arc and made a unique buffer appear aliased. The same separation at the Tensor layer comes from #1516; both checks remain required for zero-copy ownership transfer.
Nihal's fixes preserve ordinary shared-read permissions on empty and peeled buffers and wait for retirement before checking reclaimed VRAM.
Consumer code, generated launchers, examples, templates, documentation, tests, and CI paths use the shared API. Tile numeric storage wrappers also implement
DeviceCopy;DTypeandDeviceCopyremain independent traits.Stack: depends on #1516. The base is its existing
pull-request/1516mirror so this PR shows only the core migration. Retarget tomainafter #1516 merges. The stacked follow-up #1604 removescuda_async::simt.Validation:
cuda-coresuite: 111 passed; fullcuda-asyncsuite: 151 passed.--ignored.GPU validation used a single RTX 5090. Multi-GPU/NVLink cases self-skip on this machine; this does not claim multi-GPU coverage. Existing deliberately ignored tests remain ignored.
Closes #1460. Implements the physical-device/context distinction discussed in #1504.
Current follow-up validation: all 50 cuda-core unit tests and all nine targeted shared-allocation/retirement GPU tests pass, as does cuda-core Clippy with warnings denied. The new concurrency regression failed 3,308 uniqueness checks on the previous implementation and passes with the fix.
Current-main integration: Merged the updated #1516 prerequisite and migrated the new CuTe host consumers to shared LaunchConfig and the explicit event-flags API. Affected-package Clippy and all 16 CuTe example/model workspace Clippy checks pass. Fresh CI is running at
47042a8fae; the preceding head had all 63 active checks passing.