MCPcopy Create free account
hub / github.com/deepspeedai/DeepSpeed / wait_buffer_state_until_2

Function wait_buffer_state_until_2

csrc/cpu/comm/shm.cpp:114–125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

112char** distributed_buffer[2];
113
114void wait_buffer_state_until_2(int index,
115 enum coll_state state0,
116 enum coll_state state1,
117 int state_group)
118{
119 volatile enum coll_state* state_ptr = &(workspace[index]->states[state_group]);
120
121 while (1) {
122 volatile enum coll_state cur_state = *state_ptr;
123 if (cur_state == state0 || cur_state == state1) break;
124 }
125}
126
127void reduce_all_buffers(int start_elements,
128 int num_elements,

Callers 2

distributed_naive_reduceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected