Repository navigation
Conversation
…that device gauge, color-spinor and clover fields make while tuning in pinned host or device memory instead of fresh pageable host memory, the default
…and long links only when verifying, on the first verify(), instead of in every run's setup
…tuning, so that its timings exclude tuning
…d restore exactly what was backed up
…ol, with a LatticeField::BackupMemPool helper
…it in lattice_field.h
Member
|
Thinking out loud and might need more plumbing: Could we use managed ? Should go to device by default but could spill to host - probably slow but might not matter so much when tuning is slow to begin with. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR was motivated by hisq force auto-tuning taking forever... and finding out that a lot of the time was actually spent in the copies for backing up and restoring fields.
New features
QUDA_TUNE_BACKUP_MEMORY=host|pinned|deviceselects the memory for the backups that deviceGaugeField,ColorSpinorFieldandCloverFieldobjects make inpreTune()and restore inpostTune():host(default): a fresh pageable host allocation per backup, as before.pinned: pooled pinned host memory.device: device memory, allocated outside QUDA's device memory pool.device, running out of device memory errors as any device allocation does.Performance
hisq_stencil_testandhisq_stencil_ctest: the CPU reference fat and long links are built on the firstverify()instead of in setup. The ctest still builds its reference with the Naik term.unitarizeLinksCPUandfermion_force::unitarizeForceCPU: the loop over sites is parallelized with OpenMP.Bug fixes
hisq_paths_force_test: when tuning, each force kernel is first called untimed, so the reported times exclude tuning.hisq_stencil_testandhisq_stencil_ctest:destroy()frees only the buffers that were allocated. Previously the Naik reference buffers were freed only if the last test used the Naik term.CloverField::backup()/restore(): the inverse is backed up only if the field holds one at backup time, andrestore()restores exactly what was backed up. Previously a second buffer was always allocated, and the inverse was restored whenever the field held one at restore time.Testing
Build:
STRICT, sm_100, MPI, OpenMP, staggered. Single rank on one B200 (x86 host).hisq_paths_force_test --partition 14 --prec single --recon 13 --verify false, empty tunecache:hostpinneddevice2.8 GiB copy rates on the same node:
mallochisq_paths_force_test --verify true(8×8×8×16,--partition 14, empty tunecache): passes in all three modes, single and double precision.clover_force_test(ctest arguments,--compute-clover true, empty tunecache,QUDA_CLOVER_DYNAMIC=ON, soCloverInverttunes and backs up the clover field): 16 of 16 pass in all three modes.blas_test(ctest arguments,--nsrc 8 --msrc 9, empty tunecache, which backs up sets of color-spinor fields): 480 of 480 pass in all three modes.Device backups outside the pool: 1/8 volume,
device, 25.7 s, against 26.3 s with pooled device backups. An unpooledcudaMalloc+cudaFreecosts about 0.7× the device-to-device backup and restore copies (1.3 ms against 1.8 ms at 2.75 GiB).hisq_stencil_test, 24⁴: setup 6.8 s → 0.25 s with--verify false. Passes with--verify true, with and without the Naik term.hisq_stencil_ctest: 64 passed; the 64 skipped are partition settings that are off by default.unitarize_link_testandhisq_unitarize_force_test: pass in single and double precision.hisq_paths_force_testwith an empty tunecache now reports a staples time of 61.7 ms instead of 131,238 ms; with a filled tunecache it reports 45.6 ms.git clang-format --diff origin/develop: no changes.Multi-rank, with ranks sharing one GPU (
QUDA_ENABLE_MPS=1), empty tunecaches:hisq_paths_force_test --verify true(2 of 2),clover_force_test(16 of 16) andblas_test(480 of 480) pass in all three modes.hisq_paths_force_test --verify truepasses withhostanddevice.