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

CUDA code does not return when running under VSC Debugging mode #2558

Closed
JuanVargas opened this issue Nov 19, 2024 · 5 comments
Closed

CUDA code does not return when running under VSC Debugging mode #2558

JuanVargas opened this issue Nov 19, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@JuanVargas
Copy link

JuanVargas commented Nov 19, 2024

Ubuntu 24.04 LTS
VSC 1.95.3
Julia 1.11.1
CUDA 12.6

The code example given in the Flux documentation (NeuralNetInOneMinute) available at

https://fluxml.ai/Flux.jl/stable/guide/models/quickstart/

Works OK under VSC as long as the debugging option is NOT used.
If the debugging option is selected, the code never returns. The failure happens somewhere in this loop:


  # Training loop, using the whole data set 1000 times:
  losses = []

  # code in line below does not work under debugger
  #   @showprogress for epoch in 1:1_000
  # try this instead run the  for epoch in 1:1_000.
 # code never ends in VSC under debug mode. 
  for epoch in 1:1_000    
      for (x, y) in loader
          loss, grads = Flux.withgradient(model) do m
              # Evaluate model and loss inside gradient context:
              y_hat = m(x)
              Flux.logitcrossentropy(y_hat, y)
          end
          Flux.update!(optim, model, grads[1])
          push!(losses, loss)  # logging, outside gradient context
      end
  end
@JuanVargas JuanVargas added the bug Something isn't working label Nov 19, 2024
@maleadt
Copy link
Member

maleadt commented Nov 19, 2024

Looks like a VSCode Debugger issue then? Or why do you think CUDA.jl is to blame?

@JuanVargas
Copy link
Author

JuanVargas commented Nov 19, 2024 via email

@maleadt
Copy link
Member

maleadt commented Nov 19, 2024

Again, that doesn't point to CUDA.jl. If anything, this is likely just the overhead of interpretation of very compute-intensive code that has been written with compilation in mind. I suggest you open a discussion on Discourse, or file an issue on the VSCode Julia integration repository. Feel free to re-open or file a new issue when you have a CUDA.jl reproducer.

@maleadt maleadt closed this as not planned Won't fix, can't repro, duplicate, stale Nov 19, 2024
@JuanVargas
Copy link
Author

JuanVargas commented Nov 19, 2024 via email

@JuanVargas
Copy link
Author

JuanVargas commented Nov 19, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants