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] Add more customization to support more targets #13450

Merged
merged 38 commits into from
Jan 10, 2023

Conversation

krishnaraj36
Copy link
Contributor

  1. Added custom cost module to provide a provision to incorporate custom cost estimator python function instead using default cost function.
    eg: cost_estimator = CustomCostEstimator(py_fn_estimator="tvm.relay.collage.opencl_cost_estimator")
    mod = CollagePartition(config, cost_estimator=cost_estimator)(mod)
  2. Added provision to select BYOC fusion style for all compiler target.
    eg : config = { "relay.collage.byoc_fusion_style": ["compiler.NoFusion", "compiler.TVMFusion"]}
    ctxt = tvm.transform.PassContext(config=config)

@tvm-bot
Copy link
Collaborator

tvm-bot commented Nov 21, 2022

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: collage See #10317 for details
  • Built docs for commit 912bf6d can be found here.

Generated by tvm-bot

@srkreddy1238
Copy link
Contributor

@mbs-octoml can you take a look on this PR ?

@srkreddy1238 srkreddy1238 requested a review from mbaret December 5, 2022 09:35
kvegiraj added 16 commits December 12, 2022 23:15
1. Added custom cost module to provide a provision to incorporate
custom cost estimator python function instead using default cost function.
   eg: cost_estimator = CustomCostEstimator(py_fn_estimator="tvm.relay.collage.opencl_cost_estimator")
       mod = CollagePartition(config, cost_estimator=cost_estimator)(mod)
2. Added provision to select BYOC fusion style for all compiler target.
   eg : config = { "relay.collage.byoc_fusion_style": ["compiler.NoFusion", "compiler.TVMFusion"]}
        ctxt = tvm.transform.PassContext(config=config)
Copy link
Contributor

@srkreddy1238 srkreddy1238 left a comment

Choose a reason for hiding this comment

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

LGTM.

@srkreddy1238
Copy link
Contributor

@tqchen Do we have moderator for Collage ?

@srkreddy1238
Copy link
Contributor

@masahi any moderator for Collage ?

@masahi
Copy link
Member

masahi commented Jan 5, 2023

Not sure and I'm not familiar with it either. But I can take care of this.

@krishnaraj36
Copy link
Contributor Author

@masahi :
I have resolved all merge conflicts on this PR, can you please review and merge this PR.

@krishnaraj36
Copy link
Contributor Author

krishnaraj36 commented Jan 6, 2023

Please remove typos and obvious grammar errors. I found many just looking over the code briefly. Please go through your change.

Also remove TODO(mbs) stuff.

@masahi
I have fixed the most of typo error and removed TODO (mbs), Please review and let me know your feedback.

src/relay/collage/custom_cost_estimator.cc Outdated Show resolved Hide resolved
src/relay/collage/custom_cost_estimator.h Outdated Show resolved Hide resolved
src/relay/collage/custom_cost_estimator.h Outdated Show resolved Hide resolved
src/relay/collage/custom_cost_estimator.h Outdated Show resolved Hide resolved
tests/python/contrib/test_clml/menangerie.py Outdated Show resolved Hide resolved
src/relay/collage/gather_partition_specs.cc Outdated Show resolved Hide resolved
src/relay/collage/gather_partition_specs.cc Outdated Show resolved Hide resolved
src/relay/collage/gather_partition_specs.cc Outdated Show resolved Hide resolved
src/relay/collage/gather_partition_specs.cc Show resolved Hide resolved
@krishnaraj36
Copy link
Contributor Author

krishnaraj36 commented Jan 9, 2023

@masahi
Thank you for feedback.
I have added modification to code as per your suggestion and wrote clarification for your few quarries.
Please review again and let me know you feedback.

src/relay/collage/gather_partition_specs.cc Outdated Show resolved Hide resolved
src/relay/collage/utils.cc Show resolved Hide resolved

logging.info(f"Invoking runner...")

os.system(f"python3 {runner_path}")
Copy link
Member

Choose a reason for hiding this comment

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

That doesn't answer my question. Why not, instead of runner_template thing and invoke the string with os.system, wrap the same functionality in a normal function and call it however time you want.

@krishnaraj36
Copy link
Contributor Author

@masahi
Thanks for feedback, I have added the modification to the code as per your suggestion.
Please review and let me know your feedback.

Copy link
Contributor Author

@krishnaraj36 krishnaraj36 left a comment

Choose a reason for hiding this comment

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

I have added the modification to the code as per your suggestion.
Please review and let me know your feedback.

@masahi masahi merged commit db920dd into apache:main Jan 10, 2023
@krishnaraj36 krishnaraj36 deleted the collage_update branch January 10, 2023 16:05
fzi-peccia pushed a commit to fzi-peccia/tvm that referenced this pull request Mar 27, 2023
* [COLLAGE] Add more customization to support more targets

1. Added custom cost module to provide a provision to incorporate
custom cost estimator python function instead using default cost function.
   eg: cost_estimator = CustomCostEstimator(py_fn_estimator="tvm.relay.collage.opencl_cost_estimator")
       mod = CollagePartition(config, cost_estimator=cost_estimator)(mod)
2. Added provision to select BYOC fusion style for all compiler target.
   eg : config = { "relay.collage.byoc_fusion_style": ["compiler.NoFusion", "compiler.TVMFusion"]}
        ctxt = tvm.transform.PassContext(config=config)

* Fix the lint errors

* Fix the lint error whitespace

* Fix the lint error tabs

* Fix the lint error tabs

* Fix the lint error tabs

* move the clml collage test case to test_clml

* Fix lint error whitespace

* Fix the import error

* Fix the envirnoment var and import

* Add comments

* Add clml preprocess module in cost estimator

* Fix whitespace lint error

* Fix whitespace lint error

* Fix whitespace lint error

* Fix the comments and removed unwanted code

* Fix whitespace error

* Removed Todo comments

* Removed TODO comments

* Updated naming convension

* Fix typo error

* Fixe the typo error

* Corrected typo error

* Corrected typo error

* Removed unused and fix typo error

* Removed redundent code and optimize the code

* Fix the lint error

* Fix whitespace lint error

* Removed Prints in file

* Fix lint error

* Fix lint error

* Removed runner template in test script

* Fix the lint error

* Fix lint error

* Fix lint error

* Fix the lint error

* Fix the lint error

Co-authored-by: kvegiraj <kvegiraj@qti.qualcomm.com>
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