diff --git a/.flake/pkgs/ffdb/ffdb.py b/.flake/pkgs/ffdb/ffdb.py index c3e539bc6e..84354ccd82 100644 --- a/.flake/pkgs/ffdb/ffdb.py +++ b/.flake/pkgs/ffdb/ffdb.py @@ -5,108 +5,3 @@ gdb.execute(f'directory {get_config_root(Path.cwd())}') gdb.prompt_hook = lambda x: '(ffdb) ' gdb.execute('set history save on') - -# python -# from proj.config_file import get_config_root -# from pathlib import Path -# print(Path.cwd()) -# #gdb.execute(f'directory {get_conf}/{}') -# end - -# show directories - -# import gdb.printing -# -# class NodePrinter: -# def __init__(self, val): -# self.val = val -# -# def to_string(self): -# ptr = self.val["ptr"] -# if ptr != 0: -# op_type = ptr.referenced_value()['op_type'] -# return f'Node' -# else: -# return f'Node' -# -# class EdgePrinter: -# def __init__(self, val): -# self.val = val -# -# def to_string(self): -# return f'Edge' -# -# class MachineViewPrinter: -# def __init__(self, val): -# self.val = val -# -# def to_string(self): -# toks = [] -# if self.val['device_type'] == 0: -# toks.append('type=GPU') -# else: -# toks.append('type=CPU') -# start_device_id = self.val['start_device_id'] -# for i in range(self.val['ndims']): -# dim = self.val['dim'][i] -# stride = self.val['stride'][i] -# toks.append(f'{i}=[{start_device_id}:{start_device_id+dim}:{stride}]') -# return f'MachineView<{" ".join(toks)}>' -# -# class DomainPrinter: -# def __init__(self, val): -# self.val = val -# -# def to_string(self): -# toks = [] -# ndim = self.val['dim'] -# for i in range(ndim): -# lo = self.val['rect_data'][i] -# hi = self.val['rect_data'][i + ndim] -# toks.append(f'{i}=[{lo}:{hi}]') -# return f'Domain<{" ".join(toks)}>' -# -# class TensorShapePrinter: -# def __init__(self, val): -# self.val = val -# -# def to_string(self): -# toks = [] -# ndim = self.val['num_dims'] -# for i in range(ndim): -# dim = self.val['dims'][i] -# size = dim['size'] -# degree = dim['degree'] -# parallel_idx = dim['parallel_idx'] -# toks.append(f'{i}=[s={size} d={degree} pi={parallel_idx}]') -# return f'TensorShape<{" ".join(toks)}>' -# -# class ParallelTensorBasePrinter: -# def __init__(self, val): -# self.val = val -# -# def to_string(self): -# toks = [] -# toks.append(f'guid={self.val["parallel_tensor_guid"]}') -# ndim = self.val['num_dims'] -# for i in range(ndim): -# dim = self.val['dims'][i] -# size = dim['size'] -# degree = dim['degree'] -# parallel_idx = dim['parallel_idx'] -# toks.append(f'{i}=[s={size} d={degree} pi={parallel_idx}]') -# return f'ParallelTensorBase<{" ".join(toks)}>' -# -# def build_pretty_printer(): -# pp = gdb.printing.RegexpCollectionPrettyPrinter( -# "flexflow") -# pp.add_printer('Node', '^FlexFlow::PCG::Node$', NodePrinter) -# pp.add_printer('Edge', '^FlexFlow::PCG::Edge$', EdgePrinter) -# pp.add_printer('MachineView', '^FlexFlow::MachineView$', MachineViewPrinter) -# pp.add_printer('Domain', '^Legion::Domain$', DomainPrinter) -# pp.add_printer('ParallelTensorShape', '^FlexFlow::ParallelTensorShape$', TensorShapePrinter) -# pp.add_printer('ParallelTensorBase', '^FlexFlow::ParallelTensorBase$', ParallelTensorBasePrinter) -# return pp -# -# gdb.printing.register_pretty_printer( -# gdb.current_objfile(), build_pretty_printer(), replace=True)