Repository navigation
feat(cuda-device): add PTX cache-control streaming and eviction qualifiers for global memory - #1515
Closed
amansahani wants to merge 1 commit into
Closed
amansahani wants to merge 1 commit into
amansahani wants to merge 1 commit into
Conversation
…s for global memory - Implement CacheLoad and CacheStore traits in cuda-device::cache - Provide load_streaming, load_l2_only, load_cached, load_last_use, load_volatile - Provide store_streaming, store_l2_only, store_write_back, store_write_through - Support all primitive scalar types (u8-u64, i8-i64, usize, isize, f16, f32, f64) - Support CuSimd and over-aligned vector types (Float2, Float4, Double2, Uint2, Uint4, Int2, Int4, F32x2, F32x4, etc.) - Add unit test suite in crates/cuda-device/tests/cache_qualifiers.rs - Add full end-to-end hardware verification suite in examples/cache_qualifiers - Ported and verified against the migrated NVIDIA/cuda-rust monorepo Signed-off-by: Aman Sahani <amansahani.200@gmail.com>
Collaborator
|
Thanks for the PR. The feature is wanted, but we shouldn't build it this way. I am closing this one. The notes below are what a new PR needs. It is a bigger job than this PR. But please feel free to decide on whether you want to take it on. What is off here:
What a new PR needs:
#1514 stays open as the tracking issue. Do you want to take this on? If not, that is fine too; say so there and it goes on my list. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #1514
Adds typed cache-control qualifiers for global memory loads and stores in
cuda-devicevia a new modulecuda_device::cache. This brings full parity with CUDA C++ Programming Guide Sections 10.11 & 10.12 (__ldcs,__ldcg,__ldca,__ldlu,__ldcv,__stcs,__stcg,__stwb,__stwt) and PTX ISA 9.7.10.1:load_streaming(.cs),load_l2_only(.cg),load_cached(.ca),load_last_use(.lu),load_volatile(.cv).store_streaming(.cs),store_l2_only(.cg),store_writeback(.wb),store_writethrough(.wt).Supports all primitive numeric types (
u8,i8,u16,i16,u32,i32,u64,i64,f32,f64) as well as multi-register vector types (Float2,Float4,Uint2,Uint4) lowering to PTX.v2and.v4instructions.Changes
cuda-oxide/crates/cuda-device/src/cache.rs: ImplementsCacheLoadandCacheStoretraits and inline PTX assembly wrappers.cuda-oxide/crates/cuda-device/src/lib.rs: Exposespub mod cache;.cuda-oxide/crates/cuda-device/README.md: Documents cache operators with examples.cuda-oxide/crates/cuda-device/tests/cache_qualifiers.rs: Host-side fallback unit tests.cuda-oxide/crates/rustc-codegen-cuda/examples/cache_qualifiers/: Hardware smoketest kernel exercising all qualifiers across all 14 supported types.Testing
just -f cuda-oxide/Justfile checkpasses (the local mirror of CI: fmt, clippy, tests, guards, docs)cargo oxide run <example>passes, orcuda-oxide/scripts/smoketest.sh -o '^<example>$'sm_86) withcargo oxide run cache_qualifiers:Checklist
git commit -s)