Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Oct 03 22:29
    steven-johnson review_requested #7058
  • Oct 03 22:29
    steven-johnson opened #7058
  • Oct 03 22:28

    steven-johnson on wabt

    Upgrade wabt to 1.0.30 (compare)

  • Oct 03 21:30
    derek-gerstmann synchronize #6924
  • Oct 03 21:29

    derek-gerstmann on vulkan-phase2-runtime

    Whitespace change to trigger bu… (compare)

  • Oct 03 20:46
    steven-johnson commented #7057
  • Oct 03 20:44
    slomp commented #7057
  • Oct 03 20:17
    alexreinking commented #7057
  • Oct 03 20:07
    slomp commented #7057
  • Oct 03 19:08
    derek-gerstmann synchronize #6924
  • Oct 03 19:08

    derek-gerstmann on vulkan-phase2-runtime

    Fix PyExt error handling (#7042… add_requirement() maintenance (… Fix false positive use after fr… and 6 more (compare)

  • Oct 03 19:00
    derek-gerstmann commented #6924
  • Oct 03 18:43
    steven-johnson commented #6924
  • Oct 03 18:27

    rootjalex on trs-codegen

    update app Makefiles (compare)

  • Oct 03 18:20
    steven-johnson commented #7056
  • Oct 03 18:17
    steven-johnson closed #7055
  • Oct 03 18:17
    steven-johnson commented #7055
  • Oct 03 18:08
    steven-johnson closed #7033
  • Oct 03 14:35
    alexreinking synchronize #6938
  • Oct 03 14:35

    alexreinking on pip

    Run each arch in parallel (compare)

Roman Lebedev
@LebedevRI
alexreinking: thank you
Roman Lebedev
@LebedevRI
ah, hmm, so there is already some msan support, missed that
Yeah, we have m/t/asan feature flags
Roman Lebedev
@LebedevRI
yeah, somehow i didn't see msan
Alex Reinking
@alexreinking:matrix.org
[m]
It's not next to the others for some reason 🤷‍♂️
I was surprised when you said there was no msan support... I should have checked.
Roman Lebedev
@LebedevRI
i mean, msan pass isn't being run in CodeGen_LLVM::optimize_module(), unlike asan/tsan, there's custom instrumentation that all input buffers are defined, which is actually the right way do to this
Alex Reinking
@alexreinking:matrix.org
[m]
So you just need the coverage sanitizer still?
Roman Lebedev
@LebedevRI
"just"
Alex Reinking
@alexreinking:matrix.org
[m]
🙂
Roman Lebedev
@LebedevRI
there's also the question of translating -fsanitize to halide features
Alex Reinking
@alexreinking:matrix.org
[m]
In what sense?
Halide compiled with a sanitizer doesn't need to always produce binaries with that sanitizer
And vice versa...
Roman Lebedev
@LebedevRI
sure, that's not the question
Alex Reinking
@alexreinking:matrix.org
[m]
Okay, then where is this translation taking place?
Roman Lebedev
@LebedevRI
what i mean is, when i pass CFLAGS=-fsanitize=address, clang enables ASAN. will that just magically also enable halide's asan feature
?
Alex Reinking
@alexreinking:matrix.org
[m]
No, that's what I'm saying. It would be wrong to do that
Roman Lebedev
@LebedevRI
nono, not when compiling halide itself
e.g. when compiling halide/apps
Alex Reinking
@alexreinking:matrix.org
[m]
Clang doesn't read the CFLAGS env var AFAIK. CMake and Makefile default rules honor that variable when constructing compiler command lines.
Roman Lebedev
@LebedevRI
sure, i used env variable as an example
Alex Reinking
@alexreinking:matrix.org
[m]
I could see introducing Halide_TARGET_FEATURES as a CMake (package) variable to allow a user to add some features globally (through add_halide_library)
1 reply
-DHalide_TARGET_FEATURES=msan at the command line or set() it in a toolchain file
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