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

Remote space support #1886

Merged
merged 5 commits into from Nov 28, 2018
Merged

Remote space support #1886

merged 5 commits into from Nov 28, 2018

Conversation

crtrott
Copy link
Member

@crtrott crtrott commented Nov 6, 2018

No description provided.

@@ -542,7 +552,7 @@ class View : public ViewTraits< DataType , Properties ... > {

private:

typedef Kokkos::Impl::ViewMapping< traits , void > map_type ;
typedef Kokkos::Impl::ViewMapping< traits , typename traits::specialize > map_type ;
Copy link
Contributor

Choose a reason for hiding this comment

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

@crtrott I think this change will affect Sacado, the ViewMapping there expects void, but this change will result (in Sacado) in the second template parameter being some specialize tag (e.g. ViewSpecializeSacadoFad etc). The change there seems like it should be easy, but we should check with Eric in case of overlooking something.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, look at my new commit which fixes the internal aggregates test which mimics what Sacado does. It actually makes the code cleaner and I was able to delete parts of the specialization.

Copy link
Contributor

Choose a reason for hiding this comment

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

The only potential issue I see is that Sacado currently has several partial specializations of ViewMapping<> for a given view specialization tag that are differentiated through enable_if<>, to support assignments between different view specializations (see, e.g., the ViewMapping<> specializations here.) This is to allow, e.g, View<double...> = View<Fad...> etc. Will that still work?

Copy link
Contributor

Choose a reason for hiding this comment

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

@etphipp it may be as simple as replacing the final explicit void template parameter in ViewMapping typedefs with the appropriate specialization tag except for the case you mentioned above, e.g. leave as void for the DstType in this case:
line 1365 and in matching places for the other specialized ViewMapping types.

Also making sure to change the default void return type of the enable_ifs used in the ViewMapping specialization declarations to return the proper specialize tag.

@crtrott
Copy link
Member Author

crtrott commented Nov 7, 2018

ModuleCmd_Load.c(213):ERROR:105: Unable to locate a modulefile for 'git'
Running on machine: apollo
Repository Status:  f0b89550ca7f50d9115d12c035f9cc3ab784eea9 Fix ViewArray aggregate type


Going to test compilers:  gcc/4.8.4 gcc/5.3.0 intel/16.0.1 clang/3.9.0 clang/6.0 cuda/9.1
Testing compiler gcc/4.8.4
  Starting job gcc-4.8.4-OpenMP-release
  PASSED gcc-4.8.4-OpenMP-release
Testing compiler gcc/5.3.0
  Starting job gcc-4.8.4-Pthread-release
  PASSED gcc-4.8.4-Pthread-release
Testing compiler intel/16.0.1
  Starting job gcc-5.3.0-Serial-release
  PASSED gcc-5.3.0-Serial-release
Testing compiler clang/3.9.0
  Starting job intel-16.0.1-OpenMP-release
  PASSED intel-16.0.1-OpenMP-release
Testing compiler clang/6.0
  Starting job clang-3.9.0-Pthread_Serial-release
  PASSED clang-3.9.0-Pthread_Serial-release
  Starting job clang-6.0-Cuda_Pthread-release
  PASSED clang-6.0-Cuda_Pthread-release
Testing compiler cuda/9.1
  Starting job clang-6.0-OpenMP-release
  PASSED clang-6.0-OpenMP-release
  Starting job cuda-9.1-Cuda_OpenMP-release
  PASSED cuda-9.1-Cuda_OpenMP-release
#######################################################
PASSED TESTS
#######################################################
clang-3.9.0-Pthread_Serial-release build_time=128 run_time=440
clang-6.0-Cuda_Pthread-release build_time=249 run_time=314
clang-6.0-OpenMP-release build_time=125 run_time=106
cuda-9.1-Cuda_OpenMP-release build_time=307 run_time=216
gcc-4.8.4-OpenMP-release build_time=103 run_time=95
gcc-4.8.4-Pthread-release build_time=97 run_time=319
gcc-5.3.0-Serial-release build_time=118 run_time=165
intel-16.0.1-OpenMP-release build_time=331 run_time=141

@crtrott
Copy link
Member Author

crtrott commented Nov 7, 2018

@etphipp Eric please check this pull request since it will affect Sacado. But I believe it makes it actually ever so slightly clearer how to specialize these things.

@ndellingwood
Copy link
Contributor

@crtrott I pushed some changes needed for DynRankViews, so this will need re-spot-checked.

@etphipp I attached patches for sacado and stokhos with fixes for this PR and also created a new kokkos-promotion branch in Trilinos to accumulate changes as the come (this PR will break Trilinos so changes will need to accumulate for the next promotion). Are you fine with the changes?

I tested (sym-linking to this branch of kokkos) with a Cuda_Serial build on Waterman. There were no Sacado test failures and one Stokhos test failure that was failing with/without Kokkos changes during integration testing:

The following tests FAILED:
	 61 - Stokhos_KokkosArrayKernelsUnitTest_Cuda_MPI_1 (Failed)

Specific subtest:

61: The following tests FAILED:
61:     7. Kokkos_SG_SpMv_double_Cuda_CrsProductTensor_UnitTest ...

sacado-kokkos1886.patch.txt

stokhos-kokkos1886.patch.txt

Here was my testing setup on waterman:

Configuration:

export TRILINOS_DIR=${PWD}/../..

# Load modules
module purge
source ${TRILINOS_DIR}/cmake/std/atdm/load-env.sh cuda-9.2-opt
module swap cmake/3.6.2 cmake/3.12.3
#source $TRILINOS_DIR/cmake/std/atdm/load-env.sh cuda-9.2-debug-Kepler37

# Packages
PACKAGE1=Sacado
PACKAGE1=Stokhos

# Configure
cmake \
 -GNinja \
 -DTrilinos_CONFIGURE_OPTIONS_FILE:STRING=cmake/std/atdm/ATDMDevEnv.cmake \
 -DTrilinos_ENABLE_TESTS=ON \
  -DTrilinos_ENABLE_${PACKAGE1}=ON \
  -DTrilinos_ENABLE_${PACKAGE2}=ON \
  -DKOKKOS_ENABLE_DEPRECATED_CODE=ON \
  -DKokkos_SOURCE_DIR_OVERRIDE:STRING=kokkos \
  -DKokkosKernels_SOURCE_DIR_OVERRIDE:STRING=kokkos-kernels \
$TRILINOS_DIR

Source the configuration script, build the code (on or off node), then allocate a node to run the

bsub -Is -n 16 -q rhel7W bash

ctest

ndellingwood added a commit to trilinos/Trilinos that referenced this pull request Nov 8, 2018
Changes to coordinate with kokkos/kokkos#1886.

Various ViewMapping partial specializations now require the final
template parameter to be the specialize tag, rather than explicit void.

These changes ensure Sacado and Stokhos compatibility with the Kokkos changes.

Test with Cuda_Serial build on waterman with cuda/9.2+gcc/7.2

 Changes to be committed:
	modified:   packages/sacado/src/KokkosExp_View_Fad.hpp
	modified:   packages/sacado/src/KokkosExp_View_Fad_Contiguous.hpp
	modified:   packages/sacado/src/Kokkos_DynRankView_Fad.hpp
	modified:   packages/sacado/src/Kokkos_DynRankView_Fad_Contiguous.hpp
	modified:   packages/sacado/test/UnitTests/Fad_KokkosTests_Cuda.cpp
	modified:   packages/stokhos/src/sacado/kokkos/pce/KokkosExp_View_UQ_PCE_Contiguous.hpp
	modified:   packages/stokhos/src/sacado/kokkos/vector/KokkosExp_View_MP_Vector_Contiguous.hpp
@mhoemmen
Copy link
Contributor

mhoemmen commented Nov 8, 2018

Just curious -- does this PR have anything to do with "remote space support"? It looks like it's all about View specialization.

@ndellingwood
Copy link
Contributor

@crtrott kokkos-dev spot-check passes:

Running on machine: sems
Repository Status:  18ab598c65714bae1f0df64e3c329c8703f943b0 DynRanView,View: update ViewMapping to use specialize tag 


Going to test compilers:  gcc/5.3.0 gcc/7.3.0 intel/17.0.1 clang/4.0.1 cuda/8.0.44
Testing compiler gcc/5.3.0
Testing compiler gcc/7.3.0
  Starting job gcc-5.3.0-OpenMP-release
  PASSED gcc-5.3.0-OpenMP-release
Testing compiler intel/17.0.1
  Starting job gcc-7.3.0-Serial-release
  PASSED gcc-7.3.0-Serial-release
Testing compiler clang/4.0.1
  Starting job intel-17.0.1-OpenMP-release
  PASSED intel-17.0.1-OpenMP-release
Testing compiler cuda/8.0.44
  Starting job clang-4.0.1-Pthread_Serial-release
  PASSED clang-4.0.1-Pthread_Serial-release
  Starting job cuda-8.0.44-Cuda_OpenMP-release
  PASSED cuda-8.0.44-Cuda_OpenMP-release
#######################################################
PASSED TESTS
#######################################################
clang-4.0.1-Pthread_Serial-release build_time=184 run_time=388
cuda-8.0.44-Cuda_OpenMP-release build_time=552 run_time=628
gcc-5.3.0-OpenMP-release build_time=176 run_time=94
gcc-7.3.0-Serial-release build_time=149 run_time=164
intel-17.0.1-OpenMP-release build_time=438 run_time=150

@ndellingwood
Copy link
Contributor

@mhoemmen I think the changes are needed for a separate branch or repo where Christian is working on the remote space support.

@etphipp
Copy link
Contributor

etphipp commented Nov 13, 2018

I added a PR to trilinos that fixes the test failure,

trilinos/Trilinos#3867

which is unrelated to this PR here.

@ndellingwood
Copy link
Contributor

@crtrott This should be ready to merge, I created a new kokkos-promotion branch of Trilinos to track the sacado and stokhos fixes necessary to support this change.

@crtrott crtrott merged commit 27ae89f into develop Nov 28, 2018
@crtrott crtrott deleted the remote-space-support branch November 28, 2018 18:49
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.

None yet

4 participants