Skip to content
This repository was archived by the owner on May 19, 2026. It is now read-only.
Draft
Show file tree
Hide file tree
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
10 changes: 10 additions & 0 deletions crossfit/backend/torch/op/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ def __init__(

@torch.no_grad()
def call(self, data, partition_info=None):
# Get the current CUDA device
current_device = torch.cuda.current_device()
# Print CUDA memory at the beginning of the method
print(f"CUDA memory at start (device {current_device}):")
print(torch.cuda.memory_summary(device=current_device))

index = data.index.copy()
if self.sorted_data_loader:
loader = SortedSeqLoader(
Expand Down Expand Up @@ -101,6 +107,10 @@ def call(self, data, partition_info=None):
raise RuntimeError(f"Unexpected output shape: {output.shape}")
del outputs, _index
cleanup_torch_cache()

# Print CUDA memory at the end of the method
print(f"CUDA memory at end (device {current_device}):")
print(torch.cuda.memory_summary(device=current_device))
return out

def meta(self):
Expand Down
4 changes: 2 additions & 2 deletions crossfit/data/dataframe/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ def _(data):

# Fall-back `ArrayBundle` definition
class ArrayBundle(FrameBackend):
@lru_cache
@lru_cache(maxsize=1)
def __len__(self):
_len = None
for k, v in self.data.items():
Expand Down Expand Up @@ -421,7 +421,7 @@ def assign(self, **kwargs):
data = self.data.copy()
for k, v in kwargs.items():
if self.columns and len(v) != len(self):
raise ValueError(f"Column {k} was length {len(v)}, but expected length {len(self)}")
raise ValueError(f"Column {k} was length {len(v)} but expected length {len(self)}")
data.update(**kwargs)
return self.__class__(data)

Expand Down