Skip to content

Commit 173297e

Browse files
committed
fixed epoch looping and kernel on cpu errors
1 parent fec6917 commit 173297e

3 files changed

Lines changed: 12 additions & 1 deletion

File tree

traincheck/config/config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"torch.fx",
2222
"torch._dynamo",
2323
"torch._sources", # FIXME: cannot handle this module, instrumenting it will lead to exceptions: TypeError: module, class, method, function, traceback, frame, or code object was expected, got builtin_function_or_method
24+
"torchtitan.trainer.Trainer.train_step",
2425
# "torch.autocast",
2526
# "torch.amp",
2627
# "torch.matmul",

traincheck/instrumentor/tracer.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -634,6 +634,14 @@ def instrument(self) -> int:
634634

635635
global IS_INSTRUMENTING
636636
IS_INSTRUMENTING = True
637+
638+
try:
639+
import torch.utils._device as _tc_torch_device
640+
641+
_tc_torch_device._device_constructors()
642+
except Exception:
643+
pass
644+
637645
visited_file_paths: set[str] = set()
638646

639647
first_pass_instrumented_count = 0

traincheck/trace/trace_pandas.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,9 @@ def get_column_dtype(self, column_name: str) -> type:
558558
return self.column_dtypes_cached[column_name]
559559

560560
filtered_values = self.events[column_name].dropna()
561-
filtered_values = filtered_values[filtered_values != MD_NONE()]
561+
#filtered_values = filtered_values[filtered_values != MD_NONE()]
562+
if filtered_values.dtype == object:
563+
filtered_values = filtered_values[filtered_values != MD_NONE()]
562564

563565
if filtered_values.empty:
564566
self.column_dtypes_cached[column_name] = MD_NONE

0 commit comments

Comments
 (0)