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

improve cuda/c++ separation in cudacpp builds (reduce cpp dependency on nvtx/curand) #681

Merged
merged 24 commits into from
Jun 4, 2023

Conversation

valassi
Copy link
Member

@valassi valassi commented Jun 4, 2023

This is a WIP MR to improve cuda/c++ separation in cudacpp builds. It addresses #679.

Part of the cleanup necessary to eventually build cleanly during launch, see #674

valassi added 19 commits June 4, 2023 09:09
…BUILDDIR)/.build.$(TAG) to avoid mixing different build modes also in builds of specific make targets

Example, this now fails
make -f cudacpp.mk ./check.exe RNDGEN=hasNoCurand
make -f cudacpp.mk ./check.exe RNDGEN=hasCurand

However this one still goes through
make -f cudacpp.mk ../../lib/libmg5amc_common.so RNDGEN=hasNoCurand
make -f cudacpp.mk ../../lib/libmg5amc_common.so RNDGEN=hasCurand
…$(BUILDDIR)/.build.$(TAG) to avoid mixing different build modes also in builds of specific make targets

This one now fails as expected
make -f cudacpp.mk ../../lib/libmg5amc_common.so RNDGEN=hasNoCurand
make -f cudacpp.mk ../../lib/libmg5amc_common.so RNDGEN=hasCurand
…n $(BUILDDIR)/.build.$(TAG) to avoid mixing different build modes also in builds of specific make targets

Now this fails as expected when building in src
make -f cudacpp_src.mk AVX=none FPTYPE=d HELINL=0 HRDCOD=0 RNDGEN=hasNoCurand ../lib/libmg5amc_common.so
make -f cudacpp_src.mk AVX=none FPTYPE=d HELINL=0 HRDCOD=0 RNDGEN=hasCurand ../lib/libmg5amc_common.so

(NB this is really not needed, as usually the builds in src are done from P1 only...)
madgraph5#679

Still need to test that I can optionally reenable it...
…end on curand madgraph5#679

These both succeed
make -f cudacpp.mk cleanall; make -f cudacpp.mk RNDGEN=hasCurand
make -f cudacpp.mk cleanall; make -f cudacpp.mk RNDGEN=hasNoCurand
…o C++ builds

When uncommenting the line, this now succeeds
make -f cudacpp.mk RNDGEN=hasNoCurand
…nly in RandomNumberKernels.o madgraph5#679

Essentially, the curand dependency is fully encapsulated in RandomNumberKernels.o
…nd runtest, keep it only in check madgraph5#679

Essentially: curand is presently used only in check.exe and gcheck.exe...
This means we should really disable it for madevent production builds?
…st and fcheck do not use the feature...

Revert "[builds] in gg_tt.mad cudacpp.mk, remove CURANDLIBFLAGS from fcheck and runtest, keep it only in check madgraph5#679"
This reverts commit 97701ed.
…umberKernel.cc and copy it to CurandRandomNumberKernel.cc

Fix the symlinks accordingly in P1
…andRandomNumberKernel.cc (remove curand and common, resepectively)
…curand only to check.exe, remove it from fcheck and runtest, madgraph5#679
@valassi valassi self-assigned this Jun 4, 2023
valassi added 2 commits June 4, 2023 18:23
STARTED  AT Sun Jun  4 11:51:42 CEST 2023
./tput/teeThroughputX.sh -mix -hrd -makej -eemumu -ggtt -ggttg -ggttgg -gqttq -ggttggg -makeclean
ENDED(1) AT Sun Jun  4 12:52:49 CEST 2023 [Status=0]
./tput/teeThroughputX.sh -flt -hrd -makej -eemumu -ggtt -ggttgg -inlonly -makeclean
ENDED(2) AT Sun Jun  4 13:08:14 CEST 2023 [Status=0]
./tput/teeThroughputX.sh -makej -eemumu -ggtt -ggttg -gqttq -ggttgg -ggttggg -flt -bridge -makeclean
ENDED(3) AT Sun Jun  4 13:17:18 CEST 2023 [Status=0]
./tput/teeThroughputX.sh -eemumu -ggtt -ggttgg -flt -rmbhst
ENDED(4) AT Sun Jun  4 13:20:18 CEST 2023 [Status=0]
./tput/teeThroughputX.sh -eemumu -ggtt -ggttgg -flt -curhst
ENDED(5) AT Sun Jun  4 13:23:16 CEST 2023 [Status=0]
STARTED AT Sun Jun  4 13:26:18 CEST 2023
ENDED   AT Sun Jun  4 17:42:58 CEST 2023
@valassi valassi changed the title WIP: improve cuda/c++ separation in cudacpp builds improve cuda/c++ separation in cudacpp builds (reduce cpp dependency on nvtx/curand) Jun 4, 2023
@valassi
Copy link
Member Author

valassi commented Jun 4, 2023

This bit is complete and can essentially be merged. I encapsulated as much as possible the dependecies of the c++ builds on NVTX and on curand.

Eventually it would be better to have two cleanly separated cuda and c++ builds (eg also with runTest split in two?) but this will be in #674 and similar issues

@valassi
Copy link
Member Author

valassi commented Jun 4, 2023

ci tests ok, self merging

@valassi valassi merged commit b9e87b0 into madgraph5:master Jun 4, 2023
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.

Remove C++ code dependencies on CUDA headers, except where curand is needed
1 participant