Skip to content
This repository was archived by the owner on Aug 7, 2024. It is now read-only.

Commit 713d2db

Browse files
drisspgfacebook-github-bot
authored andcommitted
match_prefix for test_fsdp against compiled state dict (#190)
Summary: Fix test/test_fsdp.py to match correct state dict entries Pull Request resolved: #190 Reviewed By: bdhirsh Differential Revision: D52846095 Pulled By: drisspg fbshipit-source-id: e094575525820be91026bb445406234fb5ca33f1
1 parent f86dd67 commit 713d2db

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

test/test_fsdp.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,9 @@ def forward_backward():
216216
sd_out_single_gpu = torch.load(sd_out_single_gpu_fname)
217217
sd_out_fsdp = torch.load(sd_out_fsdp_fname)
218218
for k, v1 in sd_out_single_gpu.items():
219+
if compile_fsdp:
220+
# The state-dict for compiled fsdp has a `_orig_mod` prefix
221+
k = f"_orig_mod.{k}"
219222
v2 = sd_out_fsdp[k]
220223
v1, v2 = v1.cpu(), v2.cpu()
221224
if is_fp8 and "noop" in k:

0 commit comments

Comments
 (0)