Hi,
In my model, there is a step where I am extracting features for each timestep of a sequence (line 2) that are then passed to my model in a next step (line 6):
> 1 state_vector, local_costmap, global_costmap = \
> 2 extract_features(grid, curr_pos, start_pos,
> 3 goal_pos, prev_pos, node_list, batch_size, i,
> 4 device, normalize_inputs)
> 5
> 6 pred, hidden_state = model(state_vector,
> 7 local_costmap,
> 8 global_costmap,
> 9 use_full_teacher_forcing,
> 10 hidden=hidden_state)
The extract_features() function performs a variety of operations (including a for loop over the batch size) to construct the inputs of the model for line 6. What I observe is that when I use a num_workers value of 0, the extract features method runs fast, but whenever I use any multiprocessing (num_workers>0), the extract features method runs slower. I am guessing that my extract_features() method is not conducive to parallel processing (it wasn’t designed for that either).
Therefore I am wondering if I can disable multiprocessing temporarily during the extract_features() step, and resume it once it is finished?