Skip to content
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

[FEA] Support for half-float mixed precise in brute-force #2382

Merged
merged 20 commits into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

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
fix: illegal instruction by masked_matmul on V100 with a dim not mu…
…ltiple of 32
  • Loading branch information
rhdong committed Aug 9, 2024
commit 10e5204cc31a06a77faa3623e9469fc9a8c086c0
1 change: 1 addition & 0 deletions cpp/include/raft/sparse/distance/detail/utils.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ RAFT_KERNEL faster_dot_on_csr_kernel(dot_t* __restrict__ dot,
l_dot_ += s_A[k] * __ldcg(B_col + k);
}
}
__syncthreads();
l_dot_ += __shfl_down_sync(0xffffffff, l_dot_, 16);
l_dot_ += __shfl_down_sync(0xffff, l_dot_, 8);
l_dot_ += __shfl_down_sync(0xff, l_dot_, 4);
Expand Down
18 changes: 12 additions & 6 deletions cpp/test/sparse/masked_matmul.cu
Original file line number Diff line number Diff line change
Expand Up @@ -363,33 +363,39 @@ using MaskedMatmulTestH = MaskedMatmulTest<half, float, int>;
TEST_P(MaskedMatmulTestH, Result) { Run(); }

const std::vector<MaskedMatmulInputs<float, float, int>> sddmm_inputs_f = {
{0.0001f, 1, 255, 131, 0.01, 1234ULL},
{0.0001f, 9, 255, 13100, 0.009, 1234ULL},
{0.0001f, 10, 5, 32, 0.1, 1234ULL},
{0.0001f, 1024, 32, 1024, 0.1, 1234ULL},
{0.0003f, 32, 1024, 1024, 0.2, 1234ULL},
{0.001f, 1024, 1024, 1024, 0.19, 1234ULL},
{0.001f, 1023, 1023, 1023, 0.19, 1234ULL},
{0.0001f, 1024, 1024, 32, 0.3, 1234ULL},
{0.0001f, 1024, 32, 1024, 0.4, 1234ULL},
{0.0003f, 32, 1024, 1024, 0.19, 1234ULL},
{0.0003f, 31, 1025, 1025, 0.19, 1234ULL},
{0.001f, 1024, 1024, 1024, 0.1, 1234ULL}};

const std::vector<MaskedMatmulInputs<double, double, int>> sddmm_inputs_d = {
{0.0001f, 1, 255, 131, 0.01, 1234ULL},
{0.0001f, 9, 255, 13100, 0.009, 1234ULL},
{0.0001f, 10, 5, 32, 0.01, 1234ULL},
{0.0001f, 1024, 32, 1024, 0.1, 1234ULL},
{0.0001f, 32, 1024, 1024, 0.2, 1234ULL},
{0.0001f, 1024, 1024, 1024, 0.19, 1234ULL},
{0.0001f, 1023, 1023, 1023, 0.19, 1234ULL},
{0.0001f, 1024, 1024, 32, 0.3, 1234ULL},
{0.0001f, 1024, 32, 1024, 0.4, 1234ULL},
{0.0001f, 32, 1024, 1024, 0.19, 1234ULL},
{0.0001f, 31, 1025, 1025, 0.19, 1234ULL},
{0.0001f, 1024, 1024, 1024, 0.1, 1234ULL}};

const std::vector<MaskedMatmulInputs<half, float, int>> sddmm_inputs_h = {
{0.0001f, 1, 255, 131, 0.01, 1234ULL},
{0.0001f, 9, 255, 13101, 0.009, 1234ULL},
{0.0001f, 10, 5, 32, 0.1, 1234ULL},
{0.0001f, 1024, 32, 1024, 0.1, 1234ULL},
{0.0003f, 32, 1024, 1024, 0.2, 1234ULL},
{0.001f, 1024, 1024, 1024, 0.19, 1234ULL},
{0.001f, 1023, 1023, 1023, 0.19, 1234ULL},
{0.0001f, 1024, 1024, 32, 0.3, 1234ULL},
{0.0001f, 1024, 32, 1024, 0.4, 1234ULL},
{0.0003f, 32, 1024, 1024, 0.19, 1234ULL},
{0.0003f, 31, 1025, 1025, 0.19, 1234ULL},
{0.001f, 1024, 1024, 1024, 0.1, 1234ULL}};

INSTANTIATE_TEST_CASE_P(MaskedMatmulTest, MaskedMatmulTestF, ::testing::ValuesIn(sddmm_inputs_f));
Expand Down
Loading