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

Working around CUDA issue #6409

Merged
merged 1 commit into from
Jan 12, 2024
Merged

Working around CUDA issue #6409

merged 1 commit into from
Jan 12, 2024

Conversation

hkaiser
Copy link
Member

@hkaiser hkaiser commented Jan 9, 2024

Fixes #6407

@hkaiser
Copy link
Member Author

hkaiser commented Jan 9, 2024

@G-071 Please check whether this solves the issue you reported.

@G-071
Copy link
Member

G-071 commented Jan 9, 2024

Unfortunately, it seems NVCC has trouble with this one as well:

/home/daissgr/workshop/KokkosTiger/build/hpx/include/hpx/properties/property.hpp(26): error: expected a ">"
          detected during:
            instantiation of "hpx::experimental::tag_fallback_invoke" based on template arguments <hpx::parallel::execution::with_processing_units_count_t, hpx::execution::detail::parallel_policy_shim<hpx::execution::parallel_executor, hpx::execution::experimental::default_parameters> &, const unsigned long &> 
/home/daissgr/workshop/KokkosTiger/build/hpx/include/hpx/functional/invoke_result.hpp(38): here
            instantiation of class "hpx::util::invoke_result<F, Ts...> [with F=const hpx::functional::detail::tag_fallback_invoke_t_ns::tag_fallback_invoke_t, Ts=<hpx::experimental::prefer_t, const hpx::parallel::execution::with_processing_units_count_t &, hpx::execution::detail::parallel_policy_shim<hpx::execution::parallel_executor, hpx::execution::experimental::default_parameters> &, const std::size_t &>]" 
/home/daissgr/workshop/KokkosTiger/build/hpx/include/hpx/parallel/util/detail/chunk_size.hpp(173): here
            instantiation of "hpx::util::iterator_range<hpx::parallel::util::detail::chunk_size_iterator<IterOrR>, hpx::parallel::util::detail::chunk_size_iterator<IterOrR>> hpx::parallel::util::detail::get_bulk_iteration_shape(ExPolicy &, IterOrR &, std::size_t &, Stride) [with ExPolicy=hpx::execution::detail::parallel_policy_shim<hpx::execution::parallel_executor, hpx::execution::experimental::default_parameters>, IterOrR=int64_t, Stride=std::size_t]" 
/home/daissgr/workshop/KokkosTiger/build/hpx/include/hpx/parallel/algorithms/for_loop.hpp(1667): here
            instantiation of "hpx::parallel::util::detail::algorithm_result_t<ExPolicy, void> hpx::experimental::tag_fallback_invoke(hpx::experimental::for_loop_strided_t, ExPolicy &&, std::decay_t<I>, I, S, Args &&...) [with ExPolicy=hpx::execution::detail::parallel_policy_shim<hpx::execution::parallel_executor, hpx::execution::experimental::default_parameters>, I=int64_t, S=int64_t, Args=<lambda [](int64_t)->void>, _concept_requires_1648=42, _concept_check_1648=0]" 
/home/daissgr/workshop/KokkosTiger/build/hpx/include/hpx/functional/detail/tag_fallback_invoke.hpp(296): here
            instantiation of "auto hpx::functional::detail::tag_base_ns::tag_fallback<Tag, Enable>::operator()(Args &&...) const->hpx::functional::detail::tag_fallback_invoke_result_t<Tag, Args &&...> [with Tag=hpx::experimental::for_loop_strided_t, Enable=hpx::meta::constant<std::integral_constant<__nv_bool, true>>, Args=<hpx::execution::detail::parallel_policy_shim<hpx::execution::parallel_executor, hpx::execution::experimental::default_parameters>, int64_t, int64_t, const int64_t &, lambda [](int64_t)->void>, <unnamed>=void]" 
/home/daissgr/workshop/KokkosTiger/src/kokkos/core/src/Kokkos_HPX.hpp(1047): here
            [ 3 instantiation contexts not shown ]
            instantiation of "void Kokkos::Impl::ViewValueFunctor<DeviceType, ValueType, true>::parallel_for_implementation() [with DeviceType=Kokkos::Device<Kokkos::HostSpace::execution_space, Kokkos::HostSpace::memory_space>, ValueType=uint32_t]" 
