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

runtime(cinn): update cinn jit instruction to support dynamic shape #59470

Merged
merged 2 commits into from
Dec 1, 2023

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

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.

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
29 checks passed
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.

None yet

4 participants