-
Notifications
You must be signed in to change notification settings - Fork 27.7k
[DISCUSSION] RPC server-side ThreadLocalState #38510
Copy link
Copy link
Open
Labels
module: multithreadingRelated to issues that occur when running on multiple CPU threadsRelated to issues that occur when running on multiple CPU threadsmodule: rpcRelated to RPC, distributed autograd, RRef, and distributed optimizerRelated to RPC, distributed autograd, RRef, and distributed optimizeroncall: jitAdd this issue/PR to JIT oncall triage queueAdd this issue/PR to JIT oncall triage queuetriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate moduleThis issue has been looked at a team member, and triaged and prioritized into an appropriate module
Metadata
Metadata
Assignees
Labels
module: multithreadingRelated to issues that occur when running on multiple CPU threadsRelated to issues that occur when running on multiple CPU threadsmodule: rpcRelated to RPC, distributed autograd, RRef, and distributed optimizerRelated to RPC, distributed autograd, RRef, and distributed optimizeroncall: jitAdd this issue/PR to JIT oncall triage queueAdd this issue/PR to JIT oncall triage queuetriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate moduleThis issue has been looked at a team member, and triaged and prioritized into an appropriate module
This is a followup discussion of #38439. We fix #38439 by restoring
ThreadLocalStateand distributed autograd context separately. Creating this issue to track discussion on whether distributed autograd context id belongs toThreadLocalState.hor we should createRpcThreadLocalState.hor else. Below are some concerns and notes from an offline discussion with @xush6528 @ilia-cher and @pritamdamania87,ThreadLocalState.hto set/skip autograd context id.ThreadLocalState.h, we should also dedup the similar logic added for RPC's TorchScript support. See [DistAutograd x JIT] Capture global state, dist autograd current context id, before thread switching triggered by JIT future.wait() #36395cc @suo @pietern @mrshenli @pritamdamania87 @zhaojuanmao @satgera @gqchen @aazzolini @rohan-varma @xush6528 @jjlilley @osalpekar