Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 20:51
    steven-johnson opened #7220
  • 20:51

    steven-johnson on v8-asserts

    Remove check_jit_user_context()… (compare)

  • 20:37
    steven-johnson synchronize #7216
  • 20:37

    steven-johnson on run-simd-op-check

    Fix simd_op_check_wasm (compare)

  • 19:10
    steven-johnson synchronize #7216
  • 19:10

    steven-johnson on run-simd-op-check

    trigger buildbots (compare)

  • 19:10
    steven-johnson synchronize #7206
  • 19:10

    steven-johnson on aligned-alloc-2

    trigger buildbots (compare)

  • 19:09
    steven-johnson synchronize #7206
  • 19:09

    steven-johnson on aligned-alloc-2

    clang-tidy: add [[maybe-unused]… Fix bonehead version-checking t… Merge branch 'main' into srj/al… and 1 more (compare)

  • 19:04
    rootjalex assigned #7219
  • 18:11
    steven-johnson synchronize #7206
  • 18:11

    steven-johnson on aligned-alloc-2

    fix wasm (compare)

  • 17:26

    steven-johnson on xt-align-alloc-2

    Merge branch 'main' into srj/al… Merge branch 'srj/aligned-alloc… (compare)

  • 16:53
    steven-johnson synchronize #7216
  • 16:53

    steven-johnson on run-simd-op-check

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

  • 15:53
    Aelphy edited #7214
  • 15:51
    Aelphy edited #7214
  • 15:50
    Aelphy synchronize #7214
  • 15:31
    Aelphy synchronize #7214
Alex Reinking
@alexreinking:matrix.org
[m]
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.
If we do it as a string pass through, it’s pretty easy to implement. Part if the idea of Target was to provide a better API to configuring the backend. So commonly used things may still get surfaced there, but there is no way we’re going to put all of LLVM’s flags in Target.
There is also the issue of being able to pass in string arguments that conflict with something Halide is passing to LLVM via e.g. mcpu or mattrs.
Zalman Stern
@zvookin
E.g. some of the codegen classes make an arbitrary choice of microarchitecture to pass to LLVM. Thus it might be useful for the API Target provides to specify that should be turned off.
Hopefully this helps but the tl;dr is the feature doesn’t exist yet but we should add it.
Where “we” means anyone is welcome to take a crack at doing so :-)
Alex Reinking
@alexreinking:matrix.org
[m]
Worth discussing at our post holiday dev meeting
Zalman Stern
@zvookin
Oh, there is an environment variable to pass arbitrary args to LLVM at init time.
Can be used as a hack, but not good for anything production.