(rank)
| 83 | model_state_dict_lst.extend([""] * (total_shards - 1)) |
| 84 | |
| 85 | def process_one_shard(rank): |
| 86 | model_path = os.path.join(local_dir, f'model_world_size_{world_size}_rank_{rank}.pt') |
| 87 | state_dict = torch.load(model_path, map_location='cpu', weights_only=False) |
| 88 | model_state_dict_lst[rank] = state_dict |
| 89 | return state_dict |
| 90 | |
| 91 | with ThreadPoolExecutor(max_workers=min(32, os.cpu_count())) as executor: |
| 92 | for rank in range(1, total_shards): |
nothing calls this directly
no outgoing calls
no test coverage detected