Skip to content

Small fixes for LLVM AOT backend on Windows. - #3786

Merged
benvanik merged 2 commits into
iree-org:benvanik-aot-windowsfrom
ScottTodd:aot-windows-fixes
Nov 14, 2020
Merged

benvanik merged 2 commits into
iree-org:benvanik-aot-windowsfrom
ScottTodd:aot-windows-fixes

Conversation

@ScottTodd

Copy link
Copy Markdown
Member

Found while testing #3757

@ScottTodd ScottTodd added compiler/dialects Relating to the IREE compiler dialects (flow, hal, vm) platform/windows 🚪 Windows-specific build, execution, benchmarking, and deployment labels Nov 11, 2020
@ScottTodd
ScottTodd requested a review from benvanik November 11, 2020 16:24
@google-cla google-cla Bot added the cla: yes label Nov 11, 2020
@ScottTodd

Copy link
Copy Markdown
Member Author

Errors on CI (e.g. in layers_dynamic_batch_tests__layer__Dropout__target_backends__iree_llvmjit) but I can't tell from the logs if they are related to these changes...

@benvanik

Copy link
Copy Markdown
Collaborator

yeah I think the base PR has the same failures on the CI - I have no idea why because the logs are useless and we have no artifacts - it's why I haven't made any progress on that :)

// executable_library_.release();
#if IREE_TRACING_FEATURES & IREE_TRACING_FEATURE_INSTRUMENTATION
// Leak the library when tracing, since the profiler may still be reading it.
executable_library_.release();

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason I had still TODO'd this was because I want to make sure msan is still ok with this happening. An atexit handler that actually released things, the msan annotation to disable leak checker on a pointer, etc are what we need to play with. This is fine for the branch but you should leave the TODO as it's not really a solution that will work.

Also, we need the CI to run msan (/asan/etc) as well as with tracing flags enabled - none of this is covered right now and that's silly.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trying to run under MSAN now...

  • We don't have an MSAN Bazel config (only ASAN)
  • Using our CMake config, I get blocking errors just trying to build iree_tools_iree-translate or iree_tools_iree-run-module. First here, then in mlir-tblgen and llvm-tblegen somewhere

I'll spend a bit more time on it and see if I can fix the current issues. atexit seems reasonable, or the TODO could be added back.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, running MSAN and ASAN was tricky, but I don't see any warnings/errors for executable_library_.release();.

There are a few things in https://github.com/abseil/abseil-cpp/blob/master/absl/debugging/leak_check.h we could use if it later becomes an issue.

I'm not concerned about this if we only trace in development builds. If we determine that tracing is cheap enough to always enable then we should care much more :P

WDYT?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Restored the TODO with a bit more info.

@benvanik
benvanik merged commit ddee03b into iree-org:benvanik-aot-windows Nov 14, 2020
benvanik pushed a commit that referenced this pull request Nov 14, 2020
* Fix handling when IREE_LLVMAOT_LINKER_PATH is not set.

* Intentionally leak dylib libraries on exit when tracing.
@ScottTodd
ScottTodd deleted the aot-windows-fixes branch November 14, 2020 18:01
benvanik pushed a commit that referenced this pull request Nov 18, 2020
* Fix handling when IREE_LLVMAOT_LINKER_PATH is not set.

* Intentionally leak dylib libraries on exit when tracing.
ScottTodd added a commit to ScottTodd/iree that referenced this pull request Nov 18, 2020
* Fix handling when IREE_LLVMAOT_LINKER_PATH is not set.

* Intentionally leak dylib libraries on exit when tracing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

compiler/dialects Relating to the IREE compiler dialects (flow, hal, vm) platform/windows 🚪 Windows-specific build, execution, benchmarking, and deployment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants