Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 04:34

    steven-johnson on xtensa-codegen

    clang-tidy: add [[maybe-unused]… Fix bonehead version-checking t… Merge branch 'main' into xtensa… (compare)

  • 04:34

    steven-johnson on buffer-ios

    (compare)

  • 04:34

    steven-johnson on main

    Fix bonehead version-checking t… (compare)

  • 04:34
    steven-johnson closed #7218
  • 01:47
    oliver-batchelor commented #7213
  • 01:22

    steven-johnson on main

    clang-tidy: add [[maybe-unused]… (compare)

  • 01:22
    steven-johnson closed #7215
  • 01:20
    steven-johnson synchronize #7216
  • 01:20

    steven-johnson on run-simd-op-check

    Update simd_op_check_riscv.cpp (compare)

  • 01:15
    steven-johnson closed #7217
  • 01:15
    steven-johnson commented #7217
  • 00:19
    steven-johnson synchronize #7216
  • 00:19

    steven-johnson on run-simd-op-check

    Update simd_op_check_x86.cpp (compare)

  • 00:19
    steven-johnson opened #7219
  • 00:00
    steven-johnson synchronize #7216
  • 00:00

    steven-johnson on run-simd-op-check

    Add more features that must mat… (compare)

  • Dec 07 23:17
    steven-johnson synchronize #7206
  • Dec 07 23:17

    steven-johnson on aligned-alloc-2

    Add bridging for clang _Float16… Fix issue with vector predicate… Add RISC V zvl flag for LLVM ve… and 5 more (compare)

  • Dec 07 23:15
    steven-johnson review_requested #7218
  • Dec 07 23:15
    steven-johnson review_requested #7215
Alex Reinking
@alexreinking:matrix.org
[m]
The sanitizers are toolchain-y anyway... that approach makes sense to me
Alex Reinking
@alexreinking:matrix.org
[m]
We should probably use some custom target properties for this... hmm. To-do.
Roman Lebedev
@LebedevRI
unless halide could directly consume CFLAGS, ask clang to interpret them, and then introspect what sanitizers/sanitizer options got enabled, i'm afraid it's not really feacible
Alex Reinking
@alexreinking:matrix.org
[m]
I'm not understanding. If you want Halide to enable a sanitizer, you add it to the list of target features. It's a downstream responsibility to configure Halide correctly, i.e. you're in control of your flags, so it's your responsibility to make sure that your various flags agree between all the compilers you're using.
Halide isn't and can't possibly be responsible for sniffing all the innumerable locations that -fsanitize might be slipped into the command lines of surrounding compiler invocations
There's CFLAGS, CXXFLAGS, hard-coded Makefile command lines, CMake's add_compile_options and target_compile_options (and abuses of related functions), compiler wrappers, etc.
Roman Lebedev
@LebedevRI
the more concrete question is: it isn't sufficient to just add ModuleSanitizerCoveragePass, it takes a number options. as i can see, in other sanitizer cases they are simply hardcoded in halide. would the suggestion be to do the same here?
Alex Reinking
@alexreinking:matrix.org
[m]
Yes, or dependent upon the other features that are enabled on the Target
E.g. if you combine multiple sanitizers
Roman Lebedev
@LebedevRI
i very much disagree that this is not halide's responsibility, it quite clearly is. the real question being, how do the knobs to configure it look like
Alex Reinking
@alexreinking:matrix.org
[m]
The Halide equivalent of a compiler command line is the Target feature set, pretty much
Roman Lebedev
@LebedevRI
that's my point actually
the unfortunate consequence of that is that each downstream will have to second-guess what clang will do, and manually tell halide do do the same
Alex Reinking
@alexreinking:matrix.org
[m]
Where is Clang involved in this?
Halide goes through LLVM for codegen, never passes through clang (unless you go through the C backend and choose to)
Roman Lebedev
@LebedevRI
perhas s/will/would/. imagine the following situation: there was some C codebase, it was being compiled with clang, with whatever sanitization flags. now, some part of that C code is replaced with AOT halide code
as far as i understand, unless explicitly enabled via halide target features, halide will not apply ASAN/MSAN, which makes sense
but the caveat is, said codebase will need some glue somewhere to toggle said halide features when the original C code would have been compiled with said sanitizers
this could look like either a cmake option in downstream code, say "WITH_ASAN", which would toggle halide feature alongside with adding -fsanitize=address to the compilation options like it did already
Alex Reinking
@alexreinking:matrix.org
[m]
if (WITH_ASAN)
  list(APPEND Halide_TARGET_FEATURES asan)
endif ()
Or in a toolchain file:
# ...
set(CMAKE_C_FLAGS_INIT "-fsanitize=memory ...")
set(HALIDE_TARGET_FEATURES "msan")
# ...
Roman Lebedev
@LebedevRI
indeed, this would be a middle-ish ground solution. the problem as i see it, the feature will not get enabled when -fsanitize=asan was specified via CFLAGS
Alex Reinking
@alexreinking:matrix.org
[m]
Yeah, I don't see that as a problem. I don't see any reason Halide should privilege CFLAGS above any other method of specification. It's not standard across all supported platforms and it's not complete on any platform. It's also likely to lead to surprising behavior in other places. No compiler that I'm aware of sniffs CFLAGS. Build systems, yes; compilers, no.
I could see maybe introducing an analogous environment variable like HLFEATURES
Roman Lebedev
@LebedevRI
and i mean that in more general sense than just parsing CFLAGS, because the bigger underlying problem is that e.g. -fsanitize=fuzzer-no-link internally enables -fsanitize-coverage=<...>
alexreinking: like in previous occurrences, by CFLAGS i don't literally mean the env variable, i mean the argument list that would have been passed to the clang/compiler
Alex Reinking
@alexreinking:matrix.org
[m]
Okay, but what if you're using GCC's coverage implementation?
We cannot be in the business of parsing third party compiler command lines
The person controlling the build is in charge of configuring their tools. Someone set -fsanitize=fuzzer-no-link. It's their responsibility to configure Halide as necessary, too. Just like if they were going to set CXXFLAGS or FFLAGS in the same project
Since CMake is our blessed build system and we prefer our AOT users to go through our helpers, adding a configuration point there makes the most sense to me.
Roman Lebedev
@LebedevRI
let me clarify: i personally would have viewed halide as an, essentially, 'alternative' clang-based front-end. is that already off-target?
Alex Reinking
@alexreinking:matrix.org
[m]
Yes, I think so. We are not clang based, we are LLVM based. If you want, you can build Halide and your generator executables on Windows, using MSVC, and produce binaries for Linux that are compatible with the toolchains there.
Roman Lebedev
@LebedevRI
hm wait, don't you at least use clang to get the initial AST?
Alex Reinking
@alexreinking:matrix.org
[m]
Nope
Roman Lebedev
@LebedevRI
aha
Alex Reinking
@alexreinking:matrix.org
[m]
We use any C++ compiler and package the compiler as a library into the resulting application. LLVM is linked in,, too.. You run that program, which produces an AST at execution time, which is passed either to MCJIT or to the usual LLVM pipeline to produce (essentially) an object file and header pair
This is to say that we are staged in C++ rather than being a subset of C++
Roman Lebedev
@LebedevRI
i see, thank you for pointing that out. somehow i missed that. can't say i like that, but it at least explains why things are the way they are
Alex Reinking
@alexreinking:matrix.org
[m]
Having the full power of C++ to metaprogram Halide and being able to piggyback off its tooling are major boons to Halide
Roman Lebedev
@LebedevRI
hm, also, no -mcpu=native?
Alex Reinking
@alexreinking:matrix.org
[m]
Target host
Roman Lebedev
@LebedevRI
that's cpu feature (isa set) detection, i'm talking about actual instruction scheduling
(but maybe i just didn't find it yet)
Alex Reinking
@alexreinking:matrix.org
[m]
Ah, not sure about that.
Roman Lebedev
@LebedevRI
are halide abi/api stability guarantees documented somewhere?
Alex Reinking
@alexreinking:matrix.org
[m]
We use semver.
So we maintain ABI stability within a major version, only add APIs within minor versions, and change neither within patch versions
The master branch has no guarantees at all