-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[AOT] Introducing AOT in TVM #7785
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
Merged
Merged
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
f787a0a
[AOT] Introducing AOT in TVM
984e03e
Rebasing 2
ff439d4
Applying comments/refactoring
9370ed4
Fixing comments + refactoring - 2
837d8e4
fix linting
7d2cdf4
fix linting - 2
61ea6d3
fix linting - 3
559fcd2
fix tests
8cd223e
Addressing comments - 3
a236c8d
Addressing comments - 4
0b4b12e
fix tests - 2
0b108f4
fix tests - 3
0473a03
fix tests - 4
13a939c
Addressing comments - 5
6cb16f6
fix tests - 5
2d6e4df
fix tests - 6
4b5d18b
addressing comments - 6
371b6a6
fix linting - 4
7746727
add missing file
8f37fd3
fix build
e4a5fbb
addressing comments - 7
a3af874
addressing comments - 8
50a9403
rebasing
15a7b0d
Addressing comments - 9
ca11312
fix tests - 7
6151502
Addressing comments - 9
043787f
Applying comments + fixing tests
9a3a870
Applying comments - 10
358de45
Addressing comments - 11
9a67b3f
Addressing comments - 11
2dec740
fix tests - 7
f5db29e
fixing tests -8
5a02222
fixing tests - 9
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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one | ||
| * or more contributor license agreements. See the NOTICE file | ||
| * distributed with this work for additional information | ||
| * regarding copyright ownership. The ASF licenses this file | ||
| * to you under the Apache License, Version 2.0 (the | ||
| * "License"); you may not use this file except in compliance | ||
| * with the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, | ||
| * software distributed under the License is distributed on an | ||
| * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| * KIND, either express or implied. See the License for the | ||
| * specific language governing permissions and limitations | ||
| * under the License. | ||
| */ | ||
|
|
||
| // LINT_C_FILE | ||
| #ifndef TVM_RUNTIME_CRT_STACK_ALLOCATOR_H_ | ||
| #define TVM_RUNTIME_CRT_STACK_ALLOCATOR_H_ | ||
| #include <stddef.h> | ||
| #include <stdint.h> | ||
|
|
||
| #include "crt_config.h" | ||
| #include "error_codes.h" | ||
|
|
||
| #define STACK_ALLOCATOR_TAG 0xabcd1234 | ||
| #define STACK_ALLOCATOR_TAG_SIZE_BYTES 4 | ||
|
|
||
| /*! Memory alignment for allocator */ | ||
|
|
||
| #ifndef TVM_RUNTIME_ALLOC_ALIGNMENT_BYTES | ||
| #define TVM_RUNTIME_ALLOC_ALIGNMENT_BYTES 16 | ||
areusch marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| #endif | ||
|
|
||
| #ifdef __cplusplus | ||
| extern "C" { | ||
| #endif | ||
|
|
||
| typedef struct { | ||
| uint8_t* next_alloc; // Pointer to the next block of TVM_RUNTIME_ALLOC_ALIGNMENT_BYTES | ||
| uint8_t* workspace; // Pointer to start of the workspace | ||
| size_t workspace_size; // Total number of bytes in the workspace | ||
| } tvm_workspace_t; | ||
|
|
||
| tvm_crt_error_t StackMemoryManager_Init(tvm_workspace_t* tvm_runtime_workspace, | ||
| uint8_t* g_aot_memory, size_t workspace_size); | ||
|
|
||
| tvm_crt_error_t StackMemoryManager_Allocate(tvm_workspace_t* tvm_runtime_workspace, int32_t nbytes, | ||
| void**); | ||
|
|
||
| tvm_crt_error_t StackMemoryManager_Free(tvm_workspace_t* tvm_runtime_workspace, void* ptr); | ||
|
|
||
| #ifdef __cplusplus | ||
| } // extern "C" | ||
| #endif | ||
|
|
||
| #endif // TVM_RUNTIME_CRT_STACK_ALLOCATOR_H_ | ||
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one | ||
| * or more contributor license agreements. See the NOTICE file | ||
| * distributed with this work for additional information | ||
| * regarding copyright ownership. The ASF licenses this file | ||
| * to you under the Apache License, Version 2.0 (the | ||
| * "License"); you may not use this file except in compliance | ||
| * with the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, | ||
| * software distributed under the License is distributed on an | ||
| * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| * KIND, either express or implied. See the License for the | ||
| * specific language governing permissions and limitations | ||
| * under the License. | ||
| */ | ||
|
|
||
| /*! | ||
| * \file executor_info.h | ||
| * \brief Executor information | ||
| */ | ||
| #ifndef TVM_RUNTIME_EXECUTOR_INFO_H_ | ||
| #define TVM_RUNTIME_EXECUTOR_INFO_H_ | ||
|
|
||
| namespace tvm { | ||
| namespace runtime { | ||
|
|
||
| /*! \brief Value used to indicate the graph executor. */ | ||
| static constexpr const char* kTvmExecutorGraph = "graph"; | ||
|
|
||
| /*! \brief Value used to indicate the aot executor. */ | ||
| static constexpr const char* kTvmExecutorAot = "aot"; | ||
|
|
||
| } // namespace runtime | ||
| } // namespace tvm | ||
|
|
||
| #endif // TVM_RUNTIME_EXECUTOR_INFO_H_ |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Uh oh!
There was an error while loading. Please reload this page.