This repository has been archived by the owner on Aug 11, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
211 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,19 @@ | ||
import torch | ||
from labml import monit | ||
from torch import nn | ||
|
||
from labml import monit | ||
from neox.evaluation import run_eval_harness | ||
from neox.utils import load_layers | ||
from neox.utils import LayerGenerator | ||
|
||
if __name__ == '__main__': | ||
layers = load_layers(None) | ||
device = torch.device('cuda:0') | ||
layers = list(LayerGenerator(is_clone_layers=True, | ||
filter_layers=None, | ||
dtype=torch.float16, | ||
device=device | ||
).load()) | ||
|
||
with monit.section('Sequential'): | ||
model = nn.Sequential(*layers).half().to(torch.device('cuda:0')) | ||
model = nn.Sequential(*layers).half().to() | ||
|
||
print(run_eval_harness(model, 'half_precision', [], torch.device('cuda:0'))) | ||
print(run_eval_harness(model, 'half_precision', [], device)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters