-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
[AOT] Support LLVM backend with C++ runtime #10753
Merged
Merged
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
3c44f7b
add get_c_struct_name() method to Metadata to distinguish struct type…
masahi 783aa43
add metadata serialization support to llvm codegen
masahi f991e19
Organize MetadataQueuer into a separate file.
areusch f6b1314
Add DiscoverArraysVisitor to metadata_utils
areusch e8e93fc
Fill DLTensor metadata in LegalizePackedCalls.
areusch 1477383
Improve error message from Call asserts
areusch 1641cfd
Pass non-String device_context down to codegen.
areusch 58da108
Scope usage of lvalue refs in LowerTVMBuiltin to avoid corrupt memory.
areusch cab2df8
test fixes
areusch 43ad6d4
Also fill preflattened_buffer_map (TODO, maybe don't do this)
areusch acba246
Fix C codegen.
areusch fe910e9
Set USMP elem_offset to 0.
areusch 1558cf7
Clarify calculation of byte_offset from elem_offset.
areusch 4290e28
fix tests
areusch 74283a7
Fix arm compile warning
areusch 3764385
Fix hexagon test.
areusch 48478c7
Document T.preflattened_buffer
areusch 4bf22e9
Fix test_aot_legalize_packed_calls
areusch 5de35ef
Address manupa comments
areusch d756d79
Fix convert_pool_allocations_to_offsets test.
areusch 6563534
lint
areusch e39deed
Fix T.preflattened_buffer
areusch f2138d5
Add preflattened_buffer_map to TIRTextPrinter
areusch c257f7f
Fix tests
areusch 4705a18
Fix BYOC
areusch 9642548
Fix invoking C device API.
areusch 66f0898
remove comments
areusch 1b36e6e
Address Mousius comments
areusch 792245a
lint
areusch 8bbb750
Merge remote-tracking branch 'origin/main' into mbmr-aot-llvm
areusch 131722e
lint
areusch ee1877c
Fix GMock linking on new CMake
areusch 374da00
address masahi comment
areusch File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -870,7 +870,8 @@ class PreflattenedBufferMap(SpecialStmt): | |
Example | ||
------- | ||
.. code-block:: python | ||
T.preflattened_buffer_map({}) | ||
A0 = T.match_buffer(A, (48,), dtype="float32") | ||
T.preflattened_buffer_map(A, (1, 4, 4, 3), elem_offset=1, align=4, dtype="float32") | ||
""" | ||
|
||
def __init__(self): | ||
|
@@ -892,12 +893,30 @@ def preflattened_buffer( | |
for key, value in self.context.func_buffer_map.items(): | ||
if value.same_as(postflattened): | ||
param = key | ||
break | ||
|
||
assert ( | ||
param is not None | ||
), f"Post-flatten buffer {postflattened.name} does not appear in the buffer map." | ||
|
||
if data is None: | ||
data = self.context.func_buffer_map[param].data | ||
|
||
buffer_name: str = f"{postflattened.name}_preflatten" | ||
if align != -1: | ||
if isinstance(align, IntImm): | ||
align = align.value | ||
else: | ||
assert isinstance(align, int), f"align: want int or IntImm, got {align!r}" | ||
|
||
if offset_factor != 0: | ||
if isinstance(offset_factor, IntImm): | ||
offset_factor = offset_factor.value | ||
else: | ||
assert isinstance( | ||
offset_factor, int | ||
), f"offset_factor: want int or IntImm, got {offset_factor!r}" | ||
|
||
Comment on lines
+902
to
+919
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could we add some unit tests for these cases? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
preflattened = tvm.tir.decl_buffer( | ||
shape, | ||
dtype, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add an
ASSERT_THROWS
test for this?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done