Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Excise abseil usage from iree/ #3848

Closed
33 of 34 tasks
benvanik opened this issue Nov 16, 2020 · 2 comments · Fixed by #6256
Closed
33 of 34 tasks

Excise abseil usage from iree/ #3848

benvanik opened this issue Nov 16, 2020 · 2 comments · Fixed by #6256
Assignees
Labels
ew 🤮 That shouldn't be that way and needs cleanup platform/generic 🔩 Bare metal/generic target build, execution, benchmarking, and deployment runtime/api IREE's public C runtime API and iree-run-module runtime Relating to the IREE runtime library

Comments

@benvanik
Copy link
Collaborator

benvanik commented Nov 16, 2020

Current usage under iree/ (excluding bindings/ and other non-core paths): https://gist.github.com/benvanik/9316c8bfd46d6910a1e996ac1427d6d4

It's cheap enough to keep around for tests and such, but it shouldn't be pulled into any end-user compiler or runtime binaries like it is now with flags/logging/etc that bring in 150-200KB of junk.

  • Replace usage of abseil flags in runtime binaries with something reasonable #3814: flags
  • Replace logging with a C log sink API #2843: logging (good to replace, but our core logging doesn't depend on abseil)
  • absl/base -> replace with iree/base/api.h or iree/base/threading.h (has most annotations already)
    • core_headers (used by statusor for absl::disjunction)
    • attributes.h
    • macros.h
    • thread_annotations.h
  • absl/container
    • flat_hash_map.h
    • flat_hash_set.h
    • inlined_vector.h
  • absl/memory/memory.h -> replace with iree/base/memory.h / std::make_unique / iree::wrap_unique
  • absl/strings
    • ascii.h
    • match.h
    • numbers.h
    • str_cat.h
    • str_format.h
    • str_join.h
    • str_replace.h
    • str_split.h
    • str_strip.h
    • string_view.h
  • absl/synchronization/mutex.h
    • use in IREE -> replace with iree/base/synchronization.h + optional c++ wrapper?)
    • VMA adapter - needs iree_mutex_t reader/writer lock support
  • absl/types
    • optional.h (std::optional in c++17)
    • span.h
    • variant.h (unused)
  • absl/utility
    • c++11 compat std::remove_cv_t etc
    • c++14 compat absl::exchange etc
    • c++17 compat std::disjunction etc
@benvanik benvanik self-assigned this Nov 16, 2020
@benvanik benvanik added this to the 2020Q4 Core milestone Nov 16, 2020
@benvanik benvanik added runtime/api IREE's public C runtime API and iree-run-module runtime Relating to the IREE runtime library labels Nov 20, 2020
@benvanik benvanik added the ew 🤮 That shouldn't be that way and needs cleanup label Nov 22, 2020
@benvanik benvanik removed this from the 2020Q4 Core milestone Nov 22, 2020
benvanik added a commit that referenced this issue Mar 24, 2021
This allowed for a lot of file IO code to go away - there was needless
abstraction here as there was only a single user of a lot of these things
that was already platform-specialized.

Progress on #4369 and #3848.
Fixes #4642.
Unblocks #3845, which can now be added cleanly.
benvanik added a commit that referenced this issue Mar 24, 2021
This allowed for a lot of file IO code to go away - there was needless
abstraction here as there was only a single user of a lot of these things
that was already platform-specialized.

Progress on #4369 and #3848.
Fixes #4642.
Unblocks #3845, which can now be added cleanly.

# Conflicts:
#	iree/hal/local/loaders/legacy_library_loader.c
benvanik added a commit that referenced this issue Mar 24, 2021
This allowed for a lot of file IO code to go away - there was needless
abstraction here as there was only a single user of a lot of these things
that was already platform-specialized.

Progress on #4369 and #3848.
Fixes #4642.
Unblocks #3845, which can now be added cleanly.

# Conflicts:
#	iree/hal/local/loaders/legacy_library_loader.c
benvanik added a commit that referenced this issue Mar 24, 2021
This allowed for a lot of file IO code to go away - there was needless
abstraction here as there was only a single user of a lot of these things
that was already platform-specialized.

