super_kernel Use Case Demonstration

Use Case Function:

sk1 fuses GroupedMatmul+GroupedMatmul+MoeGatingTopK three operators.

Use super_kernel to Fuse Operators

Use the following with statement block (super_kernel). Operators within the statement block are all fused into one super kernel for computation:

with torchair.scope.super_kernel("sk1"): 

For detailed function introduction, see Mark SuperKernel Scope in Graph.

Execution Command

python3 superkernel_scope.py

Expected Execution Result

After execution, print shows success:

execute sample success