Skip to content
Draft
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: 6 additions & 0 deletions walrus/models/isotropic_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from operator import mul
from typing import Callable, List, Optional

import warnings
import numpy as np
import torch
import torch.nn as nn
Expand Down Expand Up @@ -430,3 +431,8 @@ def forward(
x = x.squeeze(-1)
# Return T, B, C, H, [W], [D]
return x # TODO - Return attention maps for debugging

def compile(self, **kwargs) -> None:
warnings.warn("IsotropicModel.compile() currently only supports torch compilation for IsotropicModel.blocks. Note that torch.compile(IsotropicModel) will attempt to compile the entire forward call instead", UserWarning)
for blk in self.blocks:
blk.compile(**kwargs)