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

[Collage] SubGraphs #11981

Merged
merged 4 commits into from
Jul 11, 2022
Merged

[Collage] SubGraphs #11981

merged 4 commits into from
Jul 11, 2022

Conversation

mbs-octoml
Copy link
Contributor

@mbs-octoml mbs-octoml commented Jun 30, 2022

See https://github.com/apache/tvm-rfcs/blob/main/rfcs/0062-collage.md.

Collage works in units of 'sub-graphs', which are potential partitions of the
overall Relay model. This PR introduces SubGraph (an arbitrary partitioning, without
any implication about how it is to be represented), it's companion SubSubGraph
(implying a representation as a function), and some supporting odds 'n ends.

@mbs-octoml
Copy link
Contributor Author

@mbaret, thanks.

@mbs-octoml
Copy link
Contributor Author

green and ready for review

mbs-octoml added a commit to mbs-octoml/mbs-tvm that referenced this pull request Jul 1, 2022
See https://github.com/apache/tvm-rfcs/blob/main/rfcs/0062-collage.md.

(Special thanks to Matthew Barrett for authoring partition_rule_test.cc and suggesting a PR
partitioning strategy.)

Collage uses a small 'combinator library' of PartitionRule to decribe how candidate partitions
can be extracted from a model for measurement and comparison. This introduces most of that
machinery, however we defer the all important 'CombinerPartitionRule' for the next PR. Thus
the rules at this stage can only express the sorts of DFPattern-based rules we find in most
BYOC integrations, and cannot describe rules more traditionally associated with operator fusion.

Based on apache#11981.
mbs-octoml added a commit to mbs-octoml/mbs-tvm that referenced this pull request Jul 1, 2022
See https://github.com/apache/tvm-rfcs/blob/main/rfcs/0062-collage.md.

(Special thanks to Matthew Barrett for authoring partition_rule_test.cc and suggesting a PR
partitioning strategy.)

Collage uses a small 'combinator library' of PartitionRule to decribe how candidate partitions
can be extracted from a model for measurement and comparison. This introduces most of that
machinery, however we defer the all important 'CombinerPartitionRule' for the next PR. Thus
the rules at this stage can only express the sorts of DFPattern-based rules we find in most
BYOC integrations, and cannot describe rules more traditionally associated with operator fusion.

Based on apache#11981.
@SebastianBoblest
Copy link
Contributor

I read this out of curiosity, I cannot review this on a technical level.
On a fundamental level the code looks great though.

Copy link
Contributor

@mbaret mbaret left a comment

Choose a reason for hiding this comment

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

Largely looks good to me, couple of points around naming. It's tacitly acknowledged that more of this infrastructure will get exercised by tests in later PRs.

src/relay/collage/README.md Show resolved Hide resolved
src/relay/collage/sub_graph.h Outdated Show resolved Hide resolved
src/relay/collage/sub_graph.h Outdated Show resolved Hide resolved
src/relay/collage/sub_graph.h Outdated Show resolved Hide resolved
See https://github.com/apache/tvm-rfcs/blob/main/rfcs/0062-collage.md.

Collage works in units of 'sub-graphs', which are potential partitions of the
overall Relay model. This PR introduces SubGraph (an arbitrary partitioning, without
any implication about how it is to be represented), it's companion SubSubGraph
(implying a representation as a function), and some supporting odds 'n ends.
- make 'Compiler' name explicit
@mbs-octoml
Copy link
Contributor Author

Thanks @SebastianBoblest, every little bit helps.

Thanks and PTAL @mbaret.

Copy link
Contributor

@mbaret mbaret left a comment

Choose a reason for hiding this comment

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

LGTM

@masahi masahi merged commit 5be8e0a into apache:main Jul 11, 2022
mbs-octoml added a commit to mbs-octoml/mbs-tvm that referenced this pull request Jul 11, 2022
See https://github.com/apache/tvm-rfcs/blob/main/rfcs/0062-collage.md.

(Special thanks to Matthew Barrett for authoring partition_rule_test.cc and suggesting a PR
partitioning strategy.)

Collage uses a small 'combinator library' of PartitionRule to decribe how candidate partitions
can be extracted from a model for measurement and comparison. This introduces most of that
machinery, however we defer the all important 'CombinerPartitionRule' for the next PR. Thus
the rules at this stage can only express the sorts of DFPattern-based rules we find in most
BYOC integrations, and cannot describe rules more traditionally associated with operator fusion.

Based on apache#11981.
@mbs-octoml mbs-octoml deleted the mbs-collage-subgraph branch July 11, 2022 21:09
mbaret pushed a commit that referenced this pull request Jul 12, 2022
* [Collage] PartitionRule (though without CombinePartitionRule)

See https://github.com/apache/tvm-rfcs/blob/main/rfcs/0062-collage.md.

(Special thanks to Matthew Barrett for authoring partition_rule_test.cc and suggesting a PR
partitioning strategy.)

Collage uses a small 'combinator library' of PartitionRule to decribe how candidate partitions
can be extracted from a model for measurement and comparison. This introduces most of that
machinery, however we defer the all important 'CombinerPartitionRule' for the next PR. Thus
the rules at this stage can only express the sorts of DFPattern-based rules we find in most
BYOC integrations, and cannot describe rules more traditionally associated with operator fusion.

Based on #11981.

* - Backport improvements to partiton_rule_test.cc

* - Oops
masahi pushed a commit to masahi/tvm that referenced this pull request Jul 15, 2022
* [Collage] SubGraphs

See https://github.com/apache/tvm-rfcs/blob/main/rfcs/0062-collage.md.

