-
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
Finish support for list-of-targets #11382
Conversation
assert len(raw_targets) == 1 | ||
assert raw_targets[0].kind.name == "cuda" | ||
assert raw_targets[0].host.kind.name == "llvm" | ||
|
||
|
||
def test_canon_multi_target_and_host_6(): |
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.
Have you thought about structuring tests into classes according to the function under test?
Like
class TestCanonMultiTargetAndHost:
def test_with_tvm_objects(self):
# this test here
The names of tests can then be shorter and more descriptive at the same time.
This is more a question than a suggestion.
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.
Not really experienced with good pytest style, just mimicking whatever I happen to find already in place. Happy to try that if it's considered the preferred idiom?
2967ddd
to
44b654a
Compare
This finishes the work started in apache#11173 to support 'external codegen' targets in the N build-like API surfaces. - It turns out it's ok if a build is given only a single 'external codegen' target, so remove that check in CompilationConfig::Init. When Collage builds a 'candidate partition' it does so for a single target. As far as Collage is concerned it does not care whether the target is regular (eg Target("cuda")), or for a specific external codegen (eg Target("cutlass")), it just passes the target into the build. - Add CompilationConfig::FindPrimitiveTargetForKind which I'll later need to retrieve the external codegen Target instance corresponding to a "Compiler" attribute value. - Target.update_target_host_consist was supporting three API styles: - single target - map from device type to target - map from target to IRModule (for the ir_to_runtime API) I replaced all those calls with a more specialized 'canonicalize' call: - Target.canonicalize_target_and_host - Target.canonicalize_multi_targets_and_host - Target.canonicalize_target_map_and_host In particular, all the tuning interfaces (task extraction, tuning, tuning records) all explicitly *do not* support multiple targets since the underlying code just doesn't support that.
- Improve comments in compilation_config.h
- Rev micro library format from 5 to 6 - Use Target.current() in a few places
- Handle host already being in Target
- Take device type from target
8d0b92d
to
715daab
Compare
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.
This overall LGTM. Thank you @mbs-octoml!
Hi @mbs-octoml with this PR I'm seeing some warnings
|
This finishes the work started in #11173 to support
'external codegen' targets in the N build-like API surfaces, which in turn requires all the
Relay-level build interfaces to support list-of-targets instead of dictionary-of-targets. And
prepare for plumbing targets through the external codegen machinery.
(See https://discuss.tvm.apache.org/t/byoc-supporting-cutlass-byoc-with-collage/12796/6 for
more context on build/target changes, and https://github.com/apache/tvm-rfcs/blob/main/rfcs/0062-collage.md
for the overall Collage RFC).
It turns out it's ok if a build is given only a single 'external codegen' target, so remove that check
in CompilationConfig::Init. (When Collage builds a 'candidate partition' it does so for a single target.
As far as Collage is concerned it does not care whether the target is regular (eg Target("cuda")), or
for a specific external codegen (eg Target("cutlass")), it just passes the target into the build.)
Add CompilationConfig::FindPrimitiveTargetForKind which I'll later need to retrieve
the external codegen Target instance corresponding to a "Compiler" attribute value.
Target.update_target_host_consist was supporting three API styles:
I replaced all those calls with a more specialized 'canonicalize' call:
In particular, all the tuning interfaces (task extraction, tuning, tuning records) all explicitly
do not support multiple targets since that just doesn't make sense.
Rev the micro library format version from 5 to 6 since the 'target' attribute in the metadata.json
output is now an array rather than a dictionary. Remove the N uses of target.values() to follow
suite.