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

[BUG]: Incorrect code in compute_vertex_renumber_map() in src/sampling/sampling_post_processing_impl.cuh #4846

Closed
2 tasks done
mcordery opened this issue Jan 6, 2025 · 0 comments · Fixed by #4851
Closed
2 tasks done
Assignees
Labels
bug Something isn't working

Comments

@mcordery
Copy link

mcordery commented Jan 6, 2025

Version

25.02

Which installation method(s) does this occur on?

No response

Describe the bug.

In compute_vertex_renumber_map() in src/sampling/sampling_post_processing_impl.cuh there is the following code:

     thrust::stable_sort(
          handle.get_thrust_policy(),
          renumber_map.begin(),
          renumber_map.end(),
          [offsets = *vertex_type_offsets] __device__(auto lhs, auto rhs)  {
            auto lhs_v_type = thrust::distance(
              offsets.begin() + 1,
              thrust::upper_bound(
                thrust::seq, offsets.begin() + 1, offsets.end(), thrust::get<0>(lhs)));
            auto rhs_v_type = thrust::distance(
              offsets.begin() + 1,
              thrust::upper_bound(
                thrust::seq, offsets.begin() + 1, offsets.end(), thrust::get<0>(rhs)));
            return lhs_v_type < rhs_v_type; 
          });

From this, we can deduce that the lambda parameter list should be some kind of zip_iterator (as done earlier in the file) or some kind of tuple. However, renumber_map is device_uvector<vertex_t> where vertex_t is int32_t. Thus, when compiling, the thrust::get<> operators don't know what to do with either the lhs or rhs parameters.

Minimum reproducible example

Relevant log output

/home/xxx/Projects/cugraph/cpp/src/sampling/sampling_post_processing_impl.cuh:1400:66: error: no matching function for call to 'get'
 1400 |                 thrust::seq, offsets.begin() + 1, offsets.end(), thrust::get<0>(rhs)));
      |                                                                  ^~~~~~~~~~~~~~
/opt/rocm-6.3.0/lib/llvm/bin/../../../include/thrust/detail/pair.inl:218:7: note: candidate template ignored: could not match 'pair<T1, T2>' against 'int'
  218 |       get(pair<T1,T2> &p)
      |       ^
/opt/rocm-6.3.0/lib/llvm/bin/../../../include/thrust/detail/pair.inl:226:7: note: candidate template ignored: could not match 'pair<T1, T2>' against 'int'
  226 |       get(const pair<T1,T2> &p)
      |       ^
/opt/rocm-6.3.0/lib/llvm/bin/../../../include/thrust/tuple.h:262:1: note: candidate template ignored: could not match 'detail::cons<HT, TT>' against 'int'
  262 | get(detail::cons<HT, TT>& t);
      | ^
/opt/rocm-6.3.0/lib/llvm/bin/../../../include/thrust/tuple.h:293:1: note: candidate template ignored: could not match 'detail::cons<HT, TT>' against 'int'
  293 | get(const detail::cons<HT, TT>& t);
      | ^

Environment details

Other/Misc.

No response

Code of Conduct

  • I agree to follow cuGraph's Code of Conduct
  • I have searched the open bugs and have found no duplicates for this bug report
@mcordery mcordery added ? - Needs Triage Need team to review and classify bug Something isn't working labels Jan 6, 2025
@ChuckHastings ChuckHastings removed the ? - Needs Triage Need team to review and classify label Jan 6, 2025
@seunghwak seunghwak linked a pull request Jan 7, 2025 that will close this issue
rapids-bot bot pushed a commit that referenced this issue Jan 14, 2025
Close Issue #4846

Remove `thrust::get<0>()` calls on integer type variables. This shouldn't compile but this successfully compiles in the current build environment, so this hasn't been detected.

Authors:
  - Seunghwa Kang (https://github.com/seunghwak)

Approvers:
  - Chuck Hastings (https://github.com/ChuckHastings)

URL: #4851
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants