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

Add optional lowering to Host IR in FusionKernelRuntime #3835

Open
wants to merge 55 commits into
base: main
Choose a base branch
from

Conversation

nsarka
Copy link
Member

@nsarka nsarka commented Feb 5, 2025

This PR adds milestone 2 from Jingyue's document Initial Integration of Host IR to FusionExecutorCache

It adds an optional codepath in FusionKernelRuntime (FKR) to lower a fusion to Host IR. When enabled, FKR will create a HostIrEvaluator, which has a container that all of the fusion's expressions are pushed to. Expressions lowered to a kernel are launched with the LaunchKernel HostIr.

@nsarka nsarka self-assigned this Feb 5, 2025
csrc/host_ir/container.h Outdated Show resolved Hide resolved
csrc/host_ir/container.h Outdated Show resolved Hide resolved
csrc/runtime/fusion_kernel_runtime.cpp Show resolved Hide resolved
csrc/runtime/fusion_kernel_runtime.cpp Outdated Show resolved Hide resolved
csrc/runtime/fusion_kernel_runtime.cpp Outdated Show resolved Hide resolved
tests/cpp/test_host_ir_integration.cpp Outdated Show resolved Hide resolved
csrc/host_ir/container.cpp Outdated Show resolved Hide resolved
csrc/runtime/fusion_kernel_runtime.cpp Outdated Show resolved Hide resolved
tests/cpp/test_host_irs.cpp Outdated Show resolved Hide resolved
csrc/host_ir/host_ir.cpp Outdated Show resolved Hide resolved
Copy link
Collaborator

@wujingyue wujingyue left a comment

Choose a reason for hiding this comment

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

Thanks! I think we have all the logic there -- it'll just be a matter of code motion and refactor.

nsarka and others added 3 commits February 7, 2025 13:59
Copy link
Collaborator

@samnordmann samnordmann left a comment

Choose a reason for hiding this comment

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

The integration looks good and clean, thank you! I just left a couple of questions/remarks

csrc/host_ir/host_ir.h Outdated Show resolved Hide resolved
csrc/host_ir/container.cpp Outdated Show resolved Hide resolved
csrc/host_ir/container.h Outdated Show resolved Hide resolved
csrc/host_ir/executor.cpp Outdated Show resolved Hide resolved
csrc/host_ir/container.h Show resolved Hide resolved
Copy link
Collaborator

@wujingyue wujingyue left a comment

Choose a reason for hiding this comment

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

Almost there!

csrc/host_ir/container.h Outdated Show resolved Hide resolved
csrc/host_ir/host_ir.cpp Outdated Show resolved Hide resolved
csrc/runtime/fusion_kernel_runtime.cpp Show resolved Hide resolved
csrc/runtime/fusion_kernel_runtime.cpp Outdated Show resolved Hide resolved
csrc/runtime/fusion_kernel_runtime.cpp Outdated Show resolved Hide resolved
tests/cpp/test_host_irs.cpp Outdated Show resolved Hide resolved
@wujingyue
Copy link
Collaborator

HostIr Integration 2

It needs a better title that describes the actual functionality.

@nsarka nsarka changed the title HostIr Integration 2 Add optional lowering to Host IR in FusionKernelRuntime Feb 12, 2025
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