-
Notifications
You must be signed in to change notification settings - Fork 236
Predictable raft::resources #3052
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
6be7b6c
21b7733
7a4d525
3afd7be
cf8c513
5054e97
b8eae05
6fa6c54
76f7a3e
5c8c795
f306a4b
160d1c0
d782fc7
3157fd3
764f3c9
f8865fd
7c80d20
473bdc7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -59,10 +59,7 @@ class cublas_resource_factory : public resource_factory { | |
| */ | ||
| inline cublasHandle_t get_cublas_handle(resources const& res) | ||
| { | ||
| if (!res.has_resource_factory(resource_type::CUBLAS_HANDLE)) { | ||
| cudaStream_t stream = get_cuda_stream(res); | ||
| res.add_resource_factory(std::make_shared<cublas_resource_factory>(stream)); | ||
| } | ||
| res.ensure_default_factory(std::make_shared<cublas_resource_factory>(get_cuda_stream(res))); | ||
| auto ret = *res.get_resource<cublasHandle_t>(resource_type::CUBLAS_HANDLE); | ||
| RAFT_CUBLAS_TRY(cublasSetStream(ret, get_cuda_stream(res))); | ||
|
Comment on lines
+62
to
64
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy lift HIGH: Shared cuBLAS handle is rebound across divergent stream copies. After a As per path instructions, "different instances of raft::resources are safe" and "ensure work enqueued on raft::resources’ internal streams is correctly ordered w.r.t. get_cuda_stream()". 🤖 Prompt for AI AgentsSource: Path instructions |
||
| return ret; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -65,10 +65,7 @@ class cusolver_dn_resource_factory : public resource_factory { | |
| */ | ||
| inline cusolverDnHandle_t get_cusolver_dn_handle(resources const& res) | ||
| { | ||
| if (!res.has_resource_factory(resource_type::CUSOLVER_DN_HANDLE)) { | ||
| cudaStream_t stream = get_cuda_stream(res); | ||
| res.add_resource_factory(std::make_shared<cusolver_dn_resource_factory>(stream)); | ||
| } | ||
| res.ensure_default_factory(std::make_shared<cusolver_dn_resource_factory>(get_cuda_stream(res))); | ||
| return *res.get_resource<cusolverDnHandle_t>(resource_type::CUSOLVER_DN_HANDLE); | ||
|
Comment on lines
+68
to
69
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🩺 Stability & Availability | 🟠 Major 🧩 Analysis chain🏁 Script executed: #!/bin/bash
rg -n -C3 'get_cusolver|get_cusparse|SetStream|get_cuda_stream\(res\)' cpp/include/raft/core/resourceRepository: rapidsai/raft Length of output: 9241 🏁 Script executed: #!/bin/bash
set -euo pipefail
# Inspect resource ownership/copy semantics and the sibling handle getters.
ast-grep outline cpp/include/raft/core/resource/resource.hpp --view expanded || true
ast-grep outline cpp/include/raft/core/resource/cublas_handle.hpp --view expanded || true
ast-grep outline cpp/include/raft/core/resource/cusparse_handle.hpp --view expanded || true
ast-grep outline cpp/include/raft/core/resource/cusolver_sp_handle.hpp --view expanded || true
ast-grep outline cpp/include/raft/core/resource/cusolver_dn_handle.hpp --view expanded || true
echo '--- resource/copy semantics search ---'
rg -n -C3 'shared_ptr|copy|copy-construct|clone|resource_cell|ensure_default_factory|get_resource<|set_cuda_stream|CUDA_STREAM_VIEW' cpp/include/raft/core/resource cpp/include/raft/core | sed -n '1,220p'Repository: rapidsai/raft Length of output: 18111 🏁 Script executed: #!/bin/bash
set -euo pipefail
ast-grep outline cpp/include/raft/core/resource/cuda_stream.hpp --view expanded || true
sed -n '1,220p' cpp/include/raft/core/resource/cuda_stream.hppRepository: rapidsai/raft Length of output: 2874 HIGH: Rebind stream-bound solver handles on access
🤖 Prompt for AI AgentsSource: Path instructions |
||
| }; | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.