These are chat archives for halide/Halide

4th
May 2018
Kern Handa
@kernhanda
May 04 04:48
when using constant_exterior, does one have to do explicit scheduling for it? i haven't seen any in any of the examples, but just making sure
Zalman Stern
@zvookin
May 04 05:59
There is no implicit scheduling but usually it is inline in the thing one wants to schedule.
Kern Handa
@kernhanda
May 04 06:44
does it get automatically inlined?
i'm essentially using as the output function
Zalman Stern
@zvookin
May 04 06:45
An output is always compute_root. The default otherwise is inline. M
Kern Handa
@kernhanda
May 04 06:46
gotcha
Kern Handa
@kernhanda
May 04 07:27
is there any sort of known workaround for hitting stack overflows, short of increasing stack space? instead of continually appending to the same Expr instance, could i create sets of smaller Expr instances and combine those at the end?
also, do Func instances also use stack space or can i create interim Func objects?
Zalman Stern
@zvookin
May 04 07:32
You mean stack space at compile time or filter runtime?
Kern Handa
@kernhanda
May 04 07:32
compile time
Zalman Stern
@zvookin
May 04 07:32
Andrew’s simplifier PR is very promising.
Still shaking it out a bit but it should land soon.
Could try it and see if it helps.
Func boundaries do help in that not all optimization and bounds inference happens across them.
If they’re not inline that is.
Kern Handa
@kernhanda
May 04 07:42
but of course, if i'm trying to replace of set of Expr instances with Func instances, i'd probably want them to be inline
Andrew Adams
@abadams
May 04 15:19
compute_at the innermost loop is often equivalent to inline in terms of performance, but uses less stack space in the compiler
Shoaib Kamil
@shoaibkamil
May 04 17:22
Is there an example of using HalideTraceViz.cpp? I can't seem to find any
Ah, they're in tutorial/figures
Andrew Adams
@abadams
May 04 17:26
also local_laplacian, bilateral_grid, and camera_pipe apps
Dillon Sharlet
@dsharletg
May 04 17:35
I find that TailStrategy::RoundUp is what I want for splits on almost every internal pipeline stage
but it's hard to recommend it be the default because the odd rare split where that would significantly increase memory usage
Andrew Adams
@abadams
May 04 17:37
Yeah. I think the autoscheduler should have some smarts about using it
If you're in a loop nest that doesn't load from an input and the Func isn't an output, you can use roundup safely, but you need to model the memory implications.
Steven Johnson
@steven-johnson
May 04 18:03
@shoaibkamil re HalideTraceViz auto-layout mode is getting pretty decent (halide/Halide#2901) — there’s more refactoring I want to do on it (so I can integrate it into RunGen and Python) but I think it’s ready to review at this point. PTAL if you like :-)
(I actually have a simple viz-auto-only demo app locally that I need to push to the PR, I’ll get that done today)
Shoaib Kamil
@shoaibkamil
May 04 18:07
Thanks @steven-johnson, I'll take a look
Steven Johnson
@steven-johnson
May 04 19:18
@shoaibkamil just pushed apps/auto_viz
Shoaib Kamil
@shoaibkamil
May 04 19:40
Thanks! That looks really helpful (I was still struggling with command line args for HTV)
Shoaib Kamil
@shoaibkamil
May 04 20:12
Hmm, I get:
Undefined symbols for architecture x86_64:
  "llvm::createInlineSpiller(llvm::MachineFunctionPass&, llvm::MachineFunction&, llvm::VirtRegMap&)", referenced from:
      (anonymous namespace)::RAGreedy::runOnMachineFunction(llvm::MachineFunction&) in libHalide.a(llvm_882_RegAllocGreedy.cpp.o)
      (anonymous namespace)::RegAllocPBQP::runOnMachineFunction(llvm::MachineFunction&) in libHalide.a(llvm_988_RegAllocPBQP.cpp.o)
      (anonymous namespace)::RABasic::runOnMachineFunction(llvm::MachineFunction&) in libHalide.a(llvm_1014_RegAllocBasic.cpp.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [bin/auto_viz_demo.generator] Error 1
This is macOS with LLVM5
That seems to happen with other apps as well. Hm
Shoaib Kamil
@shoaibkamil
May 04 20:23
It looks like when I build Halide off your branch, I get this during the build:
IRPrinter test passed
CodeGen_C test passed
ir_equality_test passed
Bounds test passed
expr_match test passed
deinterleave_vector test passed
modulus_remainder test passed
common_subexpression_elimination test passed
Solve test passed
Target test passed
is_monotonic test passed
Split predicate test passed
Interval test passed
Associativity test passed
Generator test passed
Propagate estimate test passed

ar: LegalizeVectorOUndefined: not found in archive
usage: mv [-f | -i | -n] [-v] source target
       mv [-f | -i | -n] [-v] source ... directory
bash: line 1004: 1004n: command not found
bash: line 1005: 1005n: command not found
bash: line 1006: 1006n: command not found
bash: line 1007: 1007n: command not found
# Archive together all the halide and llvm object files
# ar breaks on MinGW with all objects at the same time.
Shoaib Kamil
@shoaibkamil
May 04 20:45
Cause seems to be merge of PR #2884
Andrew Adams
@abadams
May 04 21:09
What is the contents of your bin/build/llvm_objects/list.new ?
Something weird must be going to stderr
Steven Johnson
@steven-johnson
May 04 21:58
Yeah, I don’t get that at all, though to be fair I’m using llvm-trunk mostly
I’ll try with llvm56
5
Shoaib Kamil
@shoaibkamil
May 04 22:09
Check out #2940. The lines like llvm::sys::Process::FileDescriptorHasColors(int) in libLLVMSupport.a(Process.cpp.o) end up in the list.new file
And then screw up the rest of the command
Steven Johnson
@steven-johnson
May 04 22:09
I can’t repeat here — LLVM5 on OSX with xcode 9.3 works fine
Shoaib Kamil
@shoaibkamil
May 04 22:10
Is you LLVM hand-compiled or via homebrew?
Steven Johnson
@steven-johnson
May 04 22:10
hand-compiled
with curses nonsense disabled
Shoaib Kamil
@shoaibkamil
May 04 22:11
The curses nonsense is the issue
Andrew Adams
@abadams
May 04 22:11
llvm-config --system-libs is supposed to include -ltinfo if it was compiled that way
See the top of the makefile - I had a case on linux where it wasn't being included, so I added a hack to add it if necessary.
You may want to add equivalent Darwin logic to what I put there.
Shoaib Kamil
@shoaibkamil
May 04 22:14
Hm, mine does seem to include -lz -lcurses -lm
Andrew Adams
@abadams
May 04 22:14
it's -ltinfo that provides those symbols
Shoaib Kamil
@shoaibkamil
May 04 22:15
I have to run, but I'll try that out as soon as I'm back in front of a computer
You're referring to the part of the makefile that sets LLVM_LD_FLAGS?
Andrew Adams
@abadams
May 04 22:17
Yeah, the only part of the makefile that reference "-ltinfo"
Shoaib Kamil
@shoaibkamil
May 04 22:18
Got it. Thanks for the help
Will try it out