Collage works in units of 'sub-graphs', which are potential partitions of the
overall Relay model. This PR introduces SubGraph (an arbitrary partitioning, without
any implication about how it is to be represented), it's companion SubSubGraph
(implying a representation as a function), and some supporting odds 'n ends.

* - make Integer <-> size_t conversion explicit
- make 'Compiler' name explicit

* - fix namespace ambiguity

* - review comments
masahi pushed a commit to masahi/tvm that referenced this pull request Jul 15, 2022
…#11993)

* [Collage] PartitionRule (though without CombinePartitionRule)

See https://github.com/apache/tvm-rfcs/blob/main/rfcs/0062-collage.md.

(Special thanks to Matthew Barrett for authoring partition_rule_test.cc and suggesting a PR
partitioning strategy.)

Collage uses a small 'combinator library' of PartitionRule to decribe how candidate partitions
can be extracted from a model for measurement and comparison. This introduces most of that
machinery, however we defer the all important 'CombinerPartitionRule' for the next PR. Thus
the rules at this stage can only express the sorts of DFPattern-based rules we find in most
BYOC integrations, and cannot describe rules more traditionally associated with operator fusion.

Based on apache#11981.

* - Backport improvements to partiton_rule_test.cc

* - Oops
junrushao pushed a commit to yelite/tvm that referenced this pull request Jul 27, 2022
* [Collage] SubGraphs

See https://github.com/apache/tvm-rfcs/blob/main/rfcs/0062-collage.md.

Collage works in units of 'sub-graphs', which are potential partitions of the
overall Relay model. This PR introduces SubGraph (an arbitrary partitioning, without
any implication about how it is to be represented), it's companion SubSubGraph
(implying a representation as a function), and some supporting odds 'n ends.

* - make Integer <-> size_t conversion explicit
- make 'Compiler' name explicit

* - fix namespace ambiguity

* - review comments
junrushao pushed a commit to yelite/tvm that referenced this pull request Jul 27, 2022
…#11993)

* [Collage] PartitionRule (though without CombinePartitionRule)

See https://github.com/apache/tvm-rfcs/blob/main/rfcs/0062-collage.md.

(Special thanks to Matthew Barrett for authoring partition_rule_test.cc and suggesting a PR
partitioning strategy.)

Collage uses a small 'combinator library' of PartitionRule to decribe how candidate partitions
can be extracted from a model for measurement and comparison. This introduces most of that
machinery, however we defer the all important 'CombinerPartitionRule' for the next PR. Thus
the rules at this stage can only express the sorts of DFPattern-based rules we find in most
BYOC integrations, and cannot describe rules more traditionally associated with operator fusion.

Based on apache#11981.

* - Backport improvements to partiton_rule_test.cc

* - Oops
xinetzone pushed a commit to daobook/tvm that referenced this pull request Nov 25, 2022
* [Collage] SubGraphs

See https://github.com/apache/tvm-rfcs/blob/main/rfcs/0062-collage.md.

Collage works in units of 'sub-graphs', which are potential partitions of the
overall Relay model. This PR introduces SubGraph (an arbitrary partitioning, without
any implication about how it is to be represented), it's companion SubSubGraph
(implying a representation as a function), and some supporting odds 'n ends.

* - make Integer <-> size_t conversion explicit
- make 'Compiler' name explicit

* - fix namespace ambiguity

* - review comments
xinetzone pushed a commit to daobook/tvm that referenced this pull request Nov 25, 2022
…#11993)

* [Collage] PartitionRule (though without CombinePartitionRule)

See https://github.com/apache/tvm-rfcs/blob/main/rfcs/0062-collage.md.

(Special thanks to Matthew Barrett for authoring partition_rule_test.cc and suggesting a PR
partitioning strategy.)

Collage uses a small 'combinator library' of PartitionRule to decribe how candidate partitions
can be extracted from a model for measurement and comparison. This introduces most of that
machinery, however we defer the all important 'CombinerPartitionRule' for the next PR. Thus
the rules at this stage can only express the sorts of DFPattern-based rules we find in most
BYOC integrations, and cannot describe rules more traditionally associated with operator fusion.

Based on apache#11981.

* - Backport improvements to partiton_rule_test.cc

* - Oops
mikeseven pushed a commit to mikeseven/tvm that referenced this pull request Sep 27, 2023
* [Collage] SubGraphs

See https://github.com/apache/tvm-rfcs/blob/main/rfcs/0062-collage.md.

Collage works in units of 'sub-graphs', which are potential partitions of the
overall Relay model. This PR introduces SubGraph (an arbitrary partitioning, without
any implication about how it is to be represented), it's companion SubSubGraph
(implying a representation as a function), and some supporting odds 'n ends.

* - make Integer <-> size_t conversion explicit
- make 'Compiler' name explicit

* - fix namespace ambiguity

* - review comments
mikeseven pushed a commit to mikeseven/tvm that referenced this pull request Sep 27, 2023
…#11993)

* [Collage] PartitionRule (though without CombinePartitionRule)

See https://github.com/apache/tvm-rfcs/blob/main/rfcs/0062-collage.md.

(Special thanks to Matthew Barrett for authoring partition_rule_test.cc and suggesting a PR
partitioning strategy.)

Collage uses a small 'combinator library' of PartitionRule to decribe how candidate partitions
can be extracted from a model for measurement and comparison. This introduces most of that
machinery, however we defer the all important 'CombinerPartitionRule' for the next PR. Thus
the rules at this stage can only express the sorts of DFPattern-based rules we find in most
BYOC integrations, and cannot describe rules more traditionally associated with operator fusion.

Based on apache#11981.

* - Backport improvements to partiton_rule_test.cc

* - Oops
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.

4 participants