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

[Unity][MSC][pre M1.2] Reconstruct codegen #15813

Merged
merged 6 commits into from
Oct 7, 2023

Conversation

Archermmt
Copy link
Contributor

@Archermmt Archermmt commented Sep 24, 2023

This is a pull request for MSC(Multi-System Compile)
RFC: https://discuss.tvm.apache.org/t/rfc-unity-msc-introduction-to-multi-system-compiler/15251/5
Tracking issue: #15233

This is the pre-2nd part of Milestone 1: Finish RuntimeManager for frameworks

To limit each PR in reviewable size, the Milestone 1 will be split into some steps:
M1.1 Add translate && codegen for torch
pre M1.2 reconstruct codegen
M1.2 Add translate && codegen for tensorflow
M1.3 Add codegen for tensorrt
M1.4 Add RuntimeManager and test with relax
M1.5 Add RuntimeManager and test with torch
M1.6 Add RuntimeManager and test with tensorflow
M1.7 Add RuntimeManager and test with tensorrt

After I test some cases in tensorrt and tensorflow, I found out that the codegen module need to be reconstructed. To make the development in tensorflow and tensorrt better, This PR change the design of codegen.

@Hzfengsy
@junrushao

@Archermmt
Copy link
Contributor Author

@Lunderberg could you please check why the error occurs in CI test:

tests/python/relax/test_analysis_suggest_layout_transforms.py::test_non_affine_access [01:22:12] /workspace/src/relax/analysis/layout_transformation.cc:443: Warning: [LayoutInference] Failed to analyze indices [v_ax0 * v_ax1, v_ax2], error: ["Product of two iterators cannot be represented as an IterMap, occurs in v_ax0 * v_ax1"]

I found out that you meat the same error in #15810 and #15807, but no errors in #15815. Did you fixed the bug?

@Lunderberg
Copy link
Contributor

I had a couple of MSC-related CI failures, but they were mainly related to expected IRModule definitions needing to be updated for changed behavior. If I run the tests/python/relax/test_analysis_suggest_layout_transforms.py::test_non_affine_access on #15815, I get the same warning, but the test still passes.

image

Checking against the CI output for #15815 (link), I see the same non-affine warning occurring there as well, which makes sense for a test validating the behavior under a non-affine transform.

I'm wondering if we want to downgrade the LOG(WARNING) to a DLOG(INFO), since it is the expected behavior when analyzing a PrimFunc that is not an affine transformation.

@Lunderberg
Copy link
Contributor

(Made #15820, which updates the warning to an info.)

@Archermmt
Copy link
Contributor Author

Thanks! Now I understand....

@Hzfengsy Hzfengsy merged commit 59ec81f into apache:unity Oct 7, 2023
@Archermmt Archermmt deleted the msc_codegen branch October 9, 2023 13:07
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.

3 participants