Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions alf/ext/fused_linear_act.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,7 @@
class StaticState:
workspace = {}
workspace_size = 1024 * 1024 * 8
bias_g = {
idx: torch.tensor([], dtype=torch.float16).cuda(idx)
for idx in range(torch.cuda.device_count())
}
bias_g = {}

@classmethod
def get(cls, name: str, device: torch.device) -> Any:
Expand All @@ -41,6 +38,7 @@ def get(cls, name: str, device: torch.device) -> Any:
cls.workspace[idx] = torch.empty((cls.workspace_size, ),
dtype=torch.uint8,
device=device).cuda(idx)
cls.bias_g[idx] = torch.tensor([], dtype=torch.float16).cuda(idx)
if name == "bias":
return cls.bias_g[idx]
if name == "workspace":
Expand Down