You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
src/mpi/coll/selection.json - MPIR_CVAR_COLL_SELECTION_JSON_FILE
The former only selects "composition" algorithms, and the later only selects "pure" algorithms.
PS, maybe "simple" is better name than "pure"?
Types of algorithms -
Pure (or Simple) algorithm - that does not call another collective
One (main) source file for each algorithm
Comment block at the top listing -
name
collective type
restriction list (we'll standardize a list of restrictions)
extra params
cvar params
more
for example, heuristic performance guide?
Compositional algorithm - that calls other collectives
Algorithmic composition - calls other collective with the same communicator
Pipeline algorithm can be designed as an algorithmic composition
Hierarchical composition - calls other collective on sub-communicators
Potentially recursive for multi-level hierarchy
State composition - Calls the same collective with modified state (coll_sig)
GPU buffer-swap
Blocking collectives using NB (nonblocking) collectives
Null composition - MPIR_Bcast_auto
Types of restrictions (non-exhaustive):
intra/inter
gpu/host
ipc
parent-comm
power-of-two
inplace/no-inplace
commutative/builtin-op
node-consecutive
more
If there is restrictions listed, call MPIR_COLL_Check_restrictions at the beginning of the algorithm. It will either error out or fallback when restrictions are violated - controlled by MPIR_CVAR_COLL_FALLBACK (boolean). If fallback, it falls back to MPIR_Bcast_auto. NOTE: MPIR_Bcast_auto will never select a function that fails a restriction. This will be ensured by a json validation check at autogen/init time
Direct Overwriting CVAR
MPIR_CVAR_BCAST_INTRA_ALGORITHM will instruct
MPIR_Bcast_auto to call the cvar selected algo function
MPIR_Coll_composition_auto to call MPIR_Bcast_auto unless MPIR_CVAR_BCAST_INTRA_COMPOSITION is also selected, then it will call the cvar selected composition algo.
MPIR_Bcast_auto will set a bit in coll_attr and skip the cvar check if the bit is set. This will prevent cvar recursion.
alternativeMPIR_Bcast_auto check restrictions before call the CVAR selected algorithm
Alternatively, add one more abstraction above MPIR_Bcast_auto, say MPIR_Bcast_auto_and_cvar (name for illustration).
MPIR_Bcast_composition_auto and all composition algorithm will call MPIR_Bcast_auto_and_cvar.
MPIR_Bcast_auto_and_cvar will call MPIR_Bcast_auto or the cvar-specified algorithm
All simple algorithms only fallback to MPIR_Bcast_auto, thus avoiding cvar recursions.
JSON Decision Tree
There are 2 types of decision nodes -
Boolean or Discrete conditions
intercomm or intracomm
comm_size is power-of-2
builtin-op
data is contiguous
gpu buffer
etc.
Continuous threshold
comm_size
msg_size
Discrete conditions effectively makes a Venn diagram with each intersect region containing a list of algorithms
Continuous threshold provides tunable selection of the final algorithm.
An intuitive design for JSON tree is to have discrete nodes first and then threshold nodes within each intersect regions.
I assume the discrete condition that provides simple regions should be tested first.
Device-specific Collective Algorithm
Device-specific built-in JSON at configure time
configure can select the json tree corresponding to the configured device
The JSON file can use template to avoid duplicating MPIR-only default JSON.
Device-specific selection condition
MPIR_Csel_coll_sig_s can have an attr for bit-mask conditions and a generic attr_mask=name can check that named bit mask
MPIR_init_coll_sig can have device hooks to initialize device-specific conditions
MPII_Csel_container_type_e can have device-specific entries
MPII_Create_container can call MPID_Create_container for algorithm entries that start with MPID_ prefix
MPII_Call_container can call MPID_Call_container for device-layer algorithms.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Here is the plan, RFC, using
Bcastas an example.Function interfaces -
MPIR_Coll_composition_autocoll_composition.json, which selects one of the "composition" algorithms (defined below).MPIR_Bcast_implMPI_Bcast->MPIR_Bcast_implcoll_sigand callMPIR_Coll_compositionMPIR_Bcast_auto- all composition algorithms call_autofunctions.coll_select.json, which selects one of the "pure" algorithm (defined below).MPIR_Bcast_autoitself is a "composition" algorithm to be selected byMPIR_Bcast_implMPIR_Bcast_fallback- a manual "auto" function that selects a small list of "pure" algorithm (often just 1 basic algorithm).if/elsehard coded selection.JSON tuning files
src/mpi/coll/composition.json-MPIR_CVAR_COLL_COMPOSITION_JSON_FILEsrc/mpi/coll/selection.json-MPIR_CVAR_COLL_SELECTION_JSON_FILEThe former only selects "composition" algorithms, and the later only selects "pure" algorithms.
Types of algorithms -
coll_sig)MPIR_Bcast_autoTypes of restrictions (non-exhaustive):
If there is restrictions listed, call
MPIR_COLL_Check_restrictionsat the beginning of the algorithm. It will either error out or fallback when restrictions are violated - controlled byMPIR_CVAR_COLL_FALLBACK(boolean). If fallback, it falls back toMPIR_Bcast_auto.NOTE:
MPIR_Bcast_autowill never select a function that fails a restriction. This will be ensured by a json validation check at autogen/init timeDirect Overwriting CVAR
MPIR_CVAR_BCAST_INTRA_ALGORITHMwill instructMPIR_Bcast_autoto call the cvar selected algo functionMPIR_Coll_composition_autoto callMPIR_Bcast_autounlessMPIR_CVAR_BCAST_INTRA_COMPOSITIONis also selected, then it will call the cvar selected composition algo.MPIR_Bcast_autowill set a bit incoll_attrand skip the cvar check if the bit is set. This will prevent cvar recursion.MPIR_Bcast_autocheck restrictions before call the CVAR selected algorithmMPIR_Bcast_auto, sayMPIR_Bcast_auto_and_cvar(name for illustration).MPIR_Bcast_composition_autoand all composition algorithm will callMPIR_Bcast_auto_and_cvar.MPIR_Bcast_auto_and_cvarwill callMPIR_Bcast_autoor the cvar-specified algorithmMPIR_Bcast_auto, thus avoiding cvar recursions.JSON Decision Tree
There are 2 types of decision nodes -
comm_sizemsg_sizeAn intuitive design for JSON tree is to have discrete nodes first and then threshold nodes within each intersect regions.
I assume the discrete condition that provides simple regions should be tested first.
Device-specific Collective Algorithm
configurecan select the json tree corresponding to the configureddeviceMPIR_Csel_coll_sig_scan have anattrfor bit-mask conditions and a genericattr_mask=namecan check that named bit maskMPIR_init_coll_sigcan have device hooks to initialize device-specific conditionsMPII_Csel_container_type_ecan have device-specific entriesMPII_Create_containercan callMPID_Create_containerfor algorithm entries that start withMPID_prefixMPII_Call_containercan callMPID_Call_containerfor device-layer algorithms.Beta Was this translation helpful? Give feedback.
All reactions