Skip to content
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

GPU usage and console messages #685

Closed
JLDC opened this issue Nov 16, 2020 · 13 comments
Closed

GPU usage and console messages #685

JLDC opened this issue Nov 16, 2020 · 13 comments
Labels
almost closed other packages Integration with other Julia packages

Comments

@JLDC
Copy link

JLDC commented Nov 16, 2020

Hello,

when using GPU arrays in Pluto (e.g. such as for training Flux models). The console output gets spammed by messages which I do not really understand. These messages did not appear in previous versions (I cannot say with which version they started appearing however). These messages are not printed when running the code in the REPL.

I have attached my Pluto notebook as a .txt file for reproduction as well as a screenshot of the console output (these messages are repeated multiple times (as you can see from the scrolling bar size on the right).

Thanks for your time!

Capture

mnist-test.txt

@fonsp
Copy link
Owner

fonsp commented Nov 16, 2020

@c42f Is this because of our logger level?

@fonsp fonsp added the other packages Integration with other Julia packages label Nov 17, 2020
@c42f
Copy link
Contributor

c42f commented Nov 24, 2020

This doesn't look familiar to me. Perhaps the GPU package is writing to stdout?

@fonsp
Copy link
Owner

fonsp commented Nov 25, 2020

Right, this isn't a log 😅

@JLDC Thank you for bringing this up, but we need more information to be able to fix it. For example, you could run an old version of pluto (instructions) to narrow down the problem.

We changed some of the logging behaviour in Pluto 0.12.0, so you could test 0.11.14.

(It could also be caused by an update in another package.)

@JLDC
Copy link
Author

JLDC commented Nov 27, 2020

Don't mention it, I'm glad to help this amazing package! 👍

I don't think the package (Flux) prints to stdout, since the messages do not appear when running the code in the REPL but perhaps I do not understand this fully.

Running the same code with Pluto 0.11.14 does not produce the messages. The only difference between what I did above and what I did here is that I changed the version 0.11.14 of Pluto using the second method on the link you provided (package manager).

So, in short, it works as it should with 0.11.14. I have now also tried it with 0.12.12 and it has the same output as 0.12.10 (my first post was on 0.12.10).

0.11.14

image

0.12.12

image

@fonsp
Copy link
Owner

fonsp commented Nov 27, 2020

Can you use Pkg.status() check whether any other packages changed version? Changing Pluto's version could still change other packages. Can you share the notebook?

@fonsp
Copy link
Owner

fonsp commented Nov 27, 2020

Can you run this version of Pluto and check if the problem is still there?

https://github.com/fonsp/Pluto.jl/tree/debug-685-1

@JLDC
Copy link
Author

JLDC commented Nov 27, 2020

I just tried the debug-685-1 branch and the output messages from the GPU disappear 👍. Great!

Let me know if you need any other infos.

@fonsp
Copy link
Owner

fonsp commented Nov 27, 2020

It looks like CUDA.jl checks whether a Logger shows debug messages:

https://github.com/JuliaGPU/CUDA.jl/blob/c99ae6ffdd8ec6c668c98ee4053836bc4ebb1f5c/src/debug.jl#L11-L12

And if so, they enable verbose logging:

https://github.com/JuliaGPU/CUDA.jl/blob/a14344b609358df38f5af511e8c25102ca8d27e6/lib/cublas/CUBLAS.jl#L150-L156

Running this check inside current Pluto:

image

and the REPL:

image

@c42f Do you understand this first code snippet? Is there a way for us to still enable debug-level logging inside the notebook without triggering that check?

@fonsp
Copy link
Owner

fonsp commented Nov 27, 2020

I have created a PR that disables debug logging which fixes this issue, at the cost of losing debug log messages inside the notebook:

#723

Let's do this unless there is a more creative solution that still enables debug logging inside the notebook?

@c42f
Copy link
Contributor

c42f commented Jan 4, 2021

It looks like CUDA.jl checks whether a Logger shows debug messages

Yeah, seems like quite a hack — nobody is really supposed to call those CoreLogging functions... But it may be that the cublas logging API isn't really compatible with ours, leading to such hacks.

@fonsp
Copy link
Owner

fonsp commented Jan 5, 2021

@c42f Thanks for taking a look! What do you suggest I do next?

I have been working on the logging GUI recently and I think it will be really cool! @debug not working there might be a greater loss than verbose logging by CUDA.jl ?

@c42f
Copy link
Contributor

c42f commented Jan 8, 2021

Yeah, I think it's CUDA.jl which should be tweaked here — if there's a desire to enable debug logging directly from CUDA (which is incompatible with the Julia logging API), it should probably be controlled by a separate switch like an environment variable. Not by looking at the julia logger state.

@fonsp
Copy link
Owner

fonsp commented Jan 8, 2021

Okay! @JLDC feel free to continue the discussion on the CUDA.jl side

@fonsp fonsp closed this as completed Jan 8, 2021
pankgeorg pushed a commit that referenced this issue Jan 28, 2021
[Diff since v0.12.18](v0.12.18...v0.12.19)

**Closed issues:**
- GPU usage and console messages (#685)
- Feature Proposal: Exported HTML can be passed to a static site generator (#794)
- wait and resume execution on button press (#803)
- Latex code not appropriately displayed (#817)
- Python doesn't work in Pluto (#818)
- add pluto - pluto not found - Julia 1.5.3 macOS (#819)
- Cell output not shown correctly if in-line comment ends with semicolon (#820)
- _llvm (#821)
- Can't move cells (#822)
- Conditions on list comprehensions and execution order (#824)
- Electron app (#825)
- Errors when pressing Ctrl+C to stop Pluto (#827)
- Failed to load notebook error (#829)
- Popup docs don't work for some symbols (#832)
- Running a notebook deleted contents of `.julia/registries` (#834)
- Ctrl+C broken with `julia -e "Pluto.run()"` instead of the REPL (#836)
- Edit or remove default header and footer in exported static PDF (#837)
- Parameters.jl dynamically created macros confuse Pluto (#838)
- Feature request: Open URL from terminal (#840)
- Notebook gets stuck in forever loading state after restarting my PC while running it (#849)
- Syntax highlighting of @. (#854)
- File not found when file newly created while session is running (#855)
- Weird output from a mix of MathJax, Markdown and PlutoUI (#856)
- Misaligned plots when plotting with UnicodePlots.jl using BrailleCanvas (#870)

**Merged pull requests:**
- Pluto ux process file drop (#707) (@pankgeorg)
- Dralbase state managment (#710) (@dralletje)
- PLJ-785 CodeMirror Eject to TextArea - Reload from TextArea in Offline HTML export (#805) (@pankgeorg)
-  Dralbase state managment: Fix front-end tests (#809) (@pankgeorg)
- Update README.md (#814) (@fonsp)
- Regard `:=` in macros as einsum notation (take 2) (#816) (@mcabbott)
- 🧸 Open your own files as samples (#828) (@fonsp)
- Handle filters in generators, closes #824 (#839) (@Pangoraw)
- Update `== nothing` to `=== nothing` in Parse.jl (#841) (@heetbeet)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
almost closed other packages Integration with other Julia packages
Projects
None yet
Development

No branches or pull requests

3 participants