Progress on #4369 and #3848.
Fixes #4642.
Unblocks #3845, which can now be added cleanly.

# Conflicts:
#	iree/hal/local/loaders/legacy_library_loader.c
benvanik added a commit that referenced this issue Mar 24, 2021
This allowed for a lot of file IO code to go away - there was needless
abstraction here as there was only a single user of a lot of these things
that was already platform-specialized.

Progress on #4369 and #3848.
Fixes #4642.
Unblocks #3845, which can now be added cleanly.

# Conflicts:
#	iree/hal/local/loaders/legacy_library_loader.c
benvanik added a commit that referenced this issue Mar 24, 2021
This allowed for a lot of file IO code to go away - there was needless
abstraction here as there was only a single user of a lot of these things
that was already platform-specialized.

Progress on #4369 and #3848.
Fixes #4642.
Unblocks #3845, which can now be added cleanly.

# Conflicts:
#	iree/hal/local/loaders/legacy_library_loader.c
benvanik added a commit that referenced this issue Mar 25, 2021
This allowed for a lot of file IO code to go away - there was needless
abstraction here as there was only a single user of a lot of these things
that was already platform-specialized.

Progress on #4369 and #3848.
Fixes #4642.
Unblocks #3845, which can now be added cleanly.

# Conflicts:
#	iree/hal/local/loaders/legacy_library_loader.c
benvanik added a commit that referenced this issue Mar 25, 2021
This allowed for a lot of file IO code to go away - there was needless
abstraction here as there was only a single user of a lot of these things
that was already platform-specialized.

Progress on #4369 and #3848.
Fixes #4642.
Unblocks #3845, which can now be added cleanly.
ScottTodd added a commit that referenced this issue Mar 30, 2021
…5254)

We use `std::make_unique` throughout the project. If we needed compatibility with older compilers, we could switch to `absl::make_unique` ([source](https://github.com/abseil/abseil-cpp/blob/9fde5a6eb081ea080f5aa895102a9154c3a2d09f/absl/memory/memory.h#L96-L103)) or add our own implementation without a dep on abseil (see #3848).
@ScottTodd ScottTodd self-assigned this Apr 1, 2021
@ScottTodd
Copy link
Member

Most of the simple replacements are done now (assuming no other undiscovered bugs >_>).

absl/strings, span, and flags are the notable dependencies left... and each of those will require some more principled work to migrate off of.

@benvanik
Copy link
Collaborator Author

benvanik commented Apr 8, 2021

I may try to take on flags soonish. VMLA replacement will drop most of our uses of Span. Dropping SIP (signature_parser) will remove some strings usage. HAL buffer_view/string_util are probably the trickiest core parts. Vulkan HAL still needs porting to C to drop the remaining Span usage in there.

@benvanik benvanik added the platform/generic 🔩 Bare metal/generic target build, execution, benchmarking, and deployment label Apr 18, 2021
benvanik added a commit that referenced this issue Apr 26, 2021
iree/hal/string_util.cc is almost ready to switch to C.
Progress on #3848.
benvanik added a commit that referenced this issue Apr 26, 2021
iree/hal/string_util.cc is almost ready to switch to C.
Progress on #3848.
benvanik added a commit that referenced this issue Apr 28, 2021
iree/hal/string_util.cc is almost ready to switch to C.
Progress on #3848.
benvanik added a commit that referenced this issue Apr 29, 2021
iree/hal/string_util.cc is almost ready to switch to C.
Progress on #3848.
benvanik added a commit that referenced this issue Jun 19, 2021
All remaining uses of abseil are in the python bindings.

Progress on #3848.
benvanik added a commit that referenced this issue Jun 19, 2021
All remaining uses of abseil are in the python bindings.

Progress on #3848.
benvanik added a commit that referenced this issue Jun 19, 2021
All remaining uses of abseil are in the python bindings.

Progress on #3848.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ew 🤮 That shouldn't be that way and needs cleanup platform/generic 🔩 Bare metal/generic target build, execution, benchmarking, and deployment runtime/api IREE's public C runtime API and iree-run-module runtime Relating to the IREE runtime library
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants