From 962bd0b259e86a08842506c681fbf6a1a95e593d Mon Sep 17 00:00:00 2001 From: Sahan Paliskara Date: Tue, 22 Jul 2025 08:17:51 -0700 Subject: [PATCH] Remove torch._running_with_deploy() from fbcode and add RuntimeError handling for load_library (#3207) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: As per https://fb.workplace.com/groups/pytorch.dev/permalink/1828123831099422 we can now safely remove “torch.is_deploy_running”. This commit does this! Additionally we are handling RuntimeErrors while using load_library in torchrec Reviewed By: nipung90 Differential Revision: D78525065 --- torchrec/distributed/train_pipeline/tracing.py | 1 - 1 file changed, 1 deletion(-) diff --git a/torchrec/distributed/train_pipeline/tracing.py b/torchrec/distributed/train_pipeline/tracing.py index ab4267868..c4a95756c 100644 --- a/torchrec/distributed/train_pipeline/tracing.py +++ b/torchrec/distributed/train_pipeline/tracing.py @@ -12,7 +12,6 @@ from typing import Any, Dict, List, Optional, Set, Tuple, Union import torch - from torch.distributed._composable.fsdp.fully_shard import FSDPModule as FSDP2 from torch.distributed.fsdp import FullyShardedDataParallel as FSDP