NOTE: creates both communication and synchronization overhead so should be used sparingly takes a list of ints from each rank and ensures that they are the same across ranks, throwing an exception if they are not.
(ints: List[int])
| 112 | |
| 113 | @instrument_w_nvtx |
| 114 | def assert_ints_same_as_other_ranks(ints: List[int]) -> None: |
| 115 | """ |
| 116 | NOTE: creates both communication and synchronization overhead so should be |
| 117 | used sparingly |
| 118 | |
| 119 | takes a list of ints from each rank and ensures that they are the same |
| 120 | across ranks, throwing an exception if they are not. |
| 121 | """ |
| 122 | assert_lst_len_same_as_other_ranks(ints) |
| 123 | rank0_ints = get_lst_from_rank0(ints) |
| 124 | if ints != rank0_ints: |
| 125 | raise RuntimeError(f"Detected a disagreement on list contents between rank0 and rank{dist.get_rank()}: " |
| 126 | f"\n list length: {len(ints)}" |
| 127 | f"\n rank0: {rank0_ints} " |
| 128 | f"\n rank{dist.get_rank()}: {ints}") |
| 129 | |
| 130 | |
| 131 | def is_builtin_type(obj): |
no test coverage detected