-
Notifications
You must be signed in to change notification settings - Fork 36
Several examples tests failing #96
Comments
I'm looking into the failing jobs, and it seems that there are a few issues but nothing that strikes me as an obvious cause:
The errors in the notebook are familiar issues that we thought had been solved:
|
One other possibility is that something changed in
Since there's only three of them and they have been squash-merged, it should be possible to run the CI jobs in this repo after checking out each commit in parallel. I'll try to open a PR with these changes and see if that's enough to pinpoint a single breaking commit. |
I can't see how PR 708 would be the cause. It is possible that 704 caused some unexpected change, but even that should have been transparent to the examples. |
@andrewlee94 I agree, I don't have a clue on what it could be. The remaining one, #707, could in principle result in changes to the Jupyter notebook infrastructure, but (a) it only applies to Windows (while failing jobs occur on both Linux and Windows), and (b) even then, I don't see how it could be related to the initialization error. Let's see if the brute force debugging in #97 can shed some light on this. |
708 should technically not have changed anything, but it changed the way an expression was written. If a problem is that delicate, it was borderline broken already. I don't really understand how the examples tests work. Don't they run on the idase-pse PRs? |
@eslickj Do you mean IDAES/idaes-pse#704? IDAES/idaes-pse#708 only changed test files, so that wouldn't have any influence on this repo. As part of the extended/integration CI checks, a subset of the examples are run. This is defined within the More specifically, the reason why the two "problem child" examples If you look at https://github.com/IDAES/examples-pse/actions/runs/1845041970 (where the Git commit hashes are the 4 latest commits on |
@lbianchi-lbl @eslickj Well, in some ways it does not surprise me that that commit is what broke everything, even though it really should not. As John said: " If a problem is that delicate, it was borderline broken already". We really need someone to get in there and fix those up properly - I am fairly certain they do not use the scaling tools. I think someone was already working on one of them from a previous round of them failing. |
@andrewlee94 From a quick search, the latest issues about these notebooks are #81 for |
Ah, #89 was the one I was thinking of and it was related to a different model (the HDA case study). Hopefully the same approach that was applied there can fix these issues (once and for all). |
@andrewlee94 ah, I see, I mistakenly thought that #89 was about If I understand correctly what you're saying, this is (or could be) good news, since it means that the fix for |
@lbianchi-lbl I hope so at least - my most likely guess for the cause of failure here is poor scaling, which is the same problem the HDA Flowsheet had. |
@lbianchi-lbl, the change in 708 was this... Originally we had a function that was root(eos_type, A, B). That found a real root of a cubic equation. 708 results in the same thing but looks like this root(b(eos_type, A, B), c(eos_type, A, B), d(eos_type, A, B)) where b, c, d are just Pyomo expressions. The resulting expression should be functionally the same. I just moved a piece of the calculation from the external function back into Pyomo expressions. I'm really struggling to understand how it would break anything, but I guess it points to extreme delicateness of the models. So it's more than just test changes. I just can't really see how it could affect anything. Everything about the new version should be the same, but it's not written exactly the same. |
@lbianchi-lbl Scaling helped improve #81 but regenerating the initialization files greatly reduced the runtime and ultimately resolved the issue. The main obstacle is that it takes about an hour to regenerate the initialization file, so it is difficult to build a check into the CI client that wouldn't potentially regenerate the file many times on multiple PRs that time out. In response to @eslickj , small solver or calculation changes could dramatically impact the quality of the initialization point - in #81 solving with IPOPT 3.12 using an initialization point trained using IPOPT 3.12 more than doubled the expected runtime; adding scaling reduced the notebook runtime from 650 to 550 CPU seconds, and then regenerating the initialization file using IPOPT 3.13 further reduced this to 30 CPU seconds. |
@eslickj @bpaul4 I see, thanks for the clarifications. I'm wondering, how often do the initialization files need to be regenerated to provide this kind of runtime improvements? Or, in other words, what type of changes (e.g. to the model itself, IPOPT version, ...) require an initialization file to be regenerated? If regenerating the initialization files before each run is not necessary, we could think of some way of generating them separately from the PR runs (e.g. on schedule, weekly or as needed), and either commit them to the repository or fetch them before the notebook is run during the PR runs. |
The initialization files really need to be regenerated anytime anything changes. I know that doesn't really nail it down very well. Especially for ill-conditioned problems the solution may be sensitive to very small changes. A change could be as small as a new version some library like blas or lapack. A solver version or build change could do it. I'd hope that that sort of change would be too small to cause any issues, but sometimes it is a problem. The more obvious changes would be if the IDAES model structure changes so that a variable changes name or something. In that case most of the model would load, but not the variable with the changed name. The nice thing about loading an initialization that's done is that it saves time. The problem is that it's easy for things to go wrong if anything changes. It doesn't help that we seem to have some models that are very sensitive to minor changes. |
Hmm, I see. I mean, one fairly straightforward way to solve this would be to regenerate the initialization files daily, e.g. before the nightly checks, save the files as a workflow run artifact with GitHub Actions, and fetch that version when running the examples. As I understand, users can always recreate the initialization files by themselves (it just takes a while to run) if the daily built files are not available for whatever reason, so this would not risk making the examples significantly less usable outside of the CI context. |
In regards to regenerating the JSON initialization files, we should add functionality to the load from JSON function that will check that all variables were initialized that we can then use in our notebook testing to identify these issues. That however is a separate issue for now - our immediate concern is to get the notebooks fixed for the release. |
I pulled the latest IDAES:main and EXAMPLES-PSE:main to my local Windows machine (Python 3.7) and In addition to bad scaling in the AS notebook, I'm wondering if the value change commit in #83 is contributing to this behavior. The AS notebook does not currently serialize the initialization point, so I will just add scaling for now and see if this helps. Update: Removing
|
The HC notebook with scaling factors changed to
|
The HC notebook is having difficulty re-initializing the Flash unit, and fails in restoration while solving the outlet control volume properties. I updated the scaling on both the AS and HC notebooks and pushed them to the PR referenced above to test the CI jobs, keeping the old HC init file for now since the notebook fails to generate a new one. |
@bpaul4 thanks a lot for looking into that. I'm aware I'm not much use when dealing with this type of domain-specific issues, but let me know if there's anything I can do to help on the software/CI side of things. |
Closing this ,as no-one can remember what he actual issue was. |
There are some examples test failing. I'm having a hard time sorting out what's failing and how, but I suspect it may have something to do with the doc reorg or updating the Pyomo version. Not sure who to assign this too, so we can try to update that later.
From doc build:
The text was updated successfully, but these errors were encountered: