From eec75a5df900b500fc706c6a788f88571f84b039 Mon Sep 17 00:00:00 2001 From: "Edward Z. Yang" Date: Tue, 30 Apr 2024 17:00:40 -0400 Subject: [PATCH] Update [ghstack-poisoned] --- src/lib.rs | 1 + src/templates.rs | 30 +++++++++++++++++++++++++++++- src/types.rs | 21 ++++++++------------- tests/inputs/simple.log | 2 ++ 4 files changed, 40 insertions(+), 14 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 89733ba..5b36257 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -310,6 +310,7 @@ pub fn parse_path(path: &PathBuf, config: ParseConfig) -> anyhow::Result +

Stack trie

diff --git a/src/types.rs b/src/types.rs index 279e3ec..fad0c97 100644 --- a/src/types.rs +++ b/src/types.rs @@ -45,23 +45,15 @@ impl StackTrieNode { // If the node has multiple children, increase the indent and print a hyphen writeln!( f, - "{:indent$}- {star}{}", - "", + "
  • {star}{}
      ", frame, - indent = indent, star = star )?; node.fmt_inner(f, indent + 2)?; + write!(f, "
  • ")?; } else { // If the node has only one child, don't increase the indent and don't print a hyphen - writeln!( - f, - "{:indent$} {star}{}", - "", - frame, - indent = indent, - star = star - )?; + writeln!(f, "
  • {star}{}
  • ", frame, star = star)?; node.fmt_inner(f, indent)?; } } @@ -71,9 +63,11 @@ impl StackTrieNode { impl Display for StackTrieNode { fn fmt(&self, f: &mut Formatter) -> fmt::Result { - write!(f, "
    ")?;
    +        write!(f, "
    ")?; + write!(f, "
      ")?; self.fmt_inner(f, 0)?; - write!(f, "
    ")?; + write!(f, "")?; + write!(f, "
    ")?; Ok(()) } } @@ -330,6 +324,7 @@ pub struct DynamoGuardsContext { #[derive(Debug, Serialize)] pub struct IndexContext { pub css: &'static str, + pub javascript: &'static str, pub directory: Vec<(String, Vec<(PathBuf, i32)>)>, pub stack_trie_html: String, pub unknown_stack_trie_html: String, diff --git a/tests/inputs/simple.log b/tests/inputs/simple.log index ce923d4..dec360b 100644 --- a/tests/inputs/simple.log +++ b/tests/inputs/simple.log @@ -254,3 +254,5 @@ V0401 08:54:22.980000 140424060892160 torch/_dynamo/guards.py:1194] {"dynamo_gua {"code": "___check_current_backend(140423721840560)", "stack": [{"line": 10031, "name": "", "filename": 0}, {"line": 14, "name": "run_tests", "filename": 1}, {"line": 41, "name": "run_tests", "filename": 2}, {"line": 1165, "name": "run_tests", "filename": 3}, {"line": 101, "name": "__init__", "filename": 4}, {"line": 271, "name": "runTests", "filename": 4}, {"line": 184, "name": "run", "filename": 5}, {"line": 84, "name": "__call__", "filename": 6}, {"line": 122, "name": "run", "filename": 6}, {"line": 84, "name": "__call__", "filename": 6}, {"line": 122, "name": "run", "filename": 6}, {"line": 650, "name": "__call__", "filename": 7}, {"line": 2866, "name": "run", "filename": 3}, {"line": 2838, "name": "_run_custom", "filename": 3}, {"line": 591, "name": "run", "filename": 7}, {"line": 549, "name": "_callTestMethod", "filename": 7}, {"line": 2739, "name": "wrapper", "filename": 3}, {"line": 9214, "name": "new_test", "filename": 0}, {"line": 79, "name": "inner", "filename": 8}, {"line": 8845, "name": "test_custom_op_fixed_layout_channels_last", "filename": 0}, {"line": 1527, "name": "_wrapped_call_impl", "filename": 9}, {"line": 1536, "name": "_call_impl", "filename": 9}, {"line": 450, "name": "_fn", "filename": 10}, {"line": 1527, "name": "_wrapped_call_impl", "filename": 9}, {"line": 1536, "name": "_call_impl", "filename": 9}, {"line": 939, "name": "catch_errors", "filename": 11}, {"line": 802, "name": "_convert_frame", "filename": 11}, {"line": 400, "name": "_convert_frame_assert", "filename": 11}, {"line": 79, "name": "inner", "filename": 8}, {"line": 686, "name": "_compile", "filename": 11}, {"line": 262, "name": "time_wrapper", "filename": 12}, {"line": 541, "name": "compile_inner", "filename": 11}, {"line": 1036, "name": "transform_code_object", "filename": 13}, {"line": 165, "name": "_fn", "filename": 11}, {"line": 485, "name": "transform", "filename": 11}, {"line": 2105, "name": "__init__", "filename": 14}, {"line": 344, "name": "__init__", "filename": 15}, {"line": 473, "name": "init_ambient_guards", "filename": 15}], "user_stack": null}, {"code": "check_tensor(L['x'], Tensor, DispatchKeySet(CUDA, BackendSelect, ADInplaceOrView, AutogradCUDA), torch.float32, device=0, requires_grad=False, size=[1, 320, 128, 128], stride=[5242880, 1, 40960, 320])", "stack": null, "user_stack": null} ] +V0401 08:54:21.882000 140424060892160 torch/_dynamo/convert_frame.py:672] {"dynamo_start": {"stack": [{"line": 10031, "name": "", "filename": 0}, {"line": 14, "name": "run_tests", "filename": 1}, {"line": 41, "name": "run_tests", "filename": 2}, {"line": 1165, "name": "run_tests", "filename": 3}, {"line": 101, "name": "__init__", "filename": 4}, {"line": 271, "name": "runTests", "filename": 4}, {"line": 184, "name": "run", "filename": 5}, {"line": 84, "name": "__call__", "filename": 6}, {"line": 122, "name": "run", "filename": 6}, {"line": 84, "name": "__call__", "filename": 6}, {"line": 122, "name": "run", "filename": 6}, {"line": 650, "name": "__call__", "filename": 7}, {"line": 2866, "name": "run2", "filename": 3}, {"line": 2838, "name": "_run_custom", "filename": 3}, {"line": 591, "name": "run", "filename": 7}, {"line": 549, "name": "_callTestMethod", "filename": 7}, {"line": 2739, "name": "wrapper", "filename": 3}, {"line": 9214, "name": "new_test", "filename": 0}, {"line": 79, "name": "inner", "filename": 8}, {"line": 8845, "name": "test_custom_op_fixed_layout_channels_last", "filename": 0}, {"line": 1527, "name": "_wrapped_call_impl", "filename": 9}, {"line": 1536, "name": "_call_impl", "filename": 9}, {"line": 450, "name": "_fn", "filename": 10}, {"line": 1527, "name": "_wrapped_call_impl", "filename": 9}, {"line": 1536, "name": "_call_impl", "filename": 9}]}, "frame_id": 0, "frame_compile_id": 0, "attempt": 0} +V0401 08:54:21.882000 140424060892160 torch/_dynamo/convert_frame.py:672] {"dynamo_start": {"stack": [{"line": 10031, "name": "", "filename": 0}, {"line": 14, "name": "run_tests", "filename": 1}, {"line": 41, "name": "run_tests", "filename": 2}, {"line": 1165, "name": "run_tests", "filename": 3}, {"line": 101, "name": "__init__", "filename": 4}, {"line": 271, "name": "runTests", "filename": 4}, {"line": 184, "name": "run", "filename": 5}, {"line": 84, "name": "__call__", "filename": 6}, {"line": 122, "name": "run", "filename": 6}, {"line": 84, "name": "__call__", "filename": 6}, {"line": 122, "name": "run", "filename": 6}, {"line": 650, "name": "__call__", "filename": 7}, {"line": 2866, "name": "run2", "filename": 3}, {"line": 2838, "name": "_run_custom", "filename": 3}, {"line": 591, "name": "run", "filename": 7}, {"line": 549, "name": "_callTestMethod", "filename": 7}, {"line": 2739, "name": "wrapper", "filename": 3}, {"line": 9214, "name": "new_test", "filename": 0}, {"line": 79, "name": "inner", "filename": 8}, {"line": 8845, "name": "test_custom_op_fixed_layout_channels_last", "filename": 0}, {"line": 1527, "name": "_wrapped_call_impl", "filename": 9}, {"line": 1536, "name": "_call_impl", "filename": 9}, {"line": 450, "name": "_fn", "filename": 10}, {"line": 1527, "name": "_wrapped_call_implaa", "filename": 9}, {"line": 1536, "name": "_call_impl", "filename": 9}]}, "frame_id": 0, "frame_compile_id": 0, "attempt": 0}