Skip to content

Commit

Permalink
[Fix] Misc fixes from tlc-pack#32, tlc-pack#42, tlc-pack#48, tlc-pack#54
Browse files Browse the repository at this point in the history
 (tlc-pack#57)

* [FIX][Pass] concurrent modification in RemoveUnusedVars (tlc-pack#32)

* [Pass] Fix concurrent modification in RemoveUnusedVars

When running RemoveUnusedVars (i.e. remove_all_unused), in some cases the map users will raise Concurrent modification error. This commit fixed it by changing the logic to "iterate the map first and update it later".

* change the algorithm by store keys first

* Add an ICHECK before getting map value

* change the information of the ICHECK

* fix find include path (tlc-pack#42)

Co-authored-by: Hongyi Jin <[email protected]>

* [BUG] ExternFunc is not considered in attach_global_symbol.cc (tlc-pack#48)

* [Cherry-Pick] Minor fix for TaskScheduler and VerifyGPUCode (tlc-pack#54)

* [Fix] Task scheduler error prompt upon build/run failure (#13601)

* [Fix] Use proper target in VerifyGPUCode (#13548)

Previously, the VerifyGPUCode post-processor uses hardcoded target `Target("cuda")` for applying pass LowerIntrin. This is a bit problematic since the actual target can be other GPU target (e.g., Metal). Therefore, this PR changes the hardcoded target to be the actual target.

Co-authored-by: Chaosfan <[email protected]>
Co-authored-by: Hongyi Jin <[email protected]>
Co-authored-by: Hongyi Jin <[email protected]>
Co-authored-by: Bohan Hou <[email protected]>
  • Loading branch information
5 people committed Feb 8, 2023
1 parent e7cfc35 commit ef5deb6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 5 additions & 3 deletions python/tvm/_ffi/libinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,11 @@ def find_include_path(name=None, search_path=None, optional=False):
include_path : list(string)
List of all found paths to header files.
"""
ffi_dir = os.path.dirname(os.path.abspath(os.path.expanduser(__file__)))
source_dir = os.path.join(ffi_dir, "..", "..", "..")

if os.environ.get("TVM_HOME", None):
source_dir = os.environ["TVM_HOME"]
else:
ffi_dir = os.path.dirname(os.path.abspath(os.path.expanduser(__file__)))
source_dir = os.path.join(ffi_dir, "..", "..", "..")
third_party_dir = os.path.join(source_dir, "3rdparty")

header_path = []
Expand Down
2 changes: 2 additions & 0 deletions src/relax/transform/attach_global_symbol.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ class GlobalSymbolAttacher {
func = WithAttr(GetRef<tir::PrimFunc>(prim_func), "global_symbol", p.first->name_hint);
} else if (auto* relax_func = func.as<FunctionNode>()) {
func = WithAttr(GetRef<Function>(relax_func), "global_symbol", p.first->name_hint);
} else if (auto* extern_func = func.as<ExternFuncNode>()) {
func = WithAttr(GetRef<ExternFunc>(extern_func), "global_symbol", p.first->name_hint);
} else {
LOG(FATAL) << "Unsupported function type: " << func->GetTypeKey();
throw;
Expand Down

0 comments on commit ef5deb6

Please sign in to comment.