timholy / SnoopCompile.jl

Provide insights about latency (TTFX) for Julia packages
https://timholy.github.io/SnoopCompile.jl/dev/
Other
309 stars 48 forks source link

Gensym-ed function bears bad name `UndefVarError: _ not defined` #73

Closed IanButterworth closed 4 years ago

IanButterworth commented 4 years ago

I get the following error in the SnoopCompile bot, that I don't see in normal use of the package or CI tests

m = #_#28(detectThresh, overlapThresh, yolo::ObjectDetector.YOLO.yolo, img::DenseArray) in ObjectDetector.YOLO at /home/runner/work/ObjectDetector.jl/ObjectDetector.jl/src/yolo/yolo.jl:542
m.name = Symbol("#_#28")
ERROR: LoadError: UndefVarError: _ not defined

Here's the run: https://github.com/r3tex/ObjectDetector.jl/pull/32/checks?check_run_id=486306736#step:6:64

It happens on the execution of the last line of the snoopCompile.jl file https://github.com/r3tex/ObjectDetector.jl/blob/3423c11b130f2d6a4248af23daf952f8917d6416/deps/SnoopCompile/snoopCompile.jl

Could it be related to the way the function it's calling is defined? https://github.com/r3tex/ObjectDetector.jl/blob/3423c11b130f2d6a4248af23daf952f8917d6416/src/yolo/yolo.jl#L541

IanButterworth commented 4 years ago

I've not been able to figure this out. Any pointers appreciated

aminya commented 4 years ago

You can blacklist the function and test if it is solved:

Edited - this was the case if the error was happening during the Benchmark/Test ```julia @snoopi_bot BotConfig("ObjectDetector", blacklist = ["yolo"]) begin using ObjectDetector yolomod = YOLO.YOLO.v3_320_COCO() batch = emptybatch(yolomod) yolomod(batch) end ``` The syntax of that function is strange and complex. use whatever string that you think is better instead of `yolo`

Take out the function from the test script and see if it solves the problem. Your function is written in a non-conventional way, and the macro has some issues with it. What m.name is supposed to be?

IanButterworth commented 4 years ago

Thanks for the tips. I ended up taking function out of the test script, as you recommended and it's now merged in ObjectDetector