Skip to content

logging: log hash alongside elapsed to help find divergent/non-deterministic results#3294

Merged
maliberty merged 1 commit into
The-OpenROAD-Project:masterfrom
Pinata-Consulting:log-odb-hashes
Jul 7, 2025
Merged

logging: log hash alongside elapsed to help find divergent/non-deterministic results#3294
maliberty merged 1 commit into
The-OpenROAD-Project:masterfrom
Pinata-Consulting:log-odb-hashes

Conversation

@oharboe
Copy link
Copy Markdown
Collaborator

@oharboe oharboe commented Jul 7, 2025

Example. A failed step could end up with log and no .odb file.

$ make elapsed
./logs/nangate45/gcd/base
Log                        Elapsed/s Peak Memory/MB  sha1sum .odb [0:20)
1_1_yosys                          0             43                  N/A
1_1_yosys_canonicalize             0             40                  N/A
2_1_floorplan                      0             98 50eac5062cd153c214bc
2_2_floorplan_macro                0             94 50eac5062cd153c214bc
2_3_floorplan_tapcell              0             94 ac3fe102c900185d2480
2_4_floorplan_pdn                  0             96 59b27705fdbd75c33f36
3_1_place_gp_skip_io               0             95 d6b4e2de32af97e51809
3_2_place_iop                      0             95 abe5f19e242458533155
3_3_place_gp                       1            211 1a7e366da16e932d2917
3_4_place_resized                  0            114 0171f43d6d2d17c772e9
3_5_place_dp                       0            100 79e4817b19df4b20222a
4_1_cts                            2            127 b342824a6e10d783e773
5_1_grt                            5            214 ba9e7089ccedd24d7e9f
5_2_route                         11           1215 f48628e592653b8c3c3f
5_3_fillcell                       0             97 f32e153bcd24ed0862d5
6_1_fill                           0             95 f32e153bcd24ed0862d5
6_1_merge                          1            376                  N/A
6_report                           1            250                  N/A
Total                             21           1215                     

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
@vvbandeira
Copy link
Copy Markdown
Member

If yosys fails to run, how come the rest of the flow can still run?

@oharboe oharboe changed the title logging: log hash alongside elapsed to help find divergent results logging: log hash alongside elapsed to help find divergent/non-deterministic results Jul 7, 2025
@oharboe
Copy link
Copy Markdown
Collaborator Author

oharboe commented Jul 7, 2025

If yosys fails to run, how come the rest of the flow can still run?

Yosys didn't fail, the .odb hash just is N/A (not applicable) to yosys.

@oharboe
Copy link
Copy Markdown
Collaborator Author

oharboe commented Jul 7, 2025

Also, locally, make elapsed can be run on after one build ran to completion and another failed, so the logs/results could contain successful builds up to, say, a failing floorplan stage and then successful logs/results after that. make elapsed just reports on the logs and hashes of .odb files without worrying about successful/failed builds.

@oharboe
Copy link
Copy Markdown
Collaborator Author

oharboe commented Jul 7, 2025

@vvbandeira Couldy you automerge? I need a docker image of this before I can try out The-OpenROAD-Project/OpenROAD#7722

@maliberty
Copy link
Copy Markdown
Member

For the yosys step you could hash to .v as it would serve the same purpose of isolating the source of a diff.

@oharboe
Copy link
Copy Markdown
Collaborator Author

oharboe commented Jul 7, 2025

For the yosys step you could hash to .v as it would serve the same purpose of isolating the source of a diff.

Well... yosys determinism is a bit fickle, so I'd like to lave that be for now. A refinement if it turns out ot be useful.

@oharboe
Copy link
Copy Markdown
Collaborator Author

oharboe commented Jul 7, 2025

Same for .gds, hash there doesn't make sense while it contains non-determinism like build dates and more.

@maliberty
Copy link
Copy Markdown
Member

yosys is deterministic afaik, its just very sensitive to input changes. For a fixed version and a fixed input you should get the same result consistently. The hash is only a debugging tool and it seems useful for that as much as it is for OR.

@oharboe
Copy link
Copy Markdown
Collaborator Author

oharboe commented Jul 7, 2025

yosys is deterministic afaik, its just very sensitive to input changes. For a fixed version and a fixed input you should get the same result consistently. The hash is only a debugging tool and it seems useful for that as much as it is for OR.

Agreed: a refinement beyond this PR.

@oharboe
Copy link
Copy Markdown
Collaborator Author

oharboe commented Jul 7, 2025

@maliberty I'll experiment with yosys after this is in master, I suspect I'll run into some snags. This covers 80-90% of the use-case. I'll have a quickly look at canonicalizing .gds to see if a hash is possible there.

@maliberty
Copy link
Copy Markdown
Member

gds is rarely a problem and is at the end of the flow so it is a lower priority for me.

@oharboe
Copy link
Copy Markdown
Collaborator Author

oharboe commented Jul 7, 2025

@maliberty I have the rest lined up, but can we merge this so I can have docker image tomorrow morning and continue my chase?

@maliberty maliberty enabled auto-merge July 7, 2025 16:59
@oharboe
Copy link
Copy Markdown
Collaborator Author

oharboe commented Jul 7, 2025

@maliberty Merge manually? There is an unrelated error/lockup here The-OpenROAD-Project/OpenROAD#7741

@maliberty maliberty disabled auto-merge July 7, 2025 18:49
@maliberty maliberty merged commit f2e9360 into The-OpenROAD-Project:master Jul 7, 2025
8 of 9 checks passed
@oharboe oharboe deleted the log-odb-hashes branch July 7, 2025 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants