Skip to content

Instantly share code, notes, and snippets.

@swolchok
swolchok / new_code.py
Created February 4, 2025 02:37
generated code being checked in backends/arm/test/models/test_conformer.py test_conformer_tosa_MI
new code
def forward(self, b_conformer_layers_0_conv_module_sequential_3_num_batches_tracked, b_conformer_layers_1_conv_module_sequential_3_num_batches_tracked, input, lengths): input_1 = input
aten_arange_start_step = executorch_exir_dialects_edge__ops_aten_arange_start_step(0, 97, dtype = torch.int32, layout = torch.strided, device = device(type='cpu'), pin_memory = False)
scalar_tensor = torch.ops.aten.scalar_tensor.default(-inf, dtype = torch.float32, layout = torch.strided, device = device(type='cpu'))
scalar_tensor_1 = torch.ops.aten.scalar_tensor.default(-inf, dtype = torch.float32, layout = torch.strided, device = device(type='cpu'))
lowered_module_0 = self.lowered_module_0
lowered_module_1 = self.lowered_module_1
lowered_module_2 = self.lowered_module_2
lowered_module_3 = self.lowered_module_3
aten_max_default = executorch_exir_dialects_edge__ops_aten_max_default(lengths)
@swolchok
swolchok / gist:8bd4ca61e156827f23bb54ca3b48d54f
Created March 8, 2023 20:18
benchmark output for dict annotation_str optimization
Nesting level: 1
output: Dict[str, Tuple[str, str]]
<torch.utils.benchmark.utils.common.Measurement object at 0x7f8a3a31ff40>
x.annotation_str
Median: 20.85 us
IQR: 0.67 us (20.55 to 21.22)
95 measurements, 100 runs per measurement, 1 thread
Nesting level: 3
output: Dict[str, Tuple[Dict[str, Tuple[Dict[str, Tuple[str, str]], Dict[str,
<torch.utils.benchmark.utils.common.Measurement object at 0x7f8a3a31fe80>
Nesting level: 1
output: Dict[str, Tuple[str, str]]
<torch.utils.benchmark.utils.common.Measurement object at 0x7f6969bb1f40>
x.annotation_str
Median: 18.42 us
IQR: 1.04 us (17.86 to 18.90)
108 measurements, 100 runs per measurement, 1 thread
Nesting level: 3
output: Dict[str, Tuple[Dict[str, Tuple[Dict[str, Tuple[str, str]], Dict[str,
<torch.utils.benchmark.utils.common.Measurement object at 0x7f6969bb1e80>
@swolchok
swolchok / baseline.txt
Created March 8, 2023 18:45
baseline output for nested_annotation_str benchmark
Nesting level: 1
output: Dict[str, Tuple[str, str]]
<torch.utils.benchmark.utils.common.Measurement object at 0x7f7bcb854f40>
x.annotation_str
Median: 19.34 us
IQR: 0.81 us (19.02 to 19.83)
101 measurements, 100 runs per measurement, 1 thread
Nesting level: 3
output: Dict[str, Tuple[Dict[str, Tuple[Dict[str, Tuple[str, str]], Dict[str,
<torch.utils.benchmark.utils.common.Measurement object at 0x7f7bcb854e80>
Flat profile:
Each sample counts as 0.01 seconds.
% cumulative self self total
time seconds seconds calls s/call s/call name
72.28 21.82 21.82 47800000 0.00 0.00 camlDefault_Tar__Layout__layoutNodeImpl_1039
10.67 25.04 3.22 13800000 0.00 0.00 camlDefault_Tar__Layout__layoutNode_1161
6.64 27.05 2.01 40900001 0.00 0.00 caml_obj_dup
4.27 28.34 1.29 61600000 0.00 0.00 camlDefault_Tar__Layout__layoutNodeInternal_1038
2.48 29.09 0.75 100000 0.00 0.00 camlDefault_Tar__LayoutTestFixedEncoding__fun_3905
/*
* robotMaze.js
*
* The blue key is inside a labyrinth, and extracting
* it will not be easy.
*
* It's a good thing that you're a AI expert, or
* we would have to leave empty-handed.
*/