Skip to content

Conversation

@FranklandJack
Copy link
Contributor

Set the default -device= key for llvm targets based on the native architecture rather than hard coding to cpu which is x86 specific. This means that when llvm target triples are not specified we will test arm_cpu schedules on Arm®-based architectures and cpu schedules on x86 based architectures.

Fix any schedule test failures that result from this fix.

@tvm-bot
Copy link
Collaborator

tvm-bot commented May 30, 2023

Thanks for contributing to TVM! Please refer to the contributing guidelines https://tvm.apache.org/docs/contribute/ for useful information and tips. Please request code reviews from Reviewers by @-ing them in a comment.

  • No users to tag found in teams: target See #10317 for details

Generated by tvm-bot

@FranklandJack FranklandJack force-pushed the use-native-arch branch 3 times, most recently from 2b790f5 to 2d40ac0 Compare June 1, 2023 08:03
Copy link
Contributor

@ekalda ekalda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @FranklandJack, I think it's a really good improvement to the testing of Arm targets and lowering the amount of duplicated testing we do in the upstream CI. Mostly clarifications and nits...

@FranklandJack FranklandJack force-pushed the use-native-arch branch 2 times, most recently from 8b60c09 to 7150bd6 Compare June 6, 2023 09:18
Copy link
Contributor

@lhutton1 lhutton1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @FranklandJack, I think it's very important to be testing the arm_cpu schedules in CI. Just a couple of comments

Set the default `-device=` key for llvm targets based on the native
architecture rather than hard coding to `cpu` which is x86 specific.
This means that when llvm target triples are not specified  we will
test `arm_cpu` schedules on Arm®-based architectures and `cpu`
schedules on x86 based architectures.

Fix any schedule test failures that result from this fix.
lhutton1 added a commit to lhutton1/tvm that referenced this pull request Feb 2, 2024
… user

Currently, when a default compile target such as llvm is specified,
it implies llvm -keys=cpu which tends to imply x86 related components
being used during compilation e.g. the schedules registered in TOPI.
This can be confusing for a user when compiling on other architectures,
especially when other tools such as llc infer the default target
based on the host.

When the target kind is llvm, this commit uses the
"target.llvm_get_system_triple" functionality to automatically detect
mtriple when one has not been provided in the target string. The
target will be updated to one that uses the mtriple of the host:
llvm -> llvm -mtriple=<system-triple>. When compiling on Arm(R)-based
targets, this has the added benfit of automatially introducing
-keys=arm_cpu to the target improving the schedule selection.

Lots of tests are currently using targets such as llvm or similar
which has resulted in a lack of coverage of other targets such as
arm_cpu. As part of this commit, failing test cases which have simple
/ obvious issues have been fixed. Others that likely need more thought
have been skipped. In doing so, it reduces the number of modifications
and simplifies the review for this change.

Note: This PR is marked as draft while checking and fixing other
failures in CI. Tests marked as skipped containing "<Issue link>" in the
reason will be have issues added and the related reason will be updated
when CI is green.

This commit is a follow up of the changes made in: apache#14981

Co-authored-by: Jack Frankland <[email protected]>

Change-Id: Icee7f5c00d58fc77367c823273fccae128260471
lhutton1 added a commit to lhutton1/tvm that referenced this pull request Feb 2, 2024
… user

Currently, when a default compile target such as llvm is specified,
it implies llvm -keys=cpu which tends to imply x86 related components
being used during compilation e.g. the schedules registered in TOPI.
This can be confusing for a user when compiling on other architectures,
especially when other tools such as llc infer the default target
based on the host.

When the target kind is llvm, this commit uses the
"target.llvm_get_system_triple" functionality to automatically detect
mtriple when one has not been provided in the target string. The
target will be updated to one that uses the mtriple of the host:
llvm -> llvm -mtriple=<system-triple>. When compiling on Arm(R)-based
targets, this has the added benfit of automatially introducing
-keys=arm_cpu to the target improving the schedule selection.

Lots of tests are currently using targets such as llvm or similar
which has resulted in a lack of coverage of other targets such as
arm_cpu. As part of this commit, failing test cases which have simple
/ obvious issues have been fixed. Others that likely need more thought
have been skipped. In doing so, it reduces the number of modifications
and simplifies the review for this change.

Note: This PR is marked as draft while checking and fixing other
failures in CI. Tests marked as skipped containing "<Issue link>" in the
reason will be have issues added and the related reason will be updated
when CI is green.

