Skip to content
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

[Hexagon] Initial support for Hexagon codegen #6261

Merged
merged 4 commits into from
Aug 19, 2020
Merged

[Hexagon] Initial support for Hexagon codegen #6261

merged 4 commits into from
Aug 19, 2020

Conversation

kparzysz-quic
Copy link
Contributor

This commit does not support parallel execution or prefetch.

Copy link
Member

@FrozenGene FrozenGene left a comment

Choose a reason for hiding this comment

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

Brief review the codegen part, will spend more time next monday. One quick question, does this support HVX vector instruction generated?

src/target/llvm/codegen_hexagon.cc Outdated Show resolved Hide resolved
Krzysztof Parzyszek added 3 commits August 15, 2020 11:09
This commit does not support parallel execution or prefetch.
LLVM 7 or later is required.
@kparzysz-quic
Copy link
Contributor Author

HVX instructions are generated either by auto-vectorizing loops in LLVM, or by using vectorize schedule directive in TVM. The latter relies on CodeGenLLVM to generate vectorized LLVM IR.

Copy link
Member

@FrozenGene FrozenGene left a comment

Choose a reason for hiding this comment

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

Generally LGTM. Some comments are listed as following

python/tvm/contrib/hexagon.py Outdated Show resolved Hide resolved
src/target/llvm/codegen_hexagon.cc Show resolved Hide resolved
@FrozenGene FrozenGene merged commit 7aa2de3 into apache:master Aug 19, 2020
@FrozenGene
Copy link
Member

Thanks @kparzysz-quic merged. Wish we could do follow up work (code gen parallel and prefetch) and write one document how to deploy on hexagon.

@kparzysz-quic kparzysz-quic deleted the codegen-hexagon branch August 19, 2020 12:45
@kparzysz-quic
Copy link
Contributor Author

The reasons why prefetch and parallel are not supported in this PR are:

  1. The prefetch on Hexagon that we want to use is L2 rectangular prefetch (l2fetch), which works differently than the TVM's prefetch (at least at the time when we first added it). We made some changes to how TVM's prefetch works to accomodate it, and upstreaming that would require more discussion with the community.
  2. There is a bug in the parallelization code that I haven't had time to upstream a fix for. The fix that we have locally is not quite robust, so I'd have to develop a new one for upstreaming.

We wanted to get some basic Hexagon codegen working first, hence this PR.

We definitely plan to address the issues I mentioned above, it will just happen later.

trevor-m pushed a commit to trevor-m/tvm that referenced this pull request Aug 26, 2020
* [Hexagon] Initial support for Hexagon codegen

This commit does not support parallel execution or prefetch.
LLVM 7 or later is required.

* Set native_vector_bits_ based on target features

* Initialize hvx_bytes

* Remove commented out line
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request Aug 26, 2020
* [Hexagon] Initial support for Hexagon codegen

This commit does not support parallel execution or prefetch.
LLVM 7 or later is required.

* Set native_vector_bits_ based on target features

* Initialize hvx_bytes

* Remove commented out line
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request Aug 26, 2020
* [Hexagon] Initial support for Hexagon codegen

This commit does not support parallel execution or prefetch.
LLVM 7 or later is required.

* Set native_vector_bits_ based on target features

* Initialize hvx_bytes

* Remove commented out line
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request Sep 2, 2020
* [Hexagon] Initial support for Hexagon codegen

This commit does not support parallel execution or prefetch.
LLVM 7 or later is required.

* Set native_vector_bits_ based on target features

* Initialize hvx_bytes

* Remove commented out line
trevor-m pushed a commit to neo-ai/tvm that referenced this pull request Sep 3, 2020
* [Hexagon] Initial support for Hexagon codegen

This commit does not support parallel execution or prefetch.
LLVM 7 or later is required.

* Set native_vector_bits_ based on target features

* Initialize hvx_bytes

* Remove commented out line
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants