Skip to content

Conduit Device Support#1358

Draft
JustinPrivitera wants to merge 165 commits into
developfrom
task/JustinPrivitera/05_01_24/device_support
Draft

Conduit Device Support#1358
JustinPrivitera wants to merge 165 commits into
developfrom
task/JustinPrivitera/05_01_24/device_support

Conversation

@JustinPrivitera
Copy link
Copy Markdown
Member

@JustinPrivitera JustinPrivitera commented Jan 24, 2025

Resolves #1358

TODO
Make ticket for follow-on work:

  • You can create a "parallel" exec policy that is_parallel_policy() returns false for. We should examine in the future if we want consistency with the policies.
  • init_device_memory_handlers() should be a static function that people only have to do once. We should have a conduit utility somewhere that should be able to do this somewhere. It should see if the handlers are installed and do it, otherwise do nothing.

@JustinPrivitera
Copy link
Copy Markdown
Member Author

JustinPrivitera commented Apr 22, 2026

Running with much larger arrays, src starting on host des starting on device

[ RUN      ] conduit_execution.strawman_data_accessor_src_host_des_device
[/usr/workspace/justin/conduit_builds/develop_04_03_2026_HIP/conduit/src/tests/conduit/t_conduit_execution.cpp : 1079]
 data_accessor sync policy=host src_start=host des_start=device
Path     Min time/rank Max time/rank Avg time/rank Time %    
use_with      0.001430      0.001430      0.001430  1.311628 
forall        0.106097      0.106097      0.106097 97.336826 
sync          0.001413      0.001413      0.001413  1.296252 
[/usr/workspace/justin/conduit_builds/develop_04_03_2026_HIP/conduit/src/tests/conduit/t_conduit_execution.cpp : 1107]
 data_accessor sync policy=device src_start=host des_start=device
Path     Min time/rank Max time/rank Avg time/rank Time %    
use_with      0.008063      0.008063      0.008063 98.000095 
forall        0.000116      0.000116      0.000116  1.414218 
sync          0.000000      0.000000      0.000000  0.003525 
[/usr/workspace/justin/conduit_builds/develop_04_03_2026_HIP/conduit/src/tests/conduit/t_conduit_execution.cpp : 1135]
 data_accessor assume policy=host src_start=host des_start=device
Path     Min time/rank Max time/rank Avg time/rank Time %    
use_with      0.001418      0.001418      0.001418  1.348748 
forall        0.103654      0.103654      0.103654 98.604876 
assume        0.000001      0.000001      0.000001  0.001389 
[/usr/workspace/justin/conduit_builds/develop_04_03_2026_HIP/conduit/src/tests/conduit/t_conduit_execution.cpp : 1163]
 data_accessor assume policy=device src_start=host des_start=device
Path     Min time/rank Max time/rank Avg time/rank Time %    
use_with      0.007959      0.007959      0.007959 98.013778 
forall        0.000115      0.000115      0.000115  1.415281 
assume        0.000000      0.000000      0.000000  0.003941 
[/usr/workspace/justin/conduit_builds/develop_04_03_2026_HIP/conduit/src/tests/conduit/t_conduit_execution.cpp : 1190]
 data_accessor active_space src_start=host des_start=device
Path     Min time/rank Max time/rank Avg time/rank Time %    
use_with      0.001423      0.001423      0.001423  1.318741 
forall        0.105016      0.105016      0.105016 97.324327 
sync          0.001414      0.001414      0.001414  1.310595 
[       OK ] conduit_execution.strawman_data_accessor_src_host_des_device (1106 ms)


// Compute face centers and normals.
conduit::execution::for_all<ExecPolicy>(0, totalNumFaces, [=](conduit::index_t f) {
conduit::execution::forall<ExecPolicy>(0, totalNumFaces, [=](conduit::index_t f) {
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am confused by this

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wherever this method is called, we want to take a look at the template and consider switching to a policy object choice.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

look into RDC before getting Cyrus' blessing

Comment thread src/libs/conduit/conduit_execution.cpp
Comment thread src/libs/conduit/conduit_execution.cpp
Comment thread src/libs/conduit/conduit_execution.cpp
Comment thread src/libs/conduit/conduit_execution.cpp
Comment thread src/libs/conduit/conduit_execution_policy.hpp
Comment thread src/libs/conduit/conduit_execution.hpp
Comment thread src/libs/conduit/conduit_execution_core.hpp Outdated
Comment thread src/libs/conduit/conduit_execution_core.hpp Outdated
Comment thread src/libs/conduit/conduit_execution_policy.hpp Outdated
Comment thread src/libs/conduit/conduit_execution_core.hpp Outdated
Comment thread src/tests/conduit/t_conduit_execution.cpp Outdated
Comment thread src/libs/conduit/conduit_execution_core.hpp Outdated
@JustinPrivitera
Copy link
Copy Markdown
Member Author

use hatchet/thicket to compare speedup

Comment thread src/libs/conduit/conduit_execution.hpp Outdated
// a TU that lacks that backend would silently fall through to the serial path.
//-----------------------------------------------------------------------------
inline void
validate_runtime_policy(const ExecutionPolicy &policy,
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's see if @cyrush likes the comment up above

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is bad

@cyrush doesn't like it :(

Comment thread src/libs/conduit/CMakeLists.txt
Comment thread src/libs/conduit/conduit_execution.hpp Outdated
//-----------------------------------------------------------------------------
template <typename T>
CONDUIT_EXEC T
atomic_add(ExecutionPolicy policy, T *acc, T value)
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

conditional in the hot path of the loop is really bad

compile with the atomic policy - template, not runtime policy

@JustinPrivitera JustinPrivitera marked this pull request as draft April 29, 2026 22:30
static std::string memory_space;
};

#if defined(CONDUIT_TU_IS_CUDA)
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need to include these into conduit core and conduit? Can't we just have them be included into cpp files and not headers? Then can we just use CONDUIT_USE_*** instead?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants