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])
| 121 | |
| 122 | @instrument_w_nvtx |
| 123 | def assert_ints_same_as_other_ranks(ints: List[int]) -> None: |
| 124 | """ |
| 125 | NOTE: creates both communication and synchronization overhead so should be |
| 126 | used sparingly |
| 127 | |
| 128 | takes a list of ints from each rank and ensures that they are the same |
| 129 | across ranks, throwing an exception if they are not. |
| 130 | """ |
| 131 | assert_lst_len_same_as_other_ranks(ints) |
| 132 | rank0_ints = get_lst_from_rank0(ints) |
| 133 | if ints != rank0_ints: |
| 134 | raise RuntimeError(f"Detected a disagreement on list contents between rank0 and rank{dist.get_rank()}: " |
| 135 | f"\n list length: {len(ints)}" |
| 136 | f"\n rank0: {rank0_ints} " |
| 137 | f"\n rank{dist.get_rank()}: {ints}") |
| 138 | |
| 139 | |
| 140 | def is_builtin_type(obj): |
no test coverage detected