This commit is a follow up of the changes made in: apache#14981

Change-Id: Icee7f5c00d58fc77367c823273fccae128260471
Co-authored-by: Jack Frankland <[email protected]>
lhutton1 added a commit to lhutton1/tvm that referenced this pull request Feb 12, 2024
… user

Currently, when a default compile target such as llvm is specified,
it implies llvm -keys=cpu which tends to imply x86 related components
being used during compilation e.g. the schedules registered in TOPI.
This can be confusing for a user when compiling on other architectures,
especially when other tools such as llc infer the default target
based on the host.

When the target kind is llvm, this commit uses the
"target.llvm_get_system_triple" functionality to automatically detect
mtriple when one has not been provided in the target string. The
target will be updated to one that uses the mtriple of the host:
llvm -> llvm -mtriple=<system-triple>. When compiling on Arm(R)-based
targets, this has the added benfit of automatially introducing
-keys=arm_cpu to the target improving the schedule selection.

Lots of tests are currently using targets such as llvm or similar
which has resulted in a lack of coverage of other targets such as
arm_cpu. As part of this commit, failing test cases which have simple
/ obvious issues have been fixed. Others that likely need more thought
have been skipped. In doing so, it reduces the number of modifications
and simplifies the review for this change.

Note: This PR is marked as draft while checking and fixing other
failures in CI. Tests marked as skipped containing "<Issue link>" in the
reason will be have issues added and the related reason will be updated
when CI is green.

This commit is a follow up of the changes made in: apache#14981

Change-Id: Icee7f5c00d58fc77367c823273fccae128260471
Co-authored-by: Jack Frankland <[email protected]>
ekalda pushed a commit that referenced this pull request Mar 14, 2024
… user (#16513)

Currently, when a default compile target such as llvm is specified,
it implies llvm -keys=cpu which tends to imply x86 related components
being used during compilation e.g. the schedules registered in TOPI.
This can be confusing for a user when compiling on other architectures,
especially when other tools such as llc infer the default target
based on the host.

When the target kind is llvm, this commit uses the
"target.llvm_get_system_triple" functionality to automatically detect
mtriple when one has not been provided in the target string. The
target will be updated to one that uses the mtriple of the host:
llvm -> llvm -mtriple=<system-triple>. When compiling on Arm(R)-based
targets, this has the added benfit of automatially introducing
-keys=arm_cpu to the target improving the schedule selection.

Lots of tests are currently using targets such as llvm or similar
which has resulted in a lack of coverage of other targets such as
arm_cpu. As part of this commit, failing test cases which have simple
/ obvious issues have been fixed. Others that likely need more thought
have been skipped. In doing so, it reduces the number of modifications
and simplifies the review for this change.


This commit is a follow up of the changes made in: #14981

Change-Id: Icee7f5c00d58fc77367c823273fccae128260471
Co-authored-by: Jack Frankland <[email protected]>


---------


Co-authored-by: Jack Frankland <[email protected]>
thaisacs pushed a commit to thaisacs/tvm that referenced this pull request Apr 3, 2024
… user (apache#16513)

Currently, when a default compile target such as llvm is specified,
it implies llvm -keys=cpu which tends to imply x86 related components
being used during compilation e.g. the schedules registered in TOPI.
This can be confusing for a user when compiling on other architectures,
especially when other tools such as llc infer the default target
based on the host.

When the target kind is llvm, this commit uses the
"target.llvm_get_system_triple" functionality to automatically detect
mtriple when one has not been provided in the target string. The
target will be updated to one that uses the mtriple of the host:
llvm -> llvm -mtriple=<system-triple>. When compiling on Arm(R)-based
targets, this has the added benfit of automatially introducing
-keys=arm_cpu to the target improving the schedule selection.

Lots of tests are currently using targets such as llvm or similar
which has resulted in a lack of coverage of other targets such as
arm_cpu. As part of this commit, failing test cases which have simple
/ obvious issues have been fixed. Others that likely need more thought
have been skipped. In doing so, it reduces the number of modifications
and simplifies the review for this change.


This commit is a follow up of the changes made in: apache#14981

Change-Id: Icee7f5c00d58fc77367c823273fccae128260471
Co-authored-by: Jack Frankland <[email protected]>


---------


Co-authored-by: Jack Frankland <[email protected]>
@lhutton1
Copy link
Contributor

Closing as superseded by: #16513

@lhutton1 lhutton1 closed this Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants