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

Commit

Permalink
match_prefix for test_fsdp against compiled state dict (#190)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
drisspg authored and facebook-github-bot committed Jan 17, 2024
1 parent f86dd67 commit 713d2db
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/test_fsdp.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,9 @@ def forward_backward():
sd_out_single_gpu = torch.load(sd_out_single_gpu_fname)
sd_out_fsdp = torch.load(sd_out_fsdp_fname)
for k, v1 in sd_out_single_gpu.items():
if compile_fsdp:
# The state-dict for compiled fsdp has a `_orig_mod` prefix
k = f"_orig_mod.{k}"
v2 = sd_out_fsdp[k]
v1, v2 = v1.cpu(), v2.cpu()
if is_fp8 and "noop" in k:
Expand Down

0 comments on commit 713d2db

Please sign in to comment.