That line is there to make sure the error trace info on the trainer (a different process from the agent process) can be propagated to the agent for error summary and reporting purposes. See: Error Propagation — PyTorch 1.10.0 documentation 6
If the @record is not there then no trace information will be logged in the error summary table. So you’ll have to dig through the logs for the exception stack trace.