[Target][Codegen] Use target class in all codegens - #6347
Merged
zhiics merged 6 commits intoAug 29, 2020
Conversation
comaniac
requested changes
Aug 28, 2020
Member
Author
Member
|
Thanks @junrushao1994 @comaniac |
Contributor
|
The ROCm default detection seems to have been mangled to confuse ROCm version (software) with compute arch (hardware, e.g. gfx). I'll try to fix it. |
Member
Author
|
@t-vi Yes, the detection logic used previously in amdgpu codegen is here: https://github.com/apache/incubator-tvm/blob/e5b793f39fd5b4f84b0aedf06aa376ebe45cf2bc/src/target/llvm/codegen_amdgpu.cc#L194. Then I moved the logic to the target constructor to reveal it at earliest stage. |
Member
Author
|
@t-vi I see. We should change this line: https://github.com/apache/incubator-tvm/blob/master/src/target/target_kind.cc#L176, from |
Contributor
|
I'll just send a PR in a minute or so. |
kevinthesun
pushed a commit
to kevinthesun/tvm
that referenced
this pull request
Sep 17, 2020
* [Target][Codegen] Make all code generator use Target class instead of target string * Remove dep to TargetNode::str() in LLVM module * Allow for llvm nvptx codegen * ... * Address comments from Cody * Rename UpdateTargetConfig => UpdateTargetConfigKeyValueEntry
kevinthesun
pushed a commit
to kevinthesun/tvm
that referenced
this pull request
Sep 18, 2020
* [Target][Codegen] Make all code generator use Target class instead of target string * Remove dep to TargetNode::str() in LLVM module * Allow for llvm nvptx codegen * ... * Address comments from Cody * Rename UpdateTargetConfig => UpdateTargetConfigKeyValueEntry
trevor-m
pushed a commit
to neo-ai/tvm
that referenced
this pull request
Sep 18, 2020
* [Target][Codegen] Make all code generator use Target class instead of target string * Remove dep to TargetNode::str() in LLVM module * Allow for llvm nvptx codegen * ... * Address comments from Cody * Rename UpdateTargetConfig => UpdateTargetConfigKeyValueEntry
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR uses target class to replace almost all the raw target strings in all the codegen modules. It further helps with us migration towards a robost JSON-like targets configuration, per [RFC] TVM Target Specification.
The only place that uses raw string is what is stored in tvm_target in LLVM module's metadata. In this case, we know that we only care about "mtriple", "mattr", "mcpu", "mfloat-abi", so we only store those attributes in the metadata.
CC: @comaniac @jwfromm @jroesch @tqchen