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

Backport build and stability changes to v13 #6533

Merged
merged 15 commits into from
Jan 6, 2022
Merged

Commits on Jan 4, 2022

  1. Try to fix riscv64 build (#6503)

    https://buildd.debian.org/status/fetch.php?pkg=halide&arch=riscv64&ver=13.0.2-1&stamp=1639833165&raw=0
    
    ```
    [1283/3260] /usr/bin/clang++-13 -DHALIDE_ENABLE_RTTI -DHALIDE_WITH_EXCEPTIONS -DHalide_EXPORTS -DLLVM_VERSION=130 -DWITH_AARCH64 -DWITH_AMDGPU -DWITH_ARM -DWITH_D3D12 -DWITH_HEXAGON -DWITH_INTROSPECTION -DWITH_METAL -DWITH_MIPS -DWITH_NVPTX -DWITH_OPENCL -DWITH_OPENGLCOMPUTE -DWITH_POWERPC -DWITH_RISCV -DWITH_WEBASSEMBLY -DWITH_X86 -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/usr/lib/llvm-13/include -g -O3 -DNDEBUG -fPIC -Wall -Wcast-qual -Wignored-qualifiers -Woverloaded-virtual -Winconsistent-missing-destructor-override -Winconsistent-missing-override -Wno-deprecated-declarations -Wno-double-promotion -Wno-float-conversion -Wno-float-equal -Wno-missing-field-initializers -Wno-old-style-cast -Wno-shadow -Wno-sign-conversion -Wno-switch-enum -Wno-undef -Wno-unused-function -Wno-unused-macros -Wno-unused-parameter -Wno-c++98-compat-pedantic -Wno-c++98-compat -Wno-cast-align -Wno-comma -Wno-covered-switch-default -Wno-documentation-unknown-command -Wno-documentation -Wno-exit-time-destructors -Wno-global-constructors -Wno-implicit-float-conversion -Wno-implicit-int-conversion -Wno-implicit-int-float-conversion -Wno-missing-prototypes -Wno-nonportable-system-include-path -Wno-reserved-id-macro -Wno-return-std-move-in-c++11 -Wno-shadow-field-in-constructor -Wno-shadow-field -Wno-shorten-64-to-32 -Wno-undefined-func-template -Wno-unused-member-function -Wno-unused-template -pthread -std=c++17 -MD -MT src/CMakeFiles/Halide.dir/Target.cpp.o -MF src/CMakeFiles/Halide.dir/Target.cpp.o.d -o src/CMakeFiles/Halide.dir/Target.cpp.o -c /<<PKGBUILDDIR>>/src/Target.cpp
    FAILED: src/CMakeFiles/Halide.dir/Target.cpp.o
    /usr/bin/clang++-13 -DHALIDE_ENABLE_RTTI -DHALIDE_WITH_EXCEPTIONS -DHalide_EXPORTS -DLLVM_VERSION=130 -DWITH_AARCH64 -DWITH_AMDGPU -DWITH_ARM -DWITH_D3D12 -DWITH_HEXAGON -DWITH_INTROSPECTION -DWITH_METAL -DWITH_MIPS -DWITH_NVPTX -DWITH_OPENCL -DWITH_OPENGLCOMPUTE -DWITH_POWERPC -DWITH_RISCV -DWITH_WEBASSEMBLY -DWITH_X86 -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/usr/lib/llvm-13/include -g -O3 -DNDEBUG -fPIC -Wall -Wcast-qual -Wignored-qualifiers -Woverloaded-virtual -Winconsistent-missing-destructor-override -Winconsistent-missing-override -Wno-deprecated-declarations -Wno-double-promotion -Wno-float-conversion -Wno-float-equal -Wno-missing-field-initializers -Wno-old-style-cast -Wno-shadow -Wno-sign-conversion -Wno-switch-enum -Wno-undef -Wno-unused-function -Wno-unused-macros -Wno-unused-parameter -Wno-c++98-compat-pedantic -Wno-c++98-compat -Wno-cast-align -Wno-comma -Wno-covered-switch-default -Wno-documentation-unknown-command -Wno-documentation -Wno-exit-time-destructors -Wno-global-constructors -Wno-implicit-float-conversion -Wno-implicit-int-conversion -Wno-implicit-int-float-conversion -Wno-missing-prototypes -Wno-nonportable-system-include-path -Wno-reserved-id-macro -Wno-return-std-move-in-c++11 -Wno-shadow-field-in-constructor -Wno-shadow-field -Wno-shorten-64-to-32 -Wno-undefined-func-template -Wno-unused-member-function -Wno-unused-template -pthread -std=c++17 -MD -MT src/CMakeFiles/Halide.dir/Target.cpp.o -MF src/CMakeFiles/Halide.dir/Target.cpp.o.d -o src/CMakeFiles/Halide.dir/Target.cpp.o -c /<<PKGBUILDDIR>>/src/Target.cpp
    warning: unknown warning option '-Wno-return-std-move-in-c++11' [-Wunknown-warning-option]
    /<<PKGBUILDDIR>>/src/Target.cpp:114:5: error: use of undeclared identifier 'cpuid'
        cpuid(info, 1, 0);
        ^
    /<<PKGBUILDDIR>>/src/Target.cpp:148:9: error: use of undeclared identifier 'cpuid'
            cpuid(info2, 7, 0);
            ^
    /<<PKGBUILDDIR>>/src/Target.cpp:181:17: error: use of undeclared identifier 'cpuid'
                    cpuid(info3, 7, 1);
                    ^
    1 warning and 3 errors generated.
    ```
    ... which doesn't make sense because that code is supposed to only compile
    for X86. But that is because RISCV header guard is wrong,
    https://github.com/riscv-non-isa/riscv-toolchain-conventions
    says:
    ```
    C/C++ preprocessor definitions
    * __riscv: defined for any RISC-V target. Older versions of the GCC toolchain defined __riscv__.
    ```
    
    (cherry picked from commit b0f4681)
    LebedevRI authored and alexreinking committed Jan 4, 2022
    Configuration menu
    Copy the full SHA
    c3e8c52 View commit details
    Browse the repository at this point in the history

Commits on Jan 5, 2022

  1. Specify template parameter of ScopedValue (#6352)

    (cherry picked from commit 334e27a)
    vksnk authored and alexreinking committed Jan 5, 2022
    Configuration menu
    Copy the full SHA
    bb3ef5e View commit details
    Browse the repository at this point in the history
  2. Fix a missing case in clamp_unsafe_accesses (#6508)

    * Fix a missing case in clamp_unsafe_accesses
    
    * Don't check func_value_bounds of images
    
    (cherry picked from commit e7f655b)
    abadams authored and alexreinking committed Jan 5, 2022
    Configuration menu
    Copy the full SHA
    4eb3d6f View commit details
    Browse the repository at this point in the history
  3. Mullapudi2016: don't hardcode the list of supported targets (#6520)

    As discussed in #6518,
    this is a bit dubious, and e.g. prevents building on RISC-V,
    because there is no way to not build autoschedulers currently.
    
    (cherry picked from commit 6ed65ba)
    LebedevRI authored and alexreinking committed Jan 5, 2022
    Configuration menu
    Copy the full SHA
    7568454 View commit details
    Browse the repository at this point in the history
  4. Fix weird CMake issue with custom LLVM (#6519)

    Without this, cmake fails with:
    ```
    CMake Error in dependencies/llvm/CMakeLists.txt:
      Target "Halide_LLVM" INTERFACE_INCLUDE_DIRECTORIES property contains path:
    
        "/repositories/halide/dependencies/llvm/"
    
      which is prefixed in the source directory.
    ```
    
    `LLVM_INCLUDE_DIRS` there is `/repositories/llvm-project/llvm/include;/builddirs/llvm-project/build-Clang13/include`,
    and `INTERFACE_INCLUDE_DIRECTORIES`'s property beforehand is `` (empty),
    but after this line it suddenly becomes `/repositories/halide/dependencies/llvm/$<BUILD_INTERFACE:/repositories/llvm-project/llvm/include;/builddirs/llvm-project/build-Clang13/include>`.
    
    This is quite obscure. I don't really understand what is going on,
    but with the patch it builds fine.
    
    (cherry picked from commit 9a530b1)
    LebedevRI authored and alexreinking committed Jan 5, 2022
    Configuration menu
    Copy the full SHA
    a1aa28a View commit details
    Browse the repository at this point in the history
  5. Fix use-after-free bug in SlidingWindow.cpp (#6527)

    (cherry picked from commit f9ea2d4)
    steven-johnson authored and alexreinking committed Jan 5, 2022
    Configuration menu
    Copy the full SHA
    384fc8d View commit details
    Browse the repository at this point in the history
  6. free shape storage last (#6511)

    Some decref-triggered runtime methods need the shape
    
    Fixes #6509
    
    Co-authored-by: Steven Johnson <srj@google.com>
    (cherry picked from commit 5c33902)
    abadams authored and alexreinking committed Jan 5, 2022
    Configuration menu
    Copy the full SHA
    27ac49b View commit details
    Browse the repository at this point in the history
  7. [NFC-ish] Finish MSAN handling (#6516)

    Somehow, initially i missed that there was MSan support,
    so it might be good to actually mention that we don't need to run
    any MSan passes here, and that we didn't forget to run them.
    
    Secondly, it seems inconsistent not annotate the functions
    with `Attribute::SanitizeMemory`, like we do for others.
    
    I suppose it isn't strictly required, since they are used
    to actually drive the instrumentation passes, and we don't
    run MSan pass, but they are also used to disable some LLVM optimizations,
    and that //might// be important. Or not, but then i suppose
    there should be a comment about it?
    
    Co-authored-by: Steven Johnson <srj@google.com>
    (cherry picked from commit 7eb9949)
    LebedevRI authored and alexreinking committed Jan 5, 2022
    Configuration menu
    Copy the full SHA
    fef13ab View commit details
    Browse the repository at this point in the history
  8. Install Python tutorials (#6530)

    * Install Python tutorials
    
    I know we have previously discussed that `TYPE DOC` should be used,
    but unfortunately i'm not sure that will work here,
    because doc/tutorial directory is already occupied by C++ tutorials,
    and i don't think they should be mixed.
    I'm open to alternative suggestions.
    
    (cherry picked from commit bce2ef4)
    LebedevRI authored and alexreinking committed Jan 5, 2022
    Configuration menu
    Copy the full SHA
    6c2adf2 View commit details
    Browse the repository at this point in the history
  9. Fix Python GIL lock handling (Fixes #6524, Fixes #5631) (#6525)

    * Fix Python GIL lock handling (Fixes #6524, Fixes #5631)
    
    As disscussed in #6523 (comment)
    and later in #6524,
    pybind11 v2.8.1 added some defensive checks that fail for halide,
    namely in `python_tutorial_lesson_04_debugging_2`
    and `python_tutorial_lesson_05_scheduling_1`.
    
    #6524 (comment) notes:
    > * Python calls a Halide-JIT-generated function , which runs with the GIL held.
    > * Halide runtime spawns worker threads.
    > * The worker threads try to call pybind11's py::print function to emit traces.
    > * Pybind11 complains, correctly, that the worker thread doesn't hold the GIL.
    >
    > Trying to acquire the GIL hangs, because the main thread is still holding it. I tried teaching the main thread to release the GIL (as suggested in #5631), but I still saw hangs when I tried this.
    
    I have tried, and just dropping the lock before calling into halide,
    or just acquiring it in `halide_python_print` doesn't work,
    we need to do both.
    
    I have verified that the two tests fail without this fix,
    and pass with it.
    
    (cherry picked from commit b8eb22d)
    LebedevRI authored and alexreinking committed Jan 5, 2022
    Configuration menu
    Copy the full SHA
    ae942b2 View commit details
    Browse the repository at this point in the history
  10. If cmake built a python module, teach cmake to install the python mod…

    …ule. (#6523)
    
    (cherry picked from commit 3a4e4c7)
    Infinoid authored and alexreinking committed Jan 5, 2022
    Configuration menu
    Copy the full SHA
    89b89c9 View commit details
    Browse the repository at this point in the history
  11. Remove unnecessary std::move calls (#6537)

    Compilers with `-Werror` will fail with `error: moving a temporary object prevents copy elision`
    
    (cherry picked from commit f8459da)
    steven-johnson authored and alexreinking committed Jan 5, 2022
    Configuration menu
    Copy the full SHA
    337bcf7 View commit details
    Browse the repository at this point in the history
  12. Allow third parties to externally override SOVERSION (#6534)

    Debian and other third-party packagers might need or want
    to patch our sources for a variety of reasons. In those
    cases, they might also need to override the SOVERSION.
    
    See here for a practical example:
    
    https://salsa.debian.org/pkg-llvm-team/halide/-/blob/f881de70cd83095053e13047b63f61faf6bc7a36/debian/patches/0006-Fixup-libhalide-version-soversion-for-debian-package.patch
    (cherry picked from commit 7bb8198)
    alexreinking committed Jan 5, 2022
    Configuration menu
    Copy the full SHA
    5bf0acc View commit details
    Browse the repository at this point in the history
  13. Update CMake documentation (#6535)

    * Allow third parties to externally override SOVERSION
    
    Debian and other third-party packagers might need or want
    to patch our sources for a variety of reasons. In those
    cases, they might also need to override the SOVERSION.
    
    See here for a practical example:
    
    https://salsa.debian.org/pkg-llvm-team/halide/-/blob/f881de70cd83095053e13047b63f61faf6bc7a36/debian/patches/0006-Fixup-libhalide-version-soversion-for-debian-package.patch
    
    * Update CMake documentation.
    
    * Fix typo
    
    * Add link to ToC
    
    (cherry picked from commit 95737be)
    alexreinking committed Jan 5, 2022
    Configuration menu
    Copy the full SHA
    c438a91 View commit details
    Browse the repository at this point in the history
  14. Bump version to 13.0.3

    alexreinking committed Jan 5, 2022
    Configuration menu
    Copy the full SHA
    d04ca94 View commit details
    Browse the repository at this point in the history