Skip to content

Conversation

@6clc
Copy link
Contributor

@6clc 6clc commented Nov 29, 2023

PR types

Others

PR changes

Others

Description

cinn jit instruction 支持动态shape。

  • 1. cinn jit instruction 由调用 cuda kernel ptr 改为 host kernel ptr

  • 2. CINNKernelInfo额外包含非tensor arg信息。数据结构详见代码注释。

以调用cos算子为例子,
host kernel cinn ir 如下

Module Pir_host {
     function fn_cos (kernel_args, kernel_args_num, kernel_stream)
     cinn_call_cuda_kernel(fn_cos_kernel, kernel_args, kernel_args_num, 1, 1, 1, 4, 1, 1, kernel_stream)
}

cuda kernel cinn ir 如下

function fn_cos_kernel (_var_0, _var_3)
 { 
   if ((threadIdx.x < 4)) {
      var_3[(threadIdx.x / 2), (threadIdx.x % 2)] = cinn_nvgpu_cos_fp32(var_0[(threadIdx.x / 2), (threadIdx.x % 2)])
   }
}

Pcard-78120

@paddle-bot
Copy link

paddle-bot bot commented Nov 29, 2023

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@paddle-bot
Copy link

paddle-bot bot commented Nov 29, 2023

✅ This PR's description meets the template requirements!
Please wait for other CI results.

zhhsplendid
zhhsplendid previously approved these changes Nov 29, 2023
Copy link
Member

@zhhsplendid zhhsplendid left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@zhangbo9674 zhangbo9674 left a comment

Choose a reason for hiding this comment

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

LGTM for cinn_jit_instruction

@ZzSean ZzSean merged commit ed58b86 into PaddlePaddle:develop Dec 1, 2023
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.

4 participants