-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Print the egglog program before the last schedule for multi-pass schedule in --run-mode egglog
#675
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some suggested improvments
dag_in_context/src/lib.rs
Outdated
pub stop_after_n_passes: usize, | ||
/// Stop after this many passes. | ||
/// If stop_after_n_passes is negative, | ||
/// run [0 ... schedule.len() + stop_after_n_passes + 1] passes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems weird... I would expect -1
to run all but the last pass, but it looks like it runs all of them.
Perhaps you should make it i64::MAX by default and use [0 .. scheduler.len() + stop_after_n_passes ]
in the neg case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated the code to reflect this, although it is a little less elegant now to handle the pass before i64::MAX
@@ -173,8 +173,6 @@ pub fn parallel_schedule() -> Vec<CompilerPass> { | |||
)), | |||
CompilerPass::InlineWithSchedule(format!( | |||
" | |||
;; HACK: when INLINE appears in this string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch
src/util.rs
Outdated
.map_err(EggCCError::EggLog)?; | ||
|
||
let schedules = parallel_schedule(); | ||
let last_schedule_step = schedules.last().unwrap(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're still using the wrong pass here- didn't you want the stop_after_n_passes pass?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch, fixed!
.eggcc_config | ||
.get_normalized_cutoff(parallel_schedule().len()); | ||
assert!(cutoff != 0); | ||
let cutoff = cutoff - 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you subtracting 1 here? Shouldn't you pass it to the config as-is?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
say there are N passes and the user passes stop-after-n-passes=N
(the default value). This will run 0..(N-1) passes, and use the last schedule, which is at position N-1
. Maybe I miss something here?
Follow up of #670