/home/daissgr/workshop/KokkosTiger/src/kokkos/core/src/impl/Kokkos_ViewMapping.hpp(3082): here
            instantiation of "std::enable_if_t<<expression>, void> Kokkos::Impl::ViewValueFunctor<DeviceType, ValueType, true>::construct_shared_allocation() [with DeviceType=Kokkos::Device<Kokkos::HostSpace::execution_space, Kokkos::HostSpace::memory_space>, ValueType=uint32_t, Dummy=uint32_t]" 
/home/daissgr/workshop/KokkosTiger/src/kokkos/core/src/impl/Kokkos_ViewMapping.hpp(3463): here
            instantiation of "Kokkos::Impl::SharedAllocationRecord<void, void> *Kokkos::Impl::ViewMapping<Traits, std::enable_if_t<<expression>, void>>::allocate_shared(const Kokkos::Impl::ViewCtorProp<P...> &, const Traits::array_layout &, __nv_bool) [with Traits=Kokkos::ViewTraits<uint32_t *, Kokkos::HostSpace>, P=<std::string, Kokkos::HostSpace::memory_space, Kokkos::HostSpace::execution_space>]" 
/home/daissgr/workshop/KokkosTiger/src/kokkos/core/src/Kokkos_View.hpp(1434): here
            instantiation of "Kokkos::View<DataType, Properties...>::View(const Kokkos::Impl::ViewCtorProp<P...> &, const std::enable_if_t<<expression>, Kokkos::ViewTraits<DataType, Properties...>::array_layout> &) [with DataType=uint32_t *, Properties=<Kokkos::HostSpace>, P=<std::string>]" 
/home/daissgr/workshop/KokkosTiger/src/kokkos/core/src/Kokkos_View.hpp(1536): here
            instantiation of "Kokkos::View<DataType, Properties...>::View(const Label &, std::enable_if_t<Kokkos::Impl::is_view_label<Label>::value, const size_t>, size_t, size_t, size_t, size_t, size_t, size_t, size_t) [with DataType=uint32_t *, Properties=<Kokkos::HostSpace>, Label=char [27]]" 
/home/daissgr/workshop/KokkosTiger/src/kokkos/core/src/Kokkos_HPX.hpp(557): here

The other suggestion

#if !defined(HPX_CUDA_VERSION) || (HPX_CUDA_VERSION >= 1102)

seems to work once I adapted the HPX_CUDA_VERSION >= 1300 (I am on 1200 right now, so the ifdef would have not removed the noexcept code otherwise). Since we do not know which CUDA version will work in the future: Should we just drop the second if condition and only use

#if !defined(HPX_CUDA_VERSION)

?

@hkaiser
Copy link
Member Author

hkaiser commented Jan 9, 2024

The other suggestion

#if !defined(HPX_CUDA_VERSION) || (HPX_CUDA_VERSION >= 1102)

seems to work once I adapted the HPX_CUDA_VERSION >= 1300 (I am on 1200 right now, so the ifdef would have not removed the noexcept code otherwise). Since we do not know which CUDA version will work in the future: Should we just drop the second if condition and only use

#if !defined(HPX_CUDA_VERSION)

Yep, let's do that instead, then.

@hkaiser
Copy link
Member Author

hkaiser commented Jan 9, 2024

@G-071 I have updated this PR to do exactly that.

Copy link

codacy-production bot commented Jan 10, 2024

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
-0.01%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (7b35448) 197211 167924 85.15%
Head commit (ce14789) 190473 (-6738) 162166 (-5758) 85.14% (-0.01%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#6409) 0 0 ∅ (not applicable)

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

You may notice some variations in coverage metrics with the latest Coverage engine update. For more details, visit the documentation

@G-071
Copy link
Member

G-071 commented Jan 12, 2024

This did the trick, thanks! I can build [email protected] with it again. Should be good to merge!

That being said, I was unable to run Octo-Tiger with this: Octo-Tiger is segfaulting either on the first time step or when loading the options (same Octo-Tiger version still works with HPX 1.9.1). This seems to be an unrelated to this PR though as this also happens with master. I will investigate some more and open a separate issue for this.

@hkaiser hkaiser merged commit e8b7598 into master Jan 12, 2024
63 of 72 checks passed
@hkaiser hkaiser deleted the fixing_6407 branch January 12, 2024 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot build Kokkos 4.0.01 with current HPX master
2 participants