Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 01:42
    steven-johnson synchronize #7181
  • 01:42

    steven-johnson on multitarget-metadata

    Update Makefile (compare)

  • 01:10
    steven-johnson synchronize #7181
  • 01:10

    steven-johnson on multitarget-metadata

    Update Makefile (compare)

  • 00:47
    steven-johnson review_requested #7182
  • 00:47
    steven-johnson opened #7182
  • 00:47

    steven-johnson on unreachable

    Disable unreachable-code clang-… (compare)

  • 00:28
    steven-johnson review_requested #7181
  • 00:28
    steven-johnson opened #7181
  • 00:28
    steven-johnson labeled #7181
  • 00:27

    steven-johnson on multitarget-metadata

    Fix metadata generation for mul… (compare)

  • Nov 28 22:23

    steven-johnson on xtensa-codegen

    README_python.md should be inst… Use n32:64 in RISC-V data layou… Add optional "function_info" he… and 2 more (compare)

  • Nov 28 22:23
    steven-johnson review_requested #7073
  • Nov 28 22:12
    steven-johnson synchronize #7102
  • Nov 28 22:12

    steven-johnson on svr

    Changes to *.py files should tr… (compare)

  • Nov 28 22:11

    steven-johnson on py-path-again

    (compare)

  • Nov 28 22:11

    steven-johnson on main

    Tweak the import paths in Pytho… (compare)

  • Nov 28 22:11
    steven-johnson closed #7179
  • Nov 28 22:10
    steven-johnson commented #7102
  • Nov 28 22:09
    steven-johnson synchronize #7102
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
And we branch off of master to release new major versions.
Zalman Stern
@zvookin
We’ve talked about adding pass through of fine grained LLVM parameters, such as one would want for choosing the microarchitecture to target. No such feature exists right now.