-
Notifications
You must be signed in to change notification settings - Fork 216
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
jupyter: the cpu indicator doesn't work and the cpu time usage is wrong for the default Python3 kernel (Sage kernel works fine) #5826
Comments
I just tried using a dev project on the left and a normal production project on the right, both with the Sage kernel. The production project works, but the dev project doesn't show any cpu usage, and the timing in the upper right is completely wrong, just like with the Python3 kernel: Anyway, I think this is really, really bad, and we either need to fix this ASAP, or hide all the functionality related to timing, so as not to provide incorrect and misleading info. |
Here's more motivation for making sure these functions work robustly: https://trac.sagemath.org/ticket/33637 (They are evidently pretty hard to properly implement in Sage...) |
…better code modularity); unfortunately, I can't really test this, since the backend code is evidently mostly broken (see #5826)
This is strange. I don't think this is primarily caused by how the process information is collected, it's something with the frontend or some back and forth state communication. I.e. why is it saying "kernel is idle" if it is clearly not? I bet if it is in the busy state, it would show the cpu progress. Interestingly, a slight variation does show cpu usage:
No, there is no heuristic. |
The kernel state information is sent by the kernel. The kernel is running in the same process as the computation, so maybe in some cases CPU bound computations totally block sending update messages about state? In any case, your observation about the relation with kernel state is useful hint as to what is going on. |
well, "worst case", this is actually an upstream issue? 🤷🏻 |
I don't see it that way. Where does the cpu and memory information come from? I think you implemented this and it has nothing to do with the Jupyter kernel spec, right? If the problem is that the kernel state says "idle" when doing cpu heavy computation for some kernels, and your code just ignores cpu usage when the state is idle, then the solution is to change your code to not ignore cpu usage when the state is idle. |
Look at this screenshot from a clean new session using the Python 3 kernel:
There are two major bugs.
NOTE: I have never noticed these bugs before because I always use Sage kernels for nontrivial computations. Both of the above are NOT issues with the Sage kernels; there the cpu indicator works fine, and the total time is also correct.
@haraldschilly I think you wrote the backend code that these rely on. Did you use a heuristic to try to find the process whose cpu/memory usage is watched, and somehow the current python3 kernel is not detected properly? Note that this is likely the most popular kernel people use, so this is a high priority bug. This is also easy to reproduce in a dev project.
For copy paste:
The text was updated successfully, but these errors were encountered: