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

Add devicemap to spmm benchmark #294

Merged
merged 2 commits into from
Jul 26, 2024
Merged
Changes from all commits
Commits
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
7 changes: 5 additions & 2 deletions examples/spmm/spmm_cuda.cc
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,11 @@ class SpMM25D {
, a_rowidx_to_colidx_(a_rowidx_to_colidx)
, b_colidx_to_rowidx_(b_colidx_to_rowidx) {
this->set_priomap([this](const Key<3> &ijk) { return this->prio(ijk); }); // map a key to an integral priority value

auto num_devices = ttg::device::num_devices();
this->set_devicemap(
[num_devices](const Key<3> &ijk){
return ((((uint64_t)ijk[0]) << 32) + ijk[1]) % num_devices;
therault marked this conversation as resolved.
Show resolved Hide resolved
});
// for each {i,j} determine first k that contributes AND belongs to this node,
// initialize input {i,j,first_k} flow to 0
for (auto i = 0ul; i != a_rowidx_to_colidx_.size(); ++i) {
Expand Down Expand Up @@ -1344,7 +1348,6 @@ static void initBlSpHardCoded(const std::function<int(const Key<2> &)> &keymap,
a_colidx_to_rowidx[3].emplace_back(0); // A[0][3]

A.setFromTriplets(A_elements.begin(), A_elements.end());
std::cout << "A_elements.begin()" << A_elements.begin() << "A_elements.end()" << A_elements.end() << "\n";

if (buildRefs && 0 == rank) {
Aref.setFromTriplets(Aref_elements.begin(), Aref_elements.end());
Expand Down
Loading