Repository navigation
Releases
Halide 22.1.0
Halide 22.1.0
A minor release of Halide 22. It adds FreeBSD as a target OS, fixes undefined behavior and memory-safety bugs, and makes the build easier to package for distributions (see #4660).
New features
- FreeBSD target OS (#9642).
Target::FreeBSD(freebsdin target strings, e.g.x86-64-freebsd) uses the FreeBSD LLVM triple and the POSIX runtime. It is detected as the host OS when Halide is built on FreeBSD and is exposed in the Python bindings and inadd_halide_library. x86, ARM/AArch64 and RISC-V are supported. Native builds were tested on FreeBSD 15.1 amd64; AArch64 is untested.FreeBSDis appended toTarget::OS, so existing enum values are unchanged.
Bug fixes
Python
Buffer.copy_fromrejects mismatched buffers (#9635).hl.Bufferandhlr.Buffernow raiseValueErrorwhen the source has a different element size or number of dimensions. Before, release builds (including the wheels) read past the end of the source.- Dimension indices are bounds-checked (#9645).
crop,slice,embed,translate,transpose,dimand their non-mutating variants onhl.Bufferandhlr.Buffernow raiseIndexErrorfor an out-of-range dimension, andValueErrorfor vector arguments with too many entries (or, fortranspose(order), the wrong number). Before, release builds read or wrote past the buffer's shape array.
Compiler and autoschedulers
- Fixed two left shifts of negative values (undefined behavior before C++20) in
ConstantIntervaland the simplifier (#9640). - Anderson2021: fixed an out-of-bounds read in
Strides::dumpand a latent null dereference inunrolled_loops(#9640). - Anderson2021: worked around a clang 22 ThinLTO miscompile (IPSCCP) that made the Anderson2021 generators segfault in LTO builds (#9640).
Build and packaging
These changes let distribution packages drop their local patches (#9641):
- LLD is only required for the in-process WebAssembly JIT. It is now requested only when
Halide_WASM_BACKENDis set. Builds withHalide_WASM_BACKEND=OFFno longer need LLD and may link LLVM statically. - Shared-only FlatBuffers installs (such as Arch's) are supported, and the installed CMake package now finds them for consumers.
- Installed static libraries are built without LTO.
Halide_GenGenandHalide_PyStubsno longer pick up distro-fltoflags, which left compiler-specific bitcode in the shipped archives. - The empty Sphinx-only
doc/subdirectories are no longer installed. test_export_single_symbolno longer depends on$SHELL, which is unset in containers.- The Homebrew build instructions now say
Halide_LLVM_ROOTinstead ofHalide_ROOT.
Compatibility
There are no API or ABI changes. LLVM 21, 22 and 23 are supported, as in 22.0.0. Python code that relied on out-of-bounds Buffer arguments now gets an exception.
Thanks to @soma0212 for the Python Buffer fixes.
Full changelog: v22.0.0.post3...v22.1.0
🤖 Generated with Claude Code
Halide 22.0.0.post3
Packaging-only release. No changes to Halide itself.
- Adds Linux AArch64 (
manylinux_2_28_aarch64) wheels forhalide,halide-bin, andhalide-runtimeon PyPI (#9634). - Adds a Linux AArch64 wheel for
halidoscope22.0.0.
v22.0.0.post2
Packaging-only post-release of Halide 22.0.0. Halide itself is unchanged.
- Halidoscope is now published to PyPI:
pip install halidoscope. import halideworks from monolithic CMake installs.halide/bin/__init__.pyis now installed with the Python bindings (new in v22.0.0.post1). This fixes Homebrew/homebrew-core#321694.- nanobind >= 2.11 is accepted, including 3.x, instead of exactly 2.11. These wheels are built with the latest nanobind.
- Python bindings build with Makefile generators again.
- Fixed the wheel CI for development versions.
See #9631 for details.
v22.0.0
Halide 22.0.0
Highlights
- New scheduling directives:
eager_inline(),change_type(),hoist_invariants(),split_storage,stream_loads/stream_stores,aligned_split, a GPU max-register cap, andPipeline::sever(). - New profiler with counters, recompute statistics and automatic performance warnings.
- Halidoscope, a new interactive trace and profiling visualizer.
- Struct types are now supported in the language.
MultiRamp, a better representation of affine vectors (nested ramps), with simplifier and codegen work built on it.- ARM: SVE2 and SME2 streaming-SVE support, plus new Neon patterns.
- Docs and tutorials moved to Sphinx, and all C++ tutorials were ported to Python.
- Contributor tooling: pre-commit checks, a fuzz-test framework, and Claude skills for scheduling and simplifier rules.
Breaking changes and deprecations
Build and platform
- Dropped Python 3.9 (#8830). Python 3.12 is now required, and the bindings target the stable ABI via nanobind (#9618).
- Dropped LLVM 20 (#8998). LLVM 21, 22 and 23 are supported.
- Removed the
Halide_BUNDLE_STATICfeature (#8801). - Removed
FetchContentfrom the compiler, hannk and onnx (#8962, #9001, #9005). Dependencies now come from vcpkg or the system. - The autoschedulers now have their own CMake package (#9292).
- Fixed the
Halide/HalideHelpersCMake package dependency inversion (#9234). - Python packages are split, and there is a standalone AOT runtime (#9272).
- CUDA: per-capability libdevice bitcode is replaced by a unified
libdevice.10.bc(#9226).
C++ API and ABI
- ABI:
halide_type_tno longer has alanesfield. It is now{code, bits, reserved}, andhalide_buffer_tkeeps its size and layout.Halide::Typeis a separate language-level type that must be explicitly converted withas_abi(#9205). Forloops now store an inclusivemin/maxinstead ofmin/extent(#8858).- Removed the confusing
lanesparameter fromHandle. Use.with_lanes()for vectors of handles (#9198). - The
IRMutator/IRVisitorentry point is nowoperator(). Custom lowering passes that call custom mutators or visitors may need updating (#9023). Func::in()andFunc::clone_in()are now transitive (#9117) and eager (#9277).- Removed the
CompilerLogger(#9269). - Removed the ability to iterate over a
Scope(#9594). - Renamed
CodeGen_PosixtoCodeGen_CPU(#9097). - Deprecated
Target::OS::OSXin favor ofMacOS(#9451). The"osx"target string is still accepted, with a warning. - Deprecated
TailStrategy::Predicatein favor ofGuardWithIf(#9446).
Python
- The axis convention between
hl.Bufferand the Python buffer protocol is now consistent across the bindings,PyCallableand the Python extension (#8953, #8931).
Tests
- Removed
test/error/. Its tests are now correctness tests (#9463). - Moved the internal self-tests out of libHalide into
test/correctness(#9276).
New features
Scheduling
eager_inline()(#9256):g.eager_inline({f1, ..., fN})immediately and destructively inlines the bodies of the listed Funcs intog, in order, so direct calls between them are inlined too.change_type()(#9257): replaces a Func's computation type with another (e.g. float → int32) by computing in the new type and casting back. It uses value-bounds analysis to prove no values change, adds runtime asserts when a reduction might be long enough to overflow, and rewrites products into widening intrinsics where possible. Unsafe float product accumulation can also be fused into an fma (#9578).hoist_invariants()(#9190): likerfactor, but pulls factors that are invariant over a reduction out of the accumulation when the operators obey a distributive (semiring) law. Multi-term reductions are split into one intermediate per term, returned as aFuncVec(#9419). This lets quantized kernels be written naively and scheduled into efficient ones.split_storage(#9460): splits a storage dimension into inner and outer dimensions to express swizzled memory layouts. This helps feed dot-product instructions and matrix-multiply accelerators, and avoids shared-memory bank conflicts. It works on Halide-allocated intermediates only and doesn't compose withfold_storage.stream_loadsandstream_stores(#9207): request non-temporal accesses for a stage's loads (all of them, or from named Funcs) and stores, with a fence after streamed stores. On an Apple M3 this fully recoversmemcpyperformance.- Aligned splits (#9409, #9501):
splittakes an optional offset so the first inner-loop iteration can be aligned to a boundary other than the Func's min. Inner loops now always run from 0 to the factor, which helps constant-bounds analysis. - GPU register cap (#9389): a scheduling directive replaces the
HL_CUDA_MAX_REGISTERSenvironment variable for limiting registers per thread. It only affects CUDA. Pipeline::sever()(#9484): replaces a set of Funcs withImageParaminputs and returns a second pipeline that computes them. Work that would otherwise be redone on everyrealize(), such as quantizing static weights, becomes ordinary input data computed once.- Merged bounds directives (#9410): repeated
bound/align_bounds/align_extentcalls on the same Var now combine into one entry, so call order no longer affects bounds inference. Overwriting a previously set field emits a warning. - Stricter checks:
Stage::fuserejects fusions that illegally reorder dimensions, such as swapping inner and outer RVars (#9186). An explicitfold_storagethat the compiler can't apply is now an error instead of being silently ignored (#9201). - Name collisions (#9145, #9210): Generator
Input<>s and named scalarParams now reserve their names so later Funcs get unique names. If a Func was declared first, you get a clear error instead of a crash in lowering.
Language and IR
- Struct types (#9416):
Type::Structdefines record types with named, optionally array-valued fields, e.g.Type::Struct({{"d", Float(16)}, {"qs", Int(8), 32}}). Inputs and outputs can use packed wire formats, such as blocks of quantized weights, directly, and you read fields withfield(x(b), "d"). Records are not meant for efficient computation: you extract fields first. fmaintrinsic (#8900): the equivalent ofstd::fma, for when you need a real fused multiply-add inside astrict_floatcontext, such as for bit-exact transcendentals.round_half_away(#9573): rounds ties away from zero like C'sround(), whileround()keeps rounding ties to even. It maps to native instructions such asfrintaandfcvtason AArch64, and is exposed in Python ashl.round_half_away.fixed_to_floatintrinsic (#9572):float(x) * 2^-kis recognized as a fixed-point to float conversion, which becomes a singlescvtf/ucvtfon ARM. It saves a multiply per vector when dequantizing fixed-point data, and is lowered back to cast-and-multiply elsewhere.- Better widening (#9195):
FindIntrinsicsnow handles 8-bit integer to float32 widening multiplies, andconcat_bits/extract_bitshave lowerings for the C and Vulkan backends. MultiRamp(#9113): represents a vector whose lanes are an affine function of a multi-dimensional index, i.e. sums of compatible nested ramps. Multidimensional SIMD targets (and matrix multiplies built from nested vectorized loops) used to scalarize easily. Related work includes the AMX fix (#9122), dense load/store canonicalization (#9535), alignment-aware div/mod (#9536), and load recognition (#9261).- Front-end helpers:
- Compiler-developer APIs:
mutate_with/visit_withlet you write mutators and visitors from lambdas that can capture local state (#8877, #8893).Load::make(type, name, index)andStore::make(name, value, index)short forms are available (#9247).- IR nodes have
remakemethods that copy a node with new children (#9245). Block::to_vectorunpacks aStmtinto its non-Block statements (#9384).
Profiling, tracing and debugging
- New profiler (#9157, #9164, #9344, #9368): the report is organized by loop nesting, with allocations and device copies as their own entries. Cheap runtime counters feed recompute ratios and a set of performance warnings about likely schedule problems, which are especially useful to LLMs scheduling Halide code. Inlined Funcs are counted but can't be sampled.
- Profiler control (#9423, #9492): JIT code can access profiler state programmatically.
halide_profiler_set_json_outputsets the JSON path from code, andProfilerScopeaccepts aCallableso repeated calls accumulate statistics. - Halidoscope (#9356, #9413): an interactive tool for exploring traces and profiler output, with a trace view and a profile view. It complements
HalideTraceViz, which shows how a schedule executes but not how much time it takes, and installs via pip. - Tracing:
- Tasks that run in parallel now emit trace events, using a more compact packet format (#9192).
trace_bounds_requiredevents report the region bounds inference requires of each Func, so tools can tell required values from ones computed outside that region (#9506).- Produce/consume events now sit inside the node body, so a skipped stage emits no unmatched begin event (#9505).
JITSharedRuntime::set_trace_fileredirects JIT trace output between realizations (#9516).
HL_DEBUG_CODEGEN:- Tag-based filtering selects a specific
debug()call witho...
- Tag-based filtering selects a specific
v21.0.0
Release highlights
We have deliberately skipped version 20.0.0 to align with the LLVM version we are now using. Note that LLVM 21.1.1 or higher is required as LLVM 21.1.0 has a major bug in the NVPTX backend.
Major changes
- The
rfactorscheduling directive was rewritten and enhanced. It is now compatible with autoschedulers. - The Mullapudi2016 autoscheduler now supports experimental GPU scheduling.
- The Python bindings have been substantially improved, with many missing bindings filled in.
HL_DEBUG_CODEGENgained a new filtering mode. Debug levels can now be set on a per-file/per-function basis.- Support was added for AMD Zen5 and the iOS Simulator.
- The
strict_floatfeature has been reimplemented and should be much more reliable. - Lots of bugfixes, performance improvements, and build system improvements. We spent a lot of time fixing issues with our testing infrastructure and are looking forward to implementing a more stable contribution experience going forward.
Deprecations
- LLVM 19 and below are no longer supported, in keeping with our support policy.
Halide_BUNDLE_STATICwill be removed in the next release. If you are using it, please migrate to the shared library instead.- Support for Python 3.8 has been dropped.
Changelog
Scheduling
- The
rfactorscheduling directive was rewritten and enhanced.- Rewrite the rfactor scheduling directive by @alexreinking in #8490
- Dequalify names when constructing RVars in rfactor by @alexreinking in #8560
- Add promise_clamped in rfactor by @alexreinking in #8608
- Add rfactor patterns for NaN-propagating min/max by @alexreinking in #8587
- The Mullapudi2016 autoscheduler now supports experimental GPU scheduling.
- GPU autoscheduling with Mullapudi2016: the reference implementation by @antonysigma in #7787
- Mullapudi2016-GPU: Reorder to avoid for-loops to be sandwiched between
gpu_blocks. by @antonysigma in #8647 - Enable experimental Mullapudi2016 GPU scheduler for test-bench by @antonysigma in #8650
- Highlight Metal GPU code in stmt_html by @antonysigma in #8659
- Always ensure gpu_threads count >= warp size of 32 by @antonysigma in #8656
- Fix incorrect natural vector size on Zen4 by @abadams in #8570
- Make it an error to use a device extern stage without target support by @abadams in #8794
- Add support for adding tuple outputs in the configure() method by @abadams in #8649
Python
- Fix argument order in rpow by @alexreinking in #8677
- Drop support for Python 3.8 by @alexreinking in #8678
- Fix segfault in RDom's operator<< by @alexreinking in #8679
- Use ruff to format and lint Python code by @alexreinking in #8684
- Get raw Runtime::Buffer from Buffer in Python rather than use PyBuffer by @alexreinking in #8682
- Bind in-place update operators (e.g. +=) in Python by @alexreinking in #8683
- Clean up Python dependencies; document uv usage by @alexreinking in #8694
- Fix several printing segfaults. by @alexreinking in #8700
- Add Python bindings for serialization by @alexreinking in #8718
- Add all remaining IROperator ops to Python bindings by @alexreinking in #8771
- Fix up memoize; bind to Python by @alexreinking in #8778
- Fix invalid Python type annotation and return types (#8772) by @rtzam in #8773
- Expose
Runtime::Buffer::croppedto C++ and PythonBufferby @rtzam in #8787
Debugging
- New feature flag to allow for stack backtrace/unwind by @mcourteaux in #8703
- Add filtering capabilities to HL_DEBUG_CODEGEN by @alexreinking in #8627
- Adding worker_thread_idle() for more informative profiling by @slomp in #8719
- Color IR output in cout and cerr. by @mcourteaux in #8635
- Improve output format for lowering passes timing. by @mcourteaux in #8749
- fix(stmt-html): Fix embedded Buffer processing performance issue. by @mcourteaux in #8748
- Use AArch64 assembly syntax on macOS with LLVM<22 by @alexreinking in #8710
CodeGen
- Mark our PTX kernels as kernels, to stop them from being stripped by @abadams in #8571
- Math functions renaming table for GPU backends to support vectorized evaluation of math functions. by @mcourteaux in #8595
- Apply version constraints to iOS objects by @alexreinking in #8546
- Redirect bitwise ops to logical ops in case the arguments are bool. by @mcourteaux in #8597
- scalarize select condition for LLVM where possible by @abadams in #8575
- Add missing addition simplifier rules by @abadams in #8630
- Bounds and alignment analysis through bitwise ops by @abadams in #8574
- Make the vld2 pattern more obviously profitable by @abadams in #8765
- Fix vector shuffle for Vulkan CodeGen by @derek-gerstmann in #8621
- Suppress warning on Windows for duplicate constant symbols. by @mcourteaux in #8555
- Use lossless_cast for saturating casts from unsigned to signed on x86 by @abadams in #8527
- AMD Zen5 support by @changhoon-sung in #8612
Compiler
- Rework strict_float to use individual op intrinsics instead by @abadams in #8641
- Don't cache mutations of Exprs that have only one reference to them by @abadams in #8518
- Only use the nodes-visited set for nodes with multiple refs by @abadams in #8547
- In graph_equal(), call the correct implementation for comparing equalities between statements and expressions by @BachiLi in #8611
Runtime
- Support copying the overlapping region from one buffer to another. by @mcourteaux in #8463
- Add (iOS) simulator target feature. by @alexreinking in #8623
- Opt out of JIT exceptions by @abadams in #8615
- Experimental: support removing unused runtime functions via
HL_RUNTIME_DROP_FUNCSenvironment variable.- PoC feature: drop functions from the runtime by @mcourteaux in #8653
Apps
- The onnx app now builds with CMake:
- Add CMake for onnx app by @vawale in #8707
- Fix halide_as_onnx_backend_test by @alexreinking in #8784
Documentation
Bugfixes
- Fix #8534 [Buffer serialization does not match deserialization] by @abadams in #8535
- Fix CUDA HTML code printing bug. by @mcourteaux in #8558
- Fix halide_get_cpu_features() linkage to avoid name mangling issues by @derek-gerstmann in #8573
- Fix for #8578 by @mcourteaux in #8579
- Fix shuffle bug in CodeGen C. by @mcourteaux in #8567
- Check if expression is defined before trying to compute its constant_integer_bounds by @vksnk in #8599
- Drop invalid "in-bounds" GEP for constant offsets by @alexreinking in #8768
- Record trace_loads directly on ImageParam. by @alexreinking in #8803
- RewriteLoadsAs32Bit should use the mutated index by @rootjalex in #8581
- Set any_strict_float for wrapper module if target has strict_flag feature by @vksnk in #8681
- Fix wrong type of the bound by @vksnk in #8781
- Fix UB-introducing rewrite in FindIntrinsics by @abadams in #8539
- Fix rewrite that doesn't preserve type by @abadams in #8674
- Fix nested select handling in remove_undef by @abadams in #8669
- Add an underlying type to the halide_buffer_flags to prevent UB in C++ by @mcourteaux in #8690
Testing / CI
- Limit depth more strictly in CSE fuzz test by @abadams in #8512
- Skip fast exp/log/pow/sin/cosine tests without sse 4.1 by @abadams in https://github.com/halide/Halide/pu...
v19.0.0
Major improvements
- Halide is now available for both C++ and Python usage via Pip. Try
pip install halidetoday! - The Vulkan backend has matured substantially.
- The HTML "conceptual statement" output now supports dark mode viewing.
- For developers, CMake 3.28 is now required and we no longer require an internet connection during the build.
- Thread pool improvements mean that workloads that do a small number of small tasks in parallel (e.g. a cheap operation applied to a small image) are up to 3x faster. If you have schedules that do not use parallelism for small inputs because you found it didn't provide any speedup, you may want to re-benchmark.
- You can now query properties of the compiled-for target as Exprs, simplifying helper code that wants to do different things depending on the target architecture. Example:
f(x) = select(target_arch_is(Target::ARM), 3, 7). Helpers includetarget_arch_is,target_os_is,target_has_feature,target_bits, andtarget_natural_vector_size. These are resolved to constants at compile-time and simplified away. Use with care, as this (intentionally) results in different behavior on different platforms.
Breaking changes
- We now distribute
libGenGen.arather thanGenGen.cpp.- Downstream users should link to this library with
/WHOLEARCHIVE:or-Wl,--whole-archiverather than buildGenGen.cppthemselves. - Users of the CMake package should be unaffected.
- Downstream users should link to this library with
- In keeping with our LLVM support policy, support for LLVM 16 has been removed.
- We no longer use the
le64/le32generic targets for compiling runtime modules to LLVM. These targets were removed in LLVM upstream.
What's Changed
Apps and tests
- Reschedule the matrix multiply performance app by @abadams in #8418
- Update lesson_22_jit_performance.cpp by @abadams in #8438
- Add threadpool performance test by @abadams in #8447
- Don't allow internal_error to pass an error test by @alexreinking in #8458
- Get more consistent distributions in parallel scenarios test by @abadams in #8451
Autoschedulers
Build system
Python_bindings-test-as-installed by @LebedevRI in #8355- Bump Halide version to 19 in main branch by @steven-johnson in #8357
- Remove warning for unsupported compilers by @alexreinking in #8362
- Bump CMake minimum version to 3.28 by @alexreinking in #8363
- Quick CMake fixes enabled by 3.28 by @alexreinking in #8365
- Distribute GenGen as a static library by @alexreinking in #8367
- Clean up serialization build code by @alexreinking in #8369
- List headers with target_sources FILE_SETS by @alexreinking in #8370
- Clean up autoscheduler dependencies by @alexreinking in #8372
- Use a Find module for V8 by @alexreinking in #8373
- Use a Find module for NodeJS by @alexreinking in #8374
- Move dependencies/wasm to use sites by @alexreinking in #8377
- Replace FetchContent with a custom dependency provider by @alexreinking in #8378
- Two more build fixes by @LebedevRI in #8371
- Rework LLVM into Find module and enact new component policy. by @alexreinking in #8379
- Reflow src/CMakeLists.txt in logical groups by @alexreinking in #8383
- Introduce HalideFeatures system for optional components by @alexreinking in #8384
- Scan generated export files to determine dependencies. by @alexreinking in #8385
- Rewrite bundle_static to be much more efficient. by @alexreinking in #8386
- Support using vcpkg to build dependencies on all platforms by @alexreinking in #8387
- Fix bundling error on buildbots by @alexreinking in #8392
- Support CMAKE_OSX_ARCHITECTURES by @alexreinking in #8390
- Fix Homebrew LLVM 19 by @alexreinking in #8431
- Fix CPack package naming when cross-compiling by @alexreinking in #8492
- Fix Apple libtool detection in bundle_static by @alexreinking in #8495
CodeGen
- Select condition vector lanes must match the true and false value by @abadams in #8465
- Emit
vscale_range()fn attribute in correct syntax by @steven-johnson in #8457 - Fix #8455 (in combination with #8457) by @steven-johnson in #8456
- Fix bonehead mistake in get_md_bool() by @steven-johnson in #8469
- Propagate some facts about inequalities with min/max by @shoaibkamil in #8475
- This fixed an issue where predicates in
.specialize()directives weren't able to eliminateselect()cases. #8443
- This fixed an issue where predicates in
Debugging
- Add LLDB pretty-printing by @alexreinking in #8460
- Print constants in scientific precision by @antonysigma in #8506
- Adaptive Dark colorscheme for Stmt HTML. Ability to programmatically export conceptual stmt files. by @mcourteaux in #8327
Documentation
- Update README.md by @abadams in #8404
- Big documentation update by @alexreinking in #8410
- Document how to find Halide from a pip installation by @alexreinking in #8411
- Link to PyPI from Doxygen index.html by @alexreinking in #8415
- Include our Markdown documentation in the Doxygen site. by @alexreinking in #8417
- Add missing backslash by @abadams in #8419
Frontend
- Don't let users disguise RVars as Vars by @abadams in #8441
- Add helper functions to query properties of the lowered Target (#8192) by @steven-johnson in #8359
Hardware backends
- Fix injection of GPU buffers that do not go by a Func name (i.e. alloc groups). by @mcourteaux in #8333
- Remove vestigial AMDGPU backend by @alexreinking in #8382
- Add ARMv8.x feature flags by @steven-johnson in #4489
- [vulkan] Fixes to address outstanding validation failures by @derek-gerstmann in #8448
- [vulkan] Reduce descriptor sets, use official headers, improve allocator, remove module destructor by @derek-gerstmann in #8452
- [vulkan] Skip
async_copy_chainandgpu_allocation_cachecorrectness tests on Windows by @derek-gerstmann in #8503
LLVM
- Don't use le32/le64 by @steven-johnson in #8344
- Fix for the removed DataLayout constructor. by @mcourteaux in #8391
- Drop support for LLVM 16 in main by @steven-johnson in #8358
- Allow LLVM 20 by @steven-johnson in #8352
- Fix for top-of-tree LLVM by @steven-johnson in #8421
- Fix for top-of-tree LLVM by @steven-johnson in #8425
- Fix for top-of-tree LLVM by @steven-johnson in #8442
- Fix datalayout for osx-arm-64 by @abadams in #8449
- Fix top of LLVM. by @mcourteaux in #8454
- Replace all use of getPointerTo() with PointerType::get() by @steven-johnson in #8473
Python
- Fix Numpy 2.0 compatibility bug in lesson 10 by @alexreinking in #8381
- Pip packaging at last! by @alexreinking in #8405
- Update pip package metadata by @alexreinking in #8412
- Fix classifier spelling by @alexreinking in #8413
- Upgrade LLVM to 19.1.0 in pip package by @alexreinking in #8423
- Update PIP LLVM to 19.1.4 by @alexreinking in #8488
- PythonExtensionGen: ~PyHalideBuffer should call device_free() (#8399) by @steven-johnson in #8439
Runtime
- Fix profiler to report time spent on GPU kernels again instead of on 'wait for parallel tasks'. by @mcourteaux in #8453
- Don't spin on the main mutex while waiting for new work by @abadams in #8433
Minor bugfixes / other cleanup
- Remove remaining dregs of tuple_select (oops) by @steven-johnson in https://github.com/halid...
Halide v18.0.0
Changes Of Note since Halide 17
- Ring-buffering now supported in schedules (
Func::ring_buffer()). This is distinct from fold_storage in that it folds across time (the loop variables) rather than folding across space (the pure vars of the Func). - Fixed a longstanding bug in
lossless_cast() - Lots of fixes for Vulkan backend
- OpenGLCompute is no longer supported
- Added support for ARM SVE2
- Added (basic) support for Intel APX and AVX10
- Added support for Hexagon HVX v68
- Added support for numpy's
.npyformat to.debug_to_file()and the code in halide_image_io.h - Python bindings now support bfloat and int64 properly
- Hacky code that auto-named Funcs, Vars etc via DWARF introspection was removed
- The profiler was revamped to behave better when multiple Halide pipelines are in flight at the same time.
- Numerous lowering passes were sped up, resulting in faster compilation for large pipelines. However, time spent in LLVM is still the long pole for most pipelines.
- Fixed-point instruction selection has been improved via tracking constant integer bounds of expressions.
- Adds feature detection for ARM CPUs to the runtime library and to the host target feature computation. Supports Windows, macOS,
Linux, iOS, and Android.
Deprecations / Removals
tuple_select()has been removed in favor of overloads toselect().- Various fixed-point operators have been removed from the
Halide::Internalnamespace and are now in the publicHalidenamespace.
What's Changed
- Detect ARM CPU features for host target and in runtime (#8298)
- Scheduling directive to support ring buffering by @vksnk in #7967
- Don't add ring_buffer semaphores if the function is not scheduled as async by @vksnk in #8015
- Quick fix for crash that is occurring in SVE2 tests. by @zvookin in #8020
- Don't use variable-length arrays by @steven-johnson in #8021
- Set warnings on tests as well as src by @steven-johnson in #8022
- Stronger chain detection in LoopCarry pass by @vksnk in #8016
- adds mappings for f16 variants of halide float math by @mikewoodworth in #8029
- Require LLVM >= 16.0 by @steven-johnson in #8003
- Add test for #8029 by @steven-johnson in #8032
- Tweak the Printer code in runtime for smaller code by @steven-johnson in #8023
- Fix bounds_of_nested_lanes by @abadams in #8039
- Track whether or not let expressions failed to solve in solver by @abadams in #7982
- Fix type error in VectorizeLoops by @abadams in #8055
- Update makefile to use test/common/terminate_handler.cpp by @abadams in #8066
- add unsafe_promise_clamped by @wraith1995 in #8071
- Don't require Halide_WebGPU when using wasm (#8063) by @steven-johnson in #8065
- Outsmart the LLVM optimizer by @steven-johnson in #8073
- Add hexagon_benchmarks app for CMake builds by @prasmish in #8069
- Fix bool conversion bug in Vulkan code generator by @derek-gerstmann in #8067
- Better validation of gpu schedules by @abadams in #8068
- Add an easy way to print vectors in debug output. by @zvookin in #8072
- [WebGPU] Update to latest native headers by @jrprice in #8081
- Remove OpenGLCompute by @steven-johnson in #8077
- Add checks to prevent people from using negative split factors by @abadams in #8076
- Fix rfactor adding too many pure loops by @abadams in #8086
- Forward the partition methods from generator outputs by @abadams in #8090
- Parallelize some tests by @abadams in #8078
- Allow disabling of mutlithreading in simd op check by @steven-johnson in #8096
- clang does not support
_Float16when targeting i386 by @LebedevRI in #8085 - tests: correctness/float16_t: mark
__extendhfsf2with default visibility by @LebedevRI in #8084 - Fix reduce_expr_modulo of vector in Solve.cpp by @abadams in #8089
- [Vulkan] Region allocator fixes for memory requirements and allocations by @derek-gerstmann in #8087
- Ensure string(REPLACE) is called with the right number of arguments by @alexreinking in #8097
- Strip asserts right at the end of lowering by @abadams in #8094
- Fix clang-tidy error in runtime.printer.h (parameter shadows member) by @steven-johnson in #8074
- Fix an issue where the Halide compiler hits an internal error for bool types in widening intrinsics. by @zvookin in #8099
- Small Tutorial Fix by @2022tgoel in #8111
- Optionally print the time taken by each lowering pass by @abadams in #8116
- Do less redundant work in UnpackBuffers by @abadams in #8104
- Avoid redundant scope lookups by @abadams in #8103
- Add Intel APX and AVX10 target flags and LLVM attribute setting. by @zvookin in #8052
- Use a caching version of stmt_uses_vars in TightenProducerConsumer nodes by @abadams in #8102
- Fix hoist_storage not handling condition correctly. by @abadams in #8123
- Rewrite the skip stages lowering pass by @abadams in #8115
- Remove two dead vars from the Makefile by @abadams in #8125
- Add support for setting the default allocator and deallocator functions in Halide::Runtime::Buffer. by @mcourteaux in #8132
- Make realization order invariant to unique_name suffixes by @abadams in #8124
- Make gpu thread and block for loop names opaque by @abadams in #8133
- Add class template type deduction guides to avoid CTAD warning. by @zvookin in #8135
- [vulkan] Add conform API methods to memory allocator to fix block allocations by @derek-gerstmann in #8130
- Add sobel in hexagon benchmarks app for CMake builds by @prasmish in #8127
- Handle loads of broadcasts in FlattenNestedRamps by @abadams in #8139
- Use python itself to get the extension suffix, not python-config by @abadams in #8148
- Rewrite the pass that adds mutexes for atomic nodes by @abadams in #8105
- Feature: mark a Func as no_profiling, to prevent injection of profiling. (2nd implementation) by @mcourteaux in #8143
- Bound allocation extents for hoist_storage using loop variables one-by-one by @vksnk in #8154
- Support for ARM SVE2. by @zvookin in #8051
- Fix two compute_with bugs. by @abadams in #8152
- Python bindings:
add_python_test(): do setHL_JIT_TARGETtoo by @LebedevRI in #8156 - fix ub in lower rounding shift right by @abadams in #8173
- Add some missing _Float16 support by @steven-johnson in #8174
- Add conversion code for Float16 that was missed in #8174 by @steven-johnson in #8178
- Tighten bounds of abs() by @rootjalex in #8168
- Clarify the meaning of Shuffle::is_broadcast() by @abadams in #8158
- Add .npy support to halide_image_io by @steven-johnson in #8175
- Update Hexagon Install Instructions by @FabianSchuetze in #8182
- Add .npy support to debug_to_file() by @steven-johnson in #8177
- Don't print on parallel task entry/exit with -debug flag by @abadams in #8185
- Fix corner case in if_then_else simplification by @abadams in #8189
- Rewrite IREquality to use a more compact stack instead of deep recursion by @abadams in #8198
- [HEXAGON] Keep support for hexagon_remote/Makefile by @aankit-quic in #8186
- Faster substitute_facts by @abadams in #8200
- Make Interval::is_single_point check for deep equality by @abadams in #8202
- Refactor ConstantInterval by @abadams in #8179
- Faster vars used tracking in simplify let visitor by @abadams in #8205
- M...
Halide v17.0.2
What's Changed
- Backport a fix for the simpler bug in lossless_cast by @abadams in #8264
- Fix Vulkan SIMT mappings for GPU loop vars; avoid formatting the GPU kernel to a string for Vulkan (since it's binary SPIR-V needs to remain intact). @derek-gerstmann in #8270
Full Changelog: v17.0.1...v17.0.2
Halide v17.0.1
What's Changed
- Changes to make WebGPU code compliant with recent versions of Emscripten (#8106)
- Fix rfactor adding too many pure loops (#8107)
- Forward the partition methods from generator outputs (#8090)
- Fix reduce_expr_modulo of vector in Solve.cpp (#8107)
Full Changelog: v17.0.0...v17.0.1
Halide v17.0.0
Changes Of Note
ParamMaphas been removed entirely from the public API. All users ofParamMapshould migrate toCallableinstead.Halide::Parameterhas been moved to the public Halide API (it was formerly "internal" and not intended for public use).- New scheduling primitives:
Func::partition()and friends: Set the loop partition policy, which controls how/whether a loop is split into three loops (prologue/steady-state/epilogue). Loop partitioning can be useful to optimize boundary conditions (e.g. clamp_edge).Func::hoist_storage()and friends: allows a functions's storage to be moved to a given loop level. UnlikeFunc::store_at(), no optimizations are triggered (e.g. sliding window).
- New
TailStrategyoptions for for existing scheduling directives:ShiftInwardsAndBlend: Equivalent to ShiftInwards, but protects values that would be re-evaluated by loading the memory location that would be stored to, modifying only the elements not contained within the overlap, and then storing the blended result. Unlike ShiftInwards, this is valid to use in update definitions.RoundUpAndBlend: Equivalent to RoundUp, but protects values that would be written beyond the end by loading the memory location that would be stored to, modifying only the elements within the region being computed, and then storing the blended result. Unlike RoundUp, this is valid to use on non-outermost splits in update definitions.
- Substantially improved performance and display in the VizIR output.
- Profiler improvements:
- Substantially nicer text output
- Injects timing into calls for
copy_to_hostandcopy_to_deviceso you can measure host<->device copy overhead - Allows option sorting via
HL_PROFILER_SORTenv var
- Substantially faster codegen for several GPU backends.
- Experimental serialization/deserialization feature allows for saving of Halide IR code.
- Various bug fixes and improvements in the
Anderson2021autoscheduler. - Improved ARM codegen, including: better patterns for sdot/udot; improved shift/mul codegen.
- Support for Zen4 architecture in the x86 backend.
- Updates to the ONNX app.
- Various fixes and improvements to sliding-window and storage-folding.
- Improvements to slow gather operations for some x86 variants.
- Improvements to correctness for the
.async()scheduling directive. - Improved codegen for float16 conversion, especially on x86.
- Several compile-time warnings of dubious usefulness disabled.
- WebAssembly codegen now defaults to assuming that saturating-float-to-int and sign-extension instructions sets are always available.
Targetnow does some reality-checking that it doesn't contain obviously nonsensicalFeaturecombinations
What's Changed
- Misc changes and fixes to RISCV codegen
- Revise LLVM fix to work when no V8 or WABT available by @steven-johnson in #7635
- Be more careful about overflow in trim_bounds_using_alignment by @abadams in #7645
- Add a compositing example app by @abadams in #7646
- Get the ASAN toolchain working again by @steven-johnson in #7604
- Upgrade clang-format and clang-tidy to use v16 by @steven-johnson in #7660
- Enable the misc-use-anonymous-namespace clang-tidy check by @steven-johnson in #7661
- Enable clang-tidy's modernize-use-default-member-init check by @steven-johnson in #7662
- Update onnx app to Adams2019 autoscheduler and new autoscheduler API by @abadams in #7673
- Remove ParamMap by @steven-johnson in #7675
- Fix correctness_float16_t for ASAN builds by @steven-johnson in #7687
- Add a select overload for tuples by @abadams in #7672
- Add Sanitizer details to README_cmake.md by @steven-johnson in #7688
- Fix quadratic algorithm in simplify_correlated_differences by @abadams in #7686
- Fix float16 under asan, attempt #2 by @steven-johnson in #7691
- Add a warning if a Generator declares any Outputs before the final Input (Fixes #7669) by @steven-johnson in #7697
- Fixed the regularization for BGU. by @mcourteaux in #7684
- Fix clang and llvm versions in scripts by @TH3CHARLie in #7702
- Fix leaks caused by self-referential parameter constraints by @abadams in #7700
- Fix float16 warning for older clangs by @abadams in #7701
- Upgrade Halide main branch for LLVM18 by @steven-johnson in #7710
- Improved profiler result printing. by @mcourteaux in #7709
- Default WITH_TEST_FUZZ to OFF by @steven-johnson in #7695
- Throw an erorr if split is called with the same older and inner var name by @TH3CHARLie in #7715
- Making HLSL code-gen a couple orders of magnitude faster... by @slomp in #7719
- Making Metal code-gen a bit faster by @slomp in #7720
- Fix handling of thread features for scalars in Anderson2021 by @aekul in #7726
- Change default generator timeout to infinite by @abadams in #7718
- Remove unused using decl by @abadams in #7730
- [Hexagon] - Fix problems in sim_host.cpp by @pranavb-ca in #7725
- Fix RDom usage in anderson2021_test_apps_autoscheduler (Fixes #7729) by @steven-johnson in #7734
- Fix leak on cloning functions with update defs by @abadams in #7735
- Ignore code in src/runtime/hexagon_remote/bin/src for clang-format by @steven-johnson in #7736
- Clean up really long line lengths in Anderson2021 by @steven-johnson in #7728
- Revise labels on autoscheduler tests by @steven-johnson in #7732
- Speedup the VizIR HTML. by @mcourteaux in #7713
- Run clang-tidy on macOS runners instead of Linux by @steven-johnson in #7746
- Fix infinite recursion in loop partitioning by @abadams in #7743
- Fix leaks in test/correctness/memoize.cpp by @abadams in #7705
- Allow optional sorting of profiler output via HL_PROFILER_SORT env var (Fixes #7638) by @steven-johnson in #7639
- Permit llvm 15 on windows by @abadams in #7744
- Revert accidental typo change in #7746 by @steven-johnson in #7747
- [vulkan] Fix heap buffer overflow in Vulkan extension handling discovered by ASAN by @derek-gerstmann in #7740
- [vulkan] Fix SPIR-V IR references causing leaks by @derek-gerstmann in #7739
- Improve error-handling in Anderson2021, and ensure build deps are cor… by @steven-johnson in #7748
- StmtViz: Search for tooltip only in the child node by @antonysigma in #7754
- Experimental serializer by @TH3CHARLie in #7594
- Define
cast<i32>(u32)overflow behavior by @rootjalex in #7769 - Fix vector reduce HTML by @mcourteaux in #7773
- Remove fragile simd_op_check test for mlal/mlsl on ARM by @rootjalex in #7775
- Speedup page loading of VizStmt. by @mcourteaux in #7755
- Try to fix remaining ASAN-reported leaks by @steven-johnson in #7767
- Fix out of bounds access in anderson2021_test_apps_autoscheduler by @aekul in #7771
- Don't introduce reinterprets in find/lower intrinsics by @rootjalex in #7776
- [Hexagon] -Build Hexagon runtime components using the Hexagon SDK (Clone of #7671) by @pranavb-ca in #7741
- slice IRMatcher should only match on slices by @abadams in #7772
- Don't inject undef() in the simplifier by @abadams in #7791
- Fix for top-of-tree LLVM by @steven-johnson in #7798
- [ARM] Distribute shifts as muls by @rootjalex in #7790
- [ARM] support new udot/sdot patterns by @rootjalex in #7800
- Remove some unused includes by @abadams in #7799
- Add support to the makefile for serialization by @abadams in #7762
- [wasm] Enable PIC for WebAssembly on LLVM v18.x by @derek-gerstmann in #7803
- Update WebGPU to latest Emscripten/Dawn API by @steven-johnson in #7804
- Add jump-buttons to get fro Stmt directly to Assembly by @mcourteaux in #7793
- Update clang-tidy action to stop breaking by @...