Add function (task)-level hardware target assignment pass for heterogeneous computing#252
Add function (task)-level hardware target assignment pass for heterogeneous computing#252YanzhouTang wants to merge 3 commits intocoredac:mainfrom
Conversation
|
what is the principle to determine which accelerator should be assigned to which kernel? |
Currently, it's hardcoded for the NeRF use case with name-based pattern matching (e.g., We plan to add YAML configuration support in the next iteration to allow flexible user-specified mappings. Fully automated partitioning based on workload analysis is a potential future direction, but we believe explicit configuration provides better predictability and user control for now. |
Sounds good on the naming pattern matching part. However, plz discuss with @ShangkunLi about the granularity of assigning kernel to accelerator. It seems @ShangkunLi and @HobbitQia would perform mapping algorithm on kernel instead of func. So we either need to somehow transform func to neura kernel, or vice versa. WDYT, @ShangkunLi @HobbitQia @YanzhouTang? |
Thanks for raising this important point! Before responding, I'd like to clarify a few technical details about the granularity and integration: @ShangkunLi @HobbitQia
Let's align on these before finalizing the design. Happy to adjust the implementation based on your feedback! |
Summary
This PR introduces a new pass
AssignTaskTargetthat operates at a higher abstraction level than existing partitioning mechanisms. It assigns hardware targets (CPU, CGRA, DOE) to compute functions before they are lowered to taskflow operations, enabling coarse-grained workload partitioning in heterogeneous computing systems.Motivation
The existing
PartitionTaskByTargetpass operates at the taskflow level (loop-to-CGRA mapping), which is fine-grained for certain use cases. We need a higher-level pass that can:Changes
New Pass:
AssignTaskTargetlib/Conversion/AssignTaskTarget/target.deviceattributesmlir-neura-opt --assign-task-target input.mlirExample transformation:
// Before
func.func @hash_encoder_func(...) { ... }
// After
func.func @hash_encoder_func(...) attributes {target.device = "doe"} { ... }