File tree 1 file changed +22
-0
lines changed 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -5091,6 +5091,28 @@ void ggml_init_cublas() {
5091
5091
CUBLAS_CHECK (cublasSetMathMode (g_cublas_handles[id], CUBLAS_TF32_TENSOR_OP_MATH));
5092
5092
}
5093
5093
5094
+ #ifdef NDEBUG
5095
+ for (int id = 0 ; id < g_device_count; ++id) {
5096
+ CUDA_CHECK (cudaSetDevice (id));
5097
+
5098
+ for (int id_other = 0 ; id_other < g_device_count; ++id_other) {
5099
+ if (id == id_other) {
5100
+ continue ;
5101
+ }
5102
+ if (id != g_main_device && id_other != g_main_device) {
5103
+ continue ;
5104
+ }
5105
+
5106
+ int canAccessPeer;
5107
+ CUDA_CHECK (cudaDeviceCanAccessPeer (&canAccessPeer, id, id_other));
5108
+ if (canAccessPeer) {
5109
+ // FIXME for some reason enabling peer access makes prompt processing slightly slower
5110
+ CUDA_CHECK (cudaDeviceEnablePeerAccess (id_other, 0 ));
5111
+ }
5112
+ }
5113
+ }
5114
+ #endif // NDEBUG
5115
+
5094
5116
// configure logging to stdout
5095
5117
// CUBLAS_CHECK(cublasLoggerConfigure(1, 1, 0, nullptr));
5096
5118
You can’t perform that action at this time.
0 commit comments