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

[Relax][Pass] Split CallTIR By Pattern #83

Merged
merged 15 commits into from Jan 27, 2023

Conversation

jinhongyii
Copy link
Member

WIP

@jinhongyii
Copy link
Member Author

The pass depends on op legalizer

@jinhongyii jinhongyii changed the title [Relax][Pass] Split Cutlass [Relax][Pass] Split CallTIR By Pattern Jan 4, 2023
@jinhongyii jinhongyii changed the base branch from structinfo to relax January 10, 2023 02:08
@jinhongyii
Copy link
Member Author

@spectrometerHBH @tqchen The split calltir pass and cutlass support is finished except pattern matching for convolution. It would be great if you can review it. Please ignore the op legalizer cherry-picked from Ruihang's branch. I will rebase it after legalizer is merged.

A_tvm = tvm.nd.array(A, dev)
B_tvm = tvm.nd.array(B, dev)
executable = tvm.runtime.load_module(filename)
result = f_run(executable, dev, A_tvm, B_tvm)
Copy link
Contributor

Choose a reason for hiding this comment

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

use before /expected tests ideally instead of execution test. exection test should go to a separate place under test_integration_trasnform_cutlass_codegen.py

Copy link
Member Author

Choose a reason for hiding this comment

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

I can't think of a way to add before/expected tests because after applying the pass there will be extern funcs, and extern funcs cannot be parsed

@jinhongyii
Copy link
Member Author

@tqchen @spectrometerHBH The new version of tir matching and library codegen has been done.

TVM_DEFINE_OBJECT_REF_METHODS(MatchResult, ObjectRef, MatchResultNode)
};

using FCodegen = runtime::TypedPackedFunc<Array<ObjectRef>(Array<MatchResult> match_results)>;
Copy link
Member

Choose a reason for hiding this comment

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

Codegen signature in principle is not part of tir pattern. Try to define it in other places.

include/tvm/relax/transform.h Show resolved Hide resolved
python/tvm/relax/transform/transform.py Show resolved Hide resolved
@spectrometerHBH spectrometerHBH merged commit 4b8be50 into mlc-ai:relax Jan 27, 2023
MasterJH5574 pushed a commit that referenced this pull request Jan 28, 2023
This PR implements the library dispatcher for Relax, which currently uses CUTLASS as one library.
It introduces the TIR-level pattern registration and matching algorithm.
It introduces a Relax pass to split out subgraphs that match the patterns of backends.
MasterJH5574 pushed a commit that referenced this pull request Jan 31, 2023
This PR implements the library dispatcher for Relax, which currently uses CUTLASS as one library.
It introduces the TIR-level pattern registration and matching algorithm.
It introduces a Relax pass to split out subgraphs that match the patterns of backends.
MasterJH5574 pushed a commit that referenced this pull request Feb 8, 2023
This PR implements the library dispatcher for Relax, which currently uses CUTLASS as one library.
It introduces the TIR-level pattern registration and matching algorithm.
It introduces a Relax pass to split out subgraphs that match the patterns of backends.
MasterJH5574 pushed a commit that referenced this pull request Feb 12, 2023
This PR implements the library dispatcher for Relax, which currently uses CUTLASS as one library.
It introduces the TIR-level pattern registration and matching algorithm.
It introduces a Relax pass to split out subgraphs that match the patterns of backends.
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.

None yet

3 participants