Skip to content

Commit

Permalink
remove -
Browse files Browse the repository at this point in the history
  • Loading branch information
xmfan committed Dec 6, 2024
1 parent fa967b6 commit f7b618d
Show file tree
Hide file tree
Showing 9 changed files with 1,411 additions and 1,388 deletions.
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ pub fn parse_path(path: &PathBuf, config: ParseConfig) -> anyhow::Result<ParseOu
.as_ref()
.map_or(format!("unknown_{lineno}"), |c| match c {
CompileId::UserInitiated(d) => {
format!("-_{}_{}_{}", d.frame_id, d.frame_compile_id, d.attempt)
format!("{}_{}_{}", d.frame_id, d.frame_compile_id, d.attempt)
}
CompileId::CompiledAutogradInitiated {
compiled_autograd_id,
Expand Down
2 changes: 1 addition & 1 deletion src/parsers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ fn simple_file_output(
.as_ref()
.map_or(format!("unknown_{lineno}"), |c| match c {
CompileId::UserInitiated(d) => {
format!("-_{}_{}_{}", d.frame_id, d.frame_compile_id, d.attempt)
format!("{}_{}_{}", d.frame_id, d.frame_compile_id, d.attempt)
}
CompileId::CompiledAutogradInitiated {
compiled_autograd_id,
Expand Down
2 changes: 1 addition & 1 deletion src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ impl fmt::Display for CompileId {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
CompileId::UserInitiated(d) => {
write!(f, "[-/{}]", _format_dynamo_id(d))
write!(f, "[{}]", _format_dynamo_id(d))
}
CompileId::CompiledAutogradInitiated {
compiled_autograd_id,
Expand Down
1,844 changes: 922 additions & 922 deletions tests/inputs/cache_hit_miss.log

Large diffs are not rendered by default.

114 changes: 57 additions & 57 deletions tests/inputs/chromium_events.log

Large diffs are not rendered by default.

72 changes: 36 additions & 36 deletions tests/inputs/comp_failure.log

Large diffs are not rendered by default.

260 changes: 130 additions & 130 deletions tests/inputs/comp_metrics.log

Large diffs are not rendered by default.

468 changes: 246 additions & 222 deletions tests/inputs/simple.log

Large diffs are not rendered by default.

35 changes: 17 additions & 18 deletions tests/integration_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@ fn prefix_exists(map: &HashMap<PathBuf, String>, prefix: &str) -> bool {
#[test]
fn test_parse_simple() {
let expected_files = [
"-_0_0_0/aot_forward_graph",
"-_0_0_0/dynamo_output_graph",
"0_0_0/aot_forward_graph",
"0_0_0/dynamo_output_graph",
"index.html",
"failures_and_restarts.html",
"-_0_0_0/inductor_post_grad_graph",
"-_0_0_0/inductor_output_code",
"-_0_0_0/dynamo_guards",
"0_0_0/inductor_post_grad_graph",
"0_0_0/inductor_output_code",
];
// Read the test file
// simple.log was generated from the following:
Expand All @@ -43,12 +42,12 @@ fn test_parse_simple() {
#[test]
fn test_parse_compilation_metrics() {
let expected_files = [
"-_0_0_1/dynamo_output_graph",
"-_0_0_1/compilation_metrics",
"-_1_0_1/dynamo_output_graph",
"-_1_0_1/compilation_metrics",
"-_2_0_0/dynamo_output_graph",
"-_2_0_0/compilation_metrics",
"0_0_1/dynamo_output_graph",
"0_0_1/compilation_metrics",
"1_0_1/dynamo_output_graph",
"1_0_1/compilation_metrics",
"2_0_0/dynamo_output_graph",
"2_0_0/compilation_metrics",
"index.html",
"failures_and_restarts.html",
];
Expand Down Expand Up @@ -76,8 +75,8 @@ fn test_parse_compilation_metrics() {
#[test]
fn test_parse_compilation_failures() {
let expected_files = [
"-_0_0_0/dynamo_output_graph",
"-_0_0_0/compilation_metrics",
"0_0_0/dynamo_output_graph",
"0_0_0/compilation_metrics",
"index.html",
"failures_and_restarts.html",
];
Expand All @@ -104,10 +103,10 @@ fn test_parse_compilation_failures() {

#[test]
fn test_parse_artifact() {
let expected_files = ["-_0_0_0/fx_graph_cache_hash", "index.html"];
let expected_files = ["0_0_0/fx_graph_cache_hash", "index.html"];
// Read the test file
// artifacts.log was generated from the following:
// NOTE: test output looks nothing like artifacts.log
// NOTE: this test command looks wrong, and is not producing anything close to artifacts.log
// TORCH_TRACE=~/trace_logs/test python test/inductor/test_torchinductor.py -k TORCH_TRACE=~/trace_logs/comp_metrics python test/dynamo/test_misc.py -k test_graph_break_compilation_metrics_on_failure
let path = Path::new("tests/inputs/artifacts.log").to_path_buf();
let config = tlparse::ParseConfig {
Expand Down Expand Up @@ -154,9 +153,9 @@ fn test_parse_chromium_event() {
#[test]
fn test_cache_hit_miss() {
let expected_files = [
"-_1_0_0/fx_graph_cache_miss_33.json",
"-_1_0_0/fx_graph_cache_miss_9.json",
"-_1_0_0/fx_graph_cache_hit_20.json",
"1_0_0/fx_graph_cache_miss_33.json",
"1_0_0/fx_graph_cache_miss_9.json",
"1_0_0/fx_graph_cache_hit_20.json",
"index.html",
];
// Generated via TORCH_TRACE=~/trace_logs/test python test/inductor/test_codecache.py -k test_flex_attention_caching
Expand Down

0 comments on commit f7b618d

Please sign in to comment.