Skip to content

Commit

Permalink
CR for #24 (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
ezyang authored May 1, 2024
1 parent c79c038 commit 6401e99
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ impl Default for ParseConfig {
}
}

fn maybe_remove_suffix(frames: &mut Vec<FrameSummary>) {
fn maybe_remove_convert_frame_suffixes(frames: &mut Vec<FrameSummary>) {
let target_frames = [
("torch/_dynamo/convert_frame.py", "catch_errors"),
("torch/_dynamo/convert_frame.py", "_convert_frame"),
Expand All @@ -54,7 +54,7 @@ fn maybe_remove_suffix(frames: &mut Vec<FrameSummary>) {
&& frame.name == target.1
})
{
frames.truncate(len - 3);
frames.truncate(len - target_frames.len());
}
}
}
Expand Down Expand Up @@ -313,7 +313,7 @@ pub fn parse_path(path: &PathBuf, config: ParseConfig) -> anyhow::Result<ParseOu

if let Some(m) = e.dynamo_start {
if let Some(mut stack) = m.stack {
maybe_remove_suffix(&mut stack);
maybe_remove_convert_frame_suffixes(&mut stack);
stack_index
.borrow_mut()
.insert(e.compile_id.clone(), stack.clone());
Expand Down

0 comments on commit 6401e99

Please sign in to comment.