Open karimn opened 1 year ago
That's because the AD engine Flux uses by default, Zygote, uses generated functions extensively. This warning is new to me though, because I've successfully used the same debugger on Zygote code before. You may want to investigate this further with the Julia VS Code extension folks.
Thank you for the quick response. Ok, I'll reach out the VS Code extension folks. Is there an alternative debugger that you use for debugging Flux code?
Kind of, but my workflow is neither typical nor particularly straightforward :sweat_smile:.
For model-level debugging I typically stay away from line-by-line debuggers like the VSCode one because they can deoptimize tight loops and make getting to your breakpoint take too long. There are ways around this such as enabling compiled mode for certain modules, but it's a little finicky to do when developing these packages. https://github.com/JuliaDebug/Infiltrator.jl is a great tool if you can make do without line-by-line stepping, maybe have a look at that.
For debugging code which uses Zygote, I occasionally use https://github.com/JuliaDebug/Debugger.jl, which is also what the VSCode extension uses under the hood. The reason I don't use VSCode directly is because I need to enable a setting (IR view) to step into generated functions. I would not recommend trying this unless you're comfortable reading Julia AST and IR.
The below code runs fine but when I run it under the VS Code debugger I get an ErrorException: Method is @generated; try 'code_lowered' instead.
I'm using Julia v1.